36 if (!driver || !driver->
hw_init()) {
84 bool success =
_dev->
transfer((uint8_t *)&init_seq,
sizeof(init_seq),
nullptr, 0);
112 } command = { 0x0, {0x21, 0, 127, 0x22, 0, 7} };
117 } display_buffer = { 0x40, {} };
122 _dev->
transfer((uint8_t *)&command,
sizeof(command),
nullptr, 0);
125 _dev->
transfer((uint8_t *)&display_buffer, SSD1306_COLUMNS/2 + 1,
nullptr, 0);
127 memcpy(&display_buffer.db[0], &
_displaybuffer[i * SSD1306_COLUMNS + SSD1306_COLUMNS/2 ], SSD1306_COLUMNS/2);
128 _dev->
transfer((uint8_t *)&display_buffer, SSD1306_COLUMNS/2 + 1,
nullptr, 0);
static Display_SSD1306_I2C * probe(AP_HAL::OwnPtr< AP_HAL::Device > dev)
virtual PeriodicHandle register_periodic_callback(uint32_t period_usec, PeriodicCb)=0
virtual AP_HAL::Semaphore * get_semaphore()=0
#define SSD1306_ROWS_PER_PAGE
#define HAL_SEMAPHORE_BLOCK_FOREVER
virtual bool take(uint32_t timeout_ms) WARN_IF_UNUSED=0
Display_SSD1306_I2C(AP_HAL::OwnPtr< AP_HAL::Device > dev)
AP_HAL::OwnPtr< AP_HAL::Device > _dev
static AP_HAL::OwnPtr< AP_HAL::Device > dev
void clear_screen() override
void hw_update() override
virtual bool transfer(const uint8_t *send, uint32_t send_len, uint8_t *recv, uint32_t recv_len)=0
void set_pixel(uint16_t x, uint16_t y) override
uint8_t _displaybuffer[SSD1306_COLUMNS *SSD1306_ROWS_PER_PAGE]
#define FUNCTOR_BIND_MEMBER(func, rettype,...)
void clear_pixel(uint16_t x, uint16_t y) override
~Display_SSD1306_I2C() override