mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-04 23:18:28 -04:00
27 lines
671 B
C++
27 lines
671 B
C++
#pragma once
|
|
|
|
#include "Display.h"
|
|
#include "Display_OLED_I2C.h"
|
|
#include <AP_HAL/I2CDevice.h>
|
|
|
|
#define SH1106_COLUMNS 132 // display columns
|
|
#define SH1106_ROWS 64 // display rows
|
|
#define SH1106_ROWS_PER_PAGE 8
|
|
|
|
class Display_SH1106_I2C: public Display_OLED_I2C {
|
|
|
|
protected:
|
|
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;
|
|
|
|
void _update_timer() override;
|
|
|
|
private:
|
|
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
|
|
uint8_t _displaybuffer[SH1106_COLUMNS * SH1106_ROWS_PER_PAGE];
|
|
bool _need_hw_update;
|
|
};
|