twi.h - Hardware TWI parameter definition


 
  1 minutes to read

Hardware abstraction layer (HAL) for communicating over TWI/I2C with the display. Basic settings like the speed of the bus can be defined in twi.h.

Hardware-defined TWI makes communication inflexible with regard to ports, as these cannot be switched.

TWI-Bus speed definition

The TWI transmission speed can be set up within the F_TWI macro (100 kHz is set by default).

#define F_TWI 100000UL

Prescaler for TWI clock generation

The TWI bitrate register can only take 8 Bits so it is necessary to setup the correct prescaler. The faster the bus goes the lower should be the prescaler.

Calculation of the bitrate register (allowed values: 1-255):

TWI Calculation

#define TWI_PRESCALER 0

Valid prescaler values are 0, 1, 2, and 3, representing division factors of 1, 4, 16, and 64 respectively.


For a more detailed view of the possible parameters that can be set in twi.h, take a look at the OLED Doxygen documentation (OLDD).



Documenation about using the OLED (SSD1306) display with the library of the oled repository. Description of the tty- and frame-mode and usage within different environment setups.

  Distributed by 0x007E
 Powerd by  Jekyll  and  Tilde