libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
oled_sh1106.h
Go to the documentation of this file.
1#ifndef __OLED_SH1106_H__
2#define __OLED_SH1106_H__
3
4#include "dev/oled_ssd130x.h"
5
6namespace daisy
7{
11template <size_t width, size_t height, typename Transport>
12class SH1106Driver : public SSD130xDriver<width, height, Transport>
13{
14 public:
18 void Update()
19 {
20 uint8_t i;
22 switch(height)
23 {
24 case 32: high_column_addr = 0x12; break;
25
26 default: high_column_addr = 0x10; break;
27 }
28 for(i = 0; i < (height / 8); i++)
29 {
30 this->transport_.SendCommand(0xB0 + i);
31 this->transport_.SendCommand(0x02);
32 this->transport_.SendCommand(high_column_addr);
33 this->transport_.SendData(&this->buffer_[width * i], width);
34 }
35 };
36};
37
43
48
49}; // namespace daisy
50
51#endif
Definition leddriver.h:33
Definition oled_sh1106.h:13
void Update()
Definition oled_sh1106.h:18
Definition oled_ssd130x.h:246
Transport transport_
Definition oled_ssd130x.h:393
uint8_t buffer_[width *height/8]
Definition oled_ssd130x.h:394
Hardware defines and helpers for daisy field platform.
Definition index.h:2