#ifndef __OLED_CONFIG_H #define __OLED_CONFIG_H // Интерфейс экрана //#define I2C_BRIDGE // Интерфейс экрана #define SPI_BRIDGE #define OLED_RST_PIN GPIO_PIN_5 #define OLED_RST_PORT GPIOA #define OLED_DC_PIN GPIO_PIN_6 #define OLED_DC_PORT GPIOA #define OLED_CS_PIN GPIO_PIN_7 #define OLED_CS_PORT GPIOA #define OLED_RST_0 HAL_GPIO_WritePin(OLED_RST_PORT, OLED_RST_PIN, GPIO_PIN_RESET) #define OLED_RST_1 HAL_GPIO_WritePin(OLED_RST_PORT, OLED_RST_PIN, GPIO_PIN_SET) #define OLED_DC_0 HAL_GPIO_WritePin(OLED_DC_PORT, OLED_DC_PIN, GPIO_PIN_RESET) #define OLED_DC_1 HAL_GPIO_WritePin(OLED_DC_PORT, OLED_DC_PIN, GPIO_PIN_SET) #define OLED_CS_0 HAL_GPIO_WritePin(OLED_CS_PORT, OLED_CS_PIN, GPIO_PIN_RESET) #define OLED_CS_1 HAL_GPIO_WritePin(OLED_CS_PORT, OLED_CS_PIN, GPIO_PIN_SET) // SPI settings #define OLED_SPI_SCK_PORT GPIOB #define OLED_SPI_SCK_PIN GPIO_PIN_13 #define OLED_SPI_SCK_AF GPIO_AF5_SPI2 #define OLED_SPI_CS_PORT GPIOB #define OLED_SPI_CS_PIN GPIO_PIN_12 #define OLED_SPI_MOSI_PORT GPIOB #define OLED_SPI_MOSI_PIN GPIO_PIN_15 #define OLED_SPI_MOSI_AF GPIO_AF5_SPI2 #define OLED_SPI_MISO_PORT GPIOB #define OLED_SPI_MISO_PIN GPIO_PIN_14 #define OLED_SPI_MISO_AF GPIO_AF5_SPI2 // OLED settings #define OLED_I2C_ADDR 0x7A #define OLED_HEIGHT 128 #define OLED_WIDTH 128 #define OLED_BUF_SIZE 8192 // OLED_HEIGHT * OLED_WIDTH / 2 #endif // __OLED_CONFIG_H