Initial Demo OS
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#ifndef OS_OLED_H
|
||||
#define OS_OLED_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/i2c_master.h"
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OLED_I2C_PORT 0 /* i2c_port_num_t */
|
||||
#define OLED_I2C_ADDR 0x3C
|
||||
#define OLED_PIN_SDA GPIO_NUM_5
|
||||
#define OLED_PIN_SCL GPIO_NUM_6
|
||||
#define OLED_I2C_FREQ_HZ 400000
|
||||
|
||||
#define OLED_WIDTH 72
|
||||
#define OLED_HEIGHT 40
|
||||
#define OLED_PAGES 5
|
||||
#define OLED_BUFFER_SIZE (OLED_WIDTH * OLED_PAGES)
|
||||
|
||||
#ifndef OLED_COLUMN_OFFSET
|
||||
#define OLED_COLUMN_OFFSET 28
|
||||
#endif
|
||||
|
||||
#define COLOR_BLACK 0
|
||||
#define COLOR_WHITE 1
|
||||
#define COLOR_INVERT 2
|
||||
|
||||
esp_err_t oled_driver_init(gpio_num_t sda, gpio_num_t scl, uint8_t col_offset);
|
||||
uint8_t *oled_driver_get_buffer(void);
|
||||
void oled_driver_clear(void);
|
||||
void oled_driver_fill(void);
|
||||
esp_err_t oled_driver_flush(void);
|
||||
esp_err_t oled_driver_set_contrast(uint8_t contrast);
|
||||
esp_err_t oled_driver_set_invert(bool invert);
|
||||
void oled_driver_draw_pixel(int16_t x, int16_t y, uint8_t color);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OS_OLED_H
|
||||
Reference in New Issue
Block a user