kopia lustrzana https://github.com/pimoroni/pimoroni-pico
DV Display: Claim unused channels and SMs.
rodzic
7d8bbf5c08
commit
cbc05863c0
|
@ -48,14 +48,11 @@ namespace pimoroni {
|
||||||
gpio_disable_pulls(pin_d0 + i);
|
gpio_disable_pulls(pin_d0 + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
pio_sm = 1;
|
pio_sm = pio_claim_unused_sm(pio, true);
|
||||||
pio_sm_claim(pio, pio_sm);
|
|
||||||
|
|
||||||
// Claim DMA channels
|
// Claim DMA channels
|
||||||
dma_channel = 0;
|
dma_channel = dma_claim_unused_channel(true);
|
||||||
dma_channel_claim(dma_channel);
|
read_cmd_dma_channel = dma_claim_unused_channel(true);
|
||||||
read_cmd_dma_channel = 1;
|
|
||||||
dma_channel_claim(read_cmd_dma_channel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void APS6404::init() {
|
void APS6404::init() {
|
||||||
|
|
|
@ -15,7 +15,11 @@ extern "C" {
|
||||||
|
|
||||||
namespace pimoroni {
|
namespace pimoroni {
|
||||||
|
|
||||||
void DVDisplay::init() {
|
void DVDisplay::init(uint16_t width, uint16_t height, Mode mode) {
|
||||||
|
this->width = width;
|
||||||
|
this->height = height;
|
||||||
|
this->mode = mode;
|
||||||
|
|
||||||
uint8_t res_mode = 0xFF;
|
uint8_t res_mode = 0xFF;
|
||||||
uint16_t full_width = width;
|
uint16_t full_width = width;
|
||||||
uint16_t full_height = height;
|
uint16_t full_height = height;
|
||||||
|
|
|
@ -72,19 +72,15 @@ namespace pimoroni {
|
||||||
// 800x600 (60Hz), 800x480 (60Hz), 800x450 (60Hz), 960x540 (50Hz), 1280x720 (30Hz)
|
// 800x600 (60Hz), 800x480 (60Hz), 800x450 (60Hz), 960x540 (50Hz), 1280x720 (30Hz)
|
||||||
// Note resolutions on the second line require quite extreme overclocking and may not work on all hardware.
|
// Note resolutions on the second line require quite extreme overclocking and may not work on all hardware.
|
||||||
// Either or both of the horizontal or vertical component of any resolution may be halved.
|
// Either or both of the horizontal or vertical component of any resolution may be halved.
|
||||||
DVDisplay(uint16_t width, uint16_t height, Mode mode = MODE_RGB555)
|
DVDisplay()
|
||||||
: ram(CS, D0, pio1)
|
: ram(CS, D0, pio1)
|
||||||
, i2c(new I2C(I2C_SDA, I2C_SCL))
|
, i2c(new I2C(I2C_SDA, I2C_SCL))
|
||||||
, width(width), height(height)
|
|
||||||
, mode(mode)
|
|
||||||
, pixel_buffer_location(-1, -1)
|
, pixel_buffer_location(-1, -1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
DVDisplay(uint16_t width, uint16_t height, I2C* i2c, Mode mode = MODE_RGB555)
|
DVDisplay(I2C* i2c)
|
||||||
: ram(CS, D0, pio1)
|
: ram(CS, D0, pio1)
|
||||||
, i2c(i2c)
|
, i2c(i2c)
|
||||||
, width(width), height(height)
|
|
||||||
, mode(mode)
|
|
||||||
, pixel_buffer_location(-1, -1)
|
, pixel_buffer_location(-1, -1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -131,7 +127,7 @@ namespace pimoroni {
|
||||||
void write_pixel(const Point &p, RGB888 colour) override;
|
void write_pixel(const Point &p, RGB888 colour) override;
|
||||||
void write_pixel_span(const Point &p, uint l, RGB888 colour) override;
|
void write_pixel_span(const Point &p, uint l, RGB888 colour) override;
|
||||||
|
|
||||||
void init();
|
void init(uint16_t width, uint16_t height, Mode mode = MODE_RGB555);
|
||||||
void flip();
|
void flip();
|
||||||
|
|
||||||
// 32 colour palette mode. Note that palette entries range from 0-31,
|
// 32 colour palette mode. Note that palette entries range from 0-31,
|
||||||
|
|
|
@ -102,7 +102,7 @@ static bool connect(bool first = true, uint core = 0) {
|
||||||
if (first) {
|
if (first) {
|
||||||
pio_prog = &swd_raw_write_program;
|
pio_prog = &swd_raw_write_program;
|
||||||
pio_offset = pio_change_exclusive_program(swd_pio, &swd_raw_write_program);
|
pio_offset = pio_change_exclusive_program(swd_pio, &swd_raw_write_program);
|
||||||
pio_sm = 0;
|
pio_sm = pio_claim_unused_sm(swd_pio, true);
|
||||||
|
|
||||||
swd_initial_init(swd_pio, pio_sm, 2, 3);
|
swd_initial_init(swd_pio, pio_sm, 2, 3);
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue