aboutsummaryrefslogtreecommitdiff
path: root/src/ppu
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-03-29 20:19:28 +0200
committerlonkaars <loek@pipeframe.xyz>2023-03-29 20:19:28 +0200
commit54b6ca70a74b3beb1331fd0b0bed28c665ed1f4d (patch)
tree0ee401a0e3dd36be7719f738df3175fb7d8fd01e /src/ppu
parent9f38ab7fd66698c43b78b508eebc85730ba114b8 (diff)
more debugging WIP
Diffstat (limited to 'src/ppu')
-rw-r--r--src/ppu/stm.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ppu/stm.c b/src/ppu/stm.c
index fd4a18c..371e557 100644
--- a/src/ppu/stm.c
+++ b/src/ppu/stm.c
@@ -1,4 +1,23 @@
+#include <stm32f0xx_hal.h>
+
#include "ppu/ppu.h"
+#include "ppu/internals.h"
+#include "stm32/setup.h"
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);
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, true);
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, false);
+}