diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-03-30 15:10:17 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-03-30 15:10:17 +0200 |
commit | 6292c1101121bc8ba2db752cab3cbe41469b29d0 (patch) | |
tree | b8cc9ac68b2c972b67d8aa4c9da84ea8c415a759 /src/ppu/stm.c | |
parent | 54b6ca70a74b3beb1331fd0b0bed28c665ed1f4d (diff) |
new spi system
Diffstat (limited to 'src/ppu/stm.c')
-rw-r--r-- | src/ppu/stm.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/ppu/stm.c b/src/ppu/stm.c index 371e557..18811cf 100644 --- a/src/ppu/stm.c +++ b/src/ppu/stm.c @@ -7,17 +7,10 @@ void hh_ppu_init() {} void hh_ppu_deinit() {} -void hh_ppu_vram_dwrite(hh_ppu_addr_t addr, hh_ppu_data_t data) { - // if (!hh_ppu_vram_valid_address(addr)) return; - - uint8_t spi_data[4] = { - (addr & 0xff00) >> 8, - (addr & 0x00ff) >> 0, - (data & 0xff00) >> 8, - (data & 0x00ff) >> 0, - }; - - HAL_SPI_Transmit(&hspi1, spi_data, 4, HAL_MAX_DELAY); +void hh_ppu_vram_dwrite(uint8_t* data, size_t size) { + HAL_SPI_Transmit(&hspi1, data, size, HAL_MAX_DELAY); + HAL_SPI_Transmit(&hspi1, (uint8_t[4]) { 0xff, 0xff, 0xff, 0xff }, 4, HAL_MAX_DELAY); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, true); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, false); } + |