27 #if defined(SSD1306_STM32_PLATFORM) 30 #include "stm32f1xx_hal.h" 36 #if defined(CONFIG_PLATFORM_I2C_AVAILABLE) && defined(CONFIG_PLATFORM_I2C_ENABLE) 37 static uint8_t s_i2c_addr = 0x3C;
39 static void platform_i2c_start(
void)
44 static void platform_i2c_stop(
void)
49 static void platform_i2c_send(uint8_t data)
54 static void platform_i2c_close(
void)
59 static void platform_i2c_send_buffer(
const uint8_t *data, uint16_t len)
66 if (addr) s_i2c_addr = addr;
67 if (HAL_I2C_IsDeviceReady(&hi2c1, s_i2c_addr, 1, 20000) != HAL_OK)
84 #if defined(CONFIG_PLATFORM_SPI_AVAILABLE) && defined(CONFIG_PLATFORM_SPI_ENABLE) 88 static void platform_spi_start(
void)
93 static void platform_spi_stop(
void)
98 static void platform_spi_send(uint8_t data)
103 static void platform_spi_close(
void)
108 static void platform_spi_send_buffer(
const uint8_t *data, uint16_t len)
130 #endif // YOUR_PLATFORM
void ssd1306_platform_spiInit(int8_t busId, int8_t cesPin, int8_t dcPin)
Initializes spi interface for platform being used.
void(* send)(uint8_t data)
void ssd1306_platform_i2cInit(int8_t busId, uint8_t addr, ssd1306_platform_i2cConfig_t *cfg)
Initializes i2c interface for platform being used.
void(* close)(void)
deinitializes internal resources, allocated for interface.
ssd1306_interface_t ssd1306_intf
void(* send_buffer)(const uint8_t *buffer, uint16_t size)
Sends bytes to SSD1306 device.