stm32f1/lib/busvoodoo_oled.h

56 lines
2.5 KiB
C

/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/** 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
* @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);