2015-12-22 17:16:19 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Display.h"
|
2016-09-30 04:21:28 -03:00
|
|
|
#include "Display_OLED_I2C.h"
|
2016-04-18 17:38:28 -03:00
|
|
|
#include <AP_HAL/I2CDevice.h>
|
2015-12-22 17:16:19 -04:00
|
|
|
|
2016-09-30 04:21:28 -03:00
|
|
|
#define SSD1306_COLUMNS 128 // display columns
|
|
|
|
#define SSD1306_ROWS 64 // display rows
|
|
|
|
#define SSD1306_ROWS_PER_PAGE 8
|
2015-12-22 17:16:19 -04:00
|
|
|
|
2016-09-30 04:21:28 -03:00
|
|
|
class Display_SSD1306_I2C: public Display_OLED_I2C {
|
|
|
|
|
|
|
|
protected:
|
2017-01-17 08:21:35 -04:00
|
|
|
bool hw_init() override;
|
|
|
|
bool hw_update() override;
|
|
|
|
bool set_pixel(uint16_t x, uint16_t y) override;
|
|
|
|
bool clear_pixel(uint16_t x, uint16_t y) override;
|
|
|
|
bool clear_screen() override;
|
2016-09-30 04:21:28 -03:00
|
|
|
|
|
|
|
void _update_timer() override;
|
2015-12-22 17:16:19 -04:00
|
|
|
|
|
|
|
private:
|
2016-04-18 17:38:28 -03:00
|
|
|
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
|
2016-09-30 04:21:28 -03:00
|
|
|
uint8_t _displaybuffer[SSD1306_COLUMNS * SSD1306_ROWS_PER_PAGE];
|
2016-11-04 01:22:01 -03:00
|
|
|
bool _need_hw_update;
|
2015-12-22 17:16:19 -04:00
|
|
|
};
|