stm32f1/lib/busvoodoo_oled.h

43 lines
1.9 KiB
C

/** library to show BusVoodoo mode information on SSD1306 OLED display: name, activity, pinout (API)
* @file busvoodoo_oled.h
* @author King Kévin <kingkevin@cuvoodoo.info>
* @date 2018
* @copyright SPDX-License-Identifier: GPL-3.0-or-later
* @note peripherals used: I2C @ref oled_ssd1306_i2c
*/
#include "font.h"
/** setup OLED display */
void busvoodoo_oled_setup(void);
/** clear display buffer
* @note update the display to clear it
*/
void busvoodoo_oled_clear(void);
/** draw text in display buffer
* @param[in] column display column where to start drawing the text (0 is left)
* @param[in] row display row where to put the lower end of the characters (0 is top)
* @param[in] font_name name of the font to use to draw the text
* @param[in] text text string to draw
*/
void busvoodoo_oled_text_pos(uint8_t column, uint8_t row, enum font_name font_name, const char *text);
/** draw mode text on top (yellow) left side in display buffer
* @warning this clears the top line, including the text on the right side
* @note update the display to display the text
* @param[in] text text to display on top left side of screen
*/
void busvoodoo_oled_text_left(char* text);
/** draw mode text on top (yellow) right side in display buffer
* @warning this does not clear the top line, including the text on the right side
* @note update the display to display the text
* @param[in] text text to display on top right side of screen
*/
void busvoodoo_oled_text_right(char* text);
/** draw pin names on bottom (blue) part in display buffer
* @param[in] pins pin names
* @param[in] io_connector display I/O connector (true) or RS/CAN connector + top half of I/O connector (false)
* @note update the display to display the text
*/
void busvoodoo_oled_text_pinout(const char* pins[10], bool io_connector);
/** update OLED display RAM with current display buffer */
void busvoodoo_oled_update(void);