You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
695 B

#pragma once
#include "Display.h"
#include "Display_OLED_I2C.h"
#include <AP_HAL/I2CDevice.h>
#define SSD1306_COLUMNS 128 // display columns
#define SSD1306_ROWS 64 // display rows
#define SSD1306_ROWS_PER_PAGE 8
class Display_SSD1306_I2C: public Display_OLED_I2C {
protected:
virtual bool hw_init();
virtual bool hw_update();
virtual bool set_pixel(uint16_t x, uint16_t y);
virtual bool clear_pixel(uint16_t x, uint16_t y);
virtual bool clear_screen();
void _update_timer() override;
private:
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
uint8_t _displaybuffer[SSD1306_COLUMNS * SSD1306_ROWS_PER_PAGE];
bool _need_hw_update;
void _timer(void);
};