diff --git a/ssd1306.h b/ssd1306.h --- a/ssd1306.h +++ b/ssd1306.h @@ -12,26 +12,19 @@ #define SSD_CS_Low() HAL_GPIO_WritePin(SSD_CS, 0) #define SSD_CS_High() HAL_GPIO_WritePin(SSD_CS, 1) -// Use stdperiph - -//extern SPI_HandleTypeDef spi1; - -extern SPI_HandleTypeDef hspi1; - // EMZ FIXME this won't really work -#define SPI_SendByte(data) HAL_SPI_Transmit(&hspi1, &data, 1, 100) +#define SPI_SendByte(data) HAL_SPI_Transmit(spi_get(), &data, 1, 100) //#define SPI_SendByte(data) #define SPI_Wait() //#define SPI_SendByte(data) SPI_I2S_SendData(SPI1,data) - //#define SPI_Wait() while(!(SPI1->SR&SPI_FLAG_TXE));while(SPI1->SR&SPI_FLAG_BSY); -void ssd1306_Init(void); -void ssd1306_DrawChar(char ascii, unsigned char row, unsigned char xPos); -void ssd1306_DrawCharBig(char ascii, unsigned char row, unsigned char xPos); -void ssd1306_DrawString(const char *dataPtr, unsigned char row, unsigned char xPos); -void ssd1306_DrawStringBig(const char *dataPtr, unsigned char row, unsigned char xPos); +void ssd1306_init(void); +void ssd1306_drawchar(char ascii, unsigned char row, unsigned char xPos); +void ssd1306_drawcharbig(char ascii, unsigned char row, unsigned char xPos); +void ssd1306_drawstring(const char *dataPtr, unsigned char row, unsigned char xPos); +void ssd1306_drawstringbig(const char *dataPtr, unsigned char row, unsigned char xPos); void ssd1306_drawlogo(); void ssd1306_clearscreen();