at24cm0x 1.0
at24cm0x driver library
Loading...
Searching...
No Matches
SSD130X Software/Hardware TWI (I2C) Control Macros

Macros for abstracting SSD130X TWI (I2C) communication interface. More...

Macros

#define TWI_SOFT_HEADER   _STR(../../../hal/SSD130X_HAL_PLATFORM/twi_soft/twi_soft.h)
#define SSD130X_START(MODE)
#define SSD130X_STOP()
#define SSD130X_DATA()

Detailed Description

Macros for abstracting SSD130X TWI (I2C) communication interface.

These macros provide a unified interface for starting, stopping, and sending data over the TWI bus to the SSD130X display, abstracting the use of either software-based or hardware-based TWI implementations.

Note
When SSD130X_USE_SOFT_TWI is defined, the macros use software TWI functions; otherwise, hardware TWI is used.

Individual macros:

  • SSD130X_START(MODE): Initiates a TWI start condition and sends the SSD130X’s I2C address with the specified mode (MODE indicates read or write) to begin communication.
  • SSD130X_STOP(): Sends a TWI stop condition to end communication and then inserts a delay (SSD130X_IDLE_TIME_US) to allow the SSD130X sufficient processing time before the next communication.
  • SSD130X_DATA(): Sends the control byte indicating that the following bytes will be data (pixel or graphic data) to the SSD130X display, rather than commands.

This abstraction simplifies SSD130X communication by hiding the underlying method, enabling easy switching between hardware and software TWI implementations without changing higher-level code.

Macro Definition Documentation

◆ SSD130X_DATA

#define SSD130X_DATA ( )
Value:
#define SSD130X_CONTROL_DATA
Control byte indicating data for the SSD130X display.
Definition ssd130x.h:92
TWI_Error twi_soft_set(unsigned char data)
Transmit a byte of data on the TWI bus.
Definition twi_soft.c:166

◆ SSD130X_START

#define SSD130X_START ( MODE)
Value:
#define SSD130X_ADDRESS
I2C (TWI) slave address of the SSD130X display.
Definition ssd130x.h:66
TWI_Error twi_soft_address(unsigned char address, TWI_Operation operation)
Sends the slave address with the read/write operation on the TWI bus.
Definition twi_soft.c:150
TWI_Error twi_soft_start(void)
Generate a TWI start or repeated start condition.
Definition twi_soft.c:97

◆ SSD130X_STOP

#define SSD130X_STOP ( )
Value:
#define SSD130X_IDLE_TIME_US
Delay time in microseconds after SSD130X TWI/I2C stop condition.
Definition ssd130x.h:137
void systick_timer_wait_us(unsigned int us)
void twi_soft_stop(void)
Stop the TWI (I2C) transmission.
Definition twi_soft.c:126

◆ TWI_SOFT_HEADER

#define TWI_SOFT_HEADER   _STR(../../../hal/SSD130X_HAL_PLATFORM/twi_soft/twi_soft.h)