diff options
Diffstat (limited to 'boards/base/Mikromedia-Plus-STM32-M4')
4 files changed, 29 insertions, 29 deletions
diff --git a/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.c b/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.c index ccd3ab9f..56a1b99a 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.c +++ b/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.c @@ -19,10 +19,10 @@ static const SPIConfig flash_spicfg = { }; bool flash_is_write_busy(void) { - static uint8_t is_write_busy_cmd[1]; + static gU8 is_write_busy_cmd[1]; is_write_busy_cmd[0] = _SERIAL_FLASH_CMD_RDSR; - uint8_t result[1]; + gU8 result[1]; spiAcquireBus(&SPID3); spiStart(&SPID3, &flash_spicfg); @@ -44,9 +44,9 @@ void flash_write_enable(void) { spiReleaseBus(&SPID3); } -void flash_sector_erase(uint32_t sector) { +void flash_sector_erase(gU32 sector) { flash_write_enable(); - static uint8_t sector_erase_cmd[4]; + static gU8 sector_erase_cmd[4]; sector_erase_cmd[0] = _SERIAL_FLASH_CMD_SER; sector_erase_cmd[1] = (sector >> 16) & 0xFF; sector_erase_cmd[2] = (sector >> 8) & 0xFF; @@ -64,8 +64,8 @@ void flash_sector_erase(uint32_t sector) { while(flash_is_write_busy()); } -void flash_read(uint32_t address, size_t bytes, uint8_t *out) { - static uint8_t sector_read_cmd[4]; +void flash_read(gU32 address, gMemSize bytes, gU8 *out) { + static gU8 sector_read_cmd[4]; sector_read_cmd[0] = _SERIAL_FLASH_CMD_READ; sector_read_cmd[1] = (address >> 16) & 0xFF; sector_read_cmd[2] = (address >> 8) & 0xFF; @@ -80,8 +80,8 @@ void flash_read(uint32_t address, size_t bytes, uint8_t *out) { spiReleaseBus(&SPID3); } -void flash_write(uint32_t address, size_t bytes, const uint8_t *data) { - static uint8_t flash_write_cmd[4]; +void flash_write(gU32 address, gMemSize bytes, const gU8 *data) { + static gU8 flash_write_cmd[4]; flash_write_enable(); @@ -103,21 +103,21 @@ void flash_write(uint32_t address, size_t bytes, const uint8_t *data) { } bool flash_tp_calibrated(void) { - uint8_t out[1]; + gU8 out[1]; flash_read(0x0F0000, 1, out); return (out[0] == 0x01); } -void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz) { +void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz) { if (instance) return; flash_sector_erase(0x0F0000); - uint8_t calibrated = 0x01; + gU8 calibrated = 0x01; flash_write(0x0F0000, 1, &calibrated); flash_write(0x0F0001, sz, calbuf); } -const char *flash_tp_calibration_load(uint16_t instance) { - static uint8_t foo[24]; +const char *flash_tp_calibration_load(gU16 instance) { + static gU8 foo[24]; if (instance) return 0; if (!flash_tp_calibrated()) return 0; diff --git a/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.h b/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.h index 2dcc9206..8dfdbb20 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.h +++ b/boards/base/Mikromedia-Plus-STM32-M4/ChibiOS_Board/flash_memory.h @@ -1,6 +1,6 @@ -void flash_sector_erase(uint32_t sector); -void flash_read(uint32_t address, size_t bytes, uint8_t *out); -void flash_write(uint32_t address, size_t bytes, const uint8_t *data); +void flash_sector_erase(gU32 sector); +void flash_read(gU32 address, gMemSize bytes, gU8 *out); +void flash_write(gU32 address, gMemSize bytes, const gU8 *data); bool flash_tp_calibrated(void); -void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz); -const char *flash_tp_calibration_load(uint16_t instance); +void flash_tp_calibration_save(gU16 instance, const gU8 *calbuf, gMemSize sz); +const char *flash_tp_calibration_load(gU16 instance); diff --git a/boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h b/boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h index 456986d6..7dc34449 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h +++ b/boards/base/Mikromedia-Plus-STM32-M4/board_SSD1963.h @@ -87,7 +87,7 @@ static GFXINLINE void release_bus(GDisplay *g) { SET_CS; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; CLR_DC; @@ -97,7 +97,7 @@ static GFXINLINE void write_index(GDisplay *g, uint16_t index) { SET_DC; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; palWriteBus(&busDataLo, (data & 0xFF)); @@ -117,8 +117,8 @@ static GFXINLINE void setwritemode(GDisplay *g) { palSetBusMode(&busDataHi, PAL_MODE_OUTPUT_PUSHPULL); } -static GFXINLINE uint16_t read_data(GDisplay *g) { - uint16_t data; +static GFXINLINE gU16 read_data(GDisplay *g) { + gU16 data; (void) g; CLR_RD; diff --git a/boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h b/boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h index 5df2d5cd..d94e97a3 100644 --- a/boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h +++ b/boards/base/Mikromedia-Plus-STM32-M4/gmouse_lld_STMPE610_board.h @@ -77,8 +77,8 @@ static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { - uint8_t txbuf[2]; +static void write_reg(GMouse* m, gU8 reg, gU8 val) { + gU8 txbuf[2]; (void) m; txbuf[0] = reg; @@ -89,8 +89,8 @@ static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { i2cReleaseBus(&I2CD1); } -static uint8_t read_byte(GMouse* m, uint8_t reg) { - uint8_t rxbuf[1]; +static gU8 read_byte(GMouse* m, gU8 reg) { + gU8 rxbuf[1]; (void) m; rxbuf[0] = 0; @@ -102,8 +102,8 @@ static uint8_t read_byte(GMouse* m, uint8_t reg) { return rxbuf[0]; } -static uint16_t read_word(GMouse* m, uint8_t reg) { - uint8_t rxbuf[2]; +static gU16 read_word(GMouse* m, gU8 reg) { + gU8 rxbuf[2]; (void) m; rxbuf[0] = 0; @@ -113,7 +113,7 @@ static uint16_t read_word(GMouse* m, uint8_t reg) { i2cMasterTransmitTimeout(&I2CD1, STMPE610_ADDR, ®, 1, rxbuf, 2, MS2ST(STMPE610_TIMEOUT)); i2cReleaseBus(&I2CD1); - return (((uint16_t)rxbuf[0]) << 8) | rxbuf[1]; + return (((gU16)rxbuf[0]) << 8) | rxbuf[1]; } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ |