mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-04 15:08:28 -04:00
c5ba54c3fe
This makes the display architecture closer to our other frontend/backend splits Added check that display is initialised successfully in hw_init Renamed _update_timer to just _timer to make more consistent with other drivers
27 lines
656 B
C++
27 lines
656 B
C++
#pragma once
|
|
|
|
#include "Display.h"
|
|
#include "Display_Backend.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_Backend {
|
|
|
|
public:
|
|
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;
|
|
|
|
private:
|
|
void _timer();
|
|
|
|
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
|
|
uint8_t _displaybuffer[SSD1306_COLUMNS * SSD1306_ROWS_PER_PAGE];
|
|
bool _need_hw_update;
|
|
};
|