2020-11-24 15:56:00 +01:00
|
|
|
/** SSD1306 OLED library
|
2019-12-04 23:15:25 +01:00
|
|
|
* @file
|
2018-04-03 17:00:04 +02:00
|
|
|
* @author King Kévin <kingkevin@cuvoodoo.info>
|
2020-06-06 14:35:55 +02:00
|
|
|
* @copyright SPDX-License-Identifier: GPL-3.0-or-later
|
2020-12-12 14:09:35 +01:00
|
|
|
* @date 2018-2020
|
|
|
|
* @note peripherals used: I2C @ref i2c_master_i2c
|
2018-04-03 17:00:04 +02:00
|
|
|
*/
|
2020-11-24 15:56:00 +01:00
|
|
|
#pragma once
|
2018-04-03 17:00:04 +02:00
|
|
|
|
|
|
|
/** setup OLED display
|
2019-12-05 13:28:07 +01:00
|
|
|
* @param[in] slave_addr I²C slave address of SSD1306 device (least significant 7-bit)
|
|
|
|
* @return if the display setup is successful, else the display is probably not on the I²C bus
|
|
|
|
* @warning only one display on the I²C bus is currently supported
|
2018-04-03 17:00:04 +02:00
|
|
|
*/
|
2019-12-04 23:14:27 +01:00
|
|
|
bool oled_ssd1306_setup(uint8_t slave_addr);
|
2018-04-03 17:00:04 +02:00
|
|
|
/** switch OLED display on */
|
|
|
|
void oled_ssd1306_on(void);
|
|
|
|
/** switch OLED display off */
|
|
|
|
void oled_ssd1306_off(void);
|
|
|
|
/** test OLED display: switch entire screen on for a brief time */
|
|
|
|
void oled_ssd1306_test(void);
|
|
|
|
/** send data to display to OLED display
|
|
|
|
* @param[in] display_data data to display (first byte is left column, MSb is top pixel, warps pages)
|
|
|
|
* @param[in] display_length length of data to display
|
|
|
|
*/
|
|
|
|
void oled_ssd1306_display(const uint8_t* display_data, uint16_t display_length);
|