DV Display: Claim unused channels and SMs.

dv_stick
Phil Howard 2023-06-28 13:31:23 +01:00
rodzic 7d8bbf5c08
commit cbc05863c0
4 zmienionych plików z 12 dodań i 15 usunięć

Wyświetl plik

@ -48,14 +48,11 @@ namespace pimoroni {
gpio_disable_pulls(pin_d0 + i);
}
pio_sm = 1;
pio_sm_claim(pio, pio_sm);
pio_sm = pio_claim_unused_sm(pio, true);
// Claim DMA channels
dma_channel = 0;
dma_channel_claim(dma_channel);
read_cmd_dma_channel = 1;
dma_channel_claim(read_cmd_dma_channel);
dma_channel = dma_claim_unused_channel(true);
read_cmd_dma_channel = dma_claim_unused_channel(true);
}
void APS6404::init() {

Wyświetl plik

@ -15,7 +15,11 @@ extern "C" {
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;
uint16_t full_width = width;
uint16_t full_height = height;

Wyświetl plik

@ -72,19 +72,15 @@ namespace pimoroni {
// 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.
// 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)
, i2c(new I2C(I2C_SDA, I2C_SCL))
, width(width), height(height)
, mode(mode)
, 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)
, i2c(i2c)
, width(width), height(height)
, mode(mode)
, pixel_buffer_location(-1, -1)
{}
@ -131,7 +127,7 @@ namespace pimoroni {
void write_pixel(const Point &p, 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();
// 32 colour palette mode. Note that palette entries range from 0-31,

Wyświetl plik

@ -102,7 +102,7 @@ static bool connect(bool first = true, uint core = 0) {
if (first) {
pio_prog = &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);