35 if (!driver || !driver->
hw_init()) {
76 bool success =
_dev->
transfer((uint8_t *)&init_seq,
sizeof(init_seq),
nullptr, 0);
106 } command = { 0x0, 0x2, 0x10, 0xB0 };
111 } display_buffer = { 0x40, {} };
115 command.page = 0xB0 | (i & 0x0F);
116 _dev->
transfer((uint8_t *)&command,
sizeof(command),
nullptr, 0);
119 _dev->
transfer((uint8_t *)&display_buffer, SH1106_COLUMNS/2 + 1,
nullptr, 0);
120 memcpy(&display_buffer.db[0], &
_displaybuffer[i * SH1106_COLUMNS + SH1106_COLUMNS/2 ], SH1106_COLUMNS/2);
121 _dev->
transfer((uint8_t *)&display_buffer, SH1106_COLUMNS/2 + 1,
nullptr, 0);
void clear_screen() override
virtual PeriodicHandle register_periodic_callback(uint32_t period_usec, PeriodicCb)=0
Display_SH1106_I2C(AP_HAL::OwnPtr< AP_HAL::Device > dev)
virtual AP_HAL::Semaphore * get_semaphore()=0
#define HAL_SEMAPHORE_BLOCK_FOREVER
virtual bool take(uint32_t timeout_ms) WARN_IF_UNUSED=0
void clear_pixel(uint16_t x, uint16_t y) override
AP_HAL::OwnPtr< AP_HAL::Device > _dev
#define SH1106_ROWS_PER_PAGE
void hw_update() override
static AP_HAL::OwnPtr< AP_HAL::Device > dev
uint8_t _displaybuffer[SH1106_COLUMNS *SH1106_ROWS_PER_PAGE]
virtual bool transfer(const uint8_t *send, uint32_t send_len, uint8_t *recv, uint32_t recv_len)=0
~Display_SH1106_I2C() override
#define FUNCTOR_BIND_MEMBER(func, rettype,...)
static Display_SH1106_I2C * probe(AP_HAL::OwnPtr< AP_HAL::Device > dev)
void set_pixel(uint16_t x, uint16_t y) override