oled 1.0
OLED Graphics Control Library
Loading...
Searching...
No Matches
TWI_enums.h File Reference

Enumerations for TWI/I2C interface modes, operations, acknowledgment, and error codes. More...

Include dependency graph for TWI_enums.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum TWI_Mode_t TWI_Mode
 Alias for enum TWI_Mode_t representing TWI device mode.
typedef enum TWI_Operation_t TWI_Operation
 Alias for enum TWI_Operation_t representing TWI operation modes.
typedef enum TWI_Acknowledge_t TWI_Acknowledge
 Alias for enum TWI_Acknowledge_t representing TWI acknowledge mode.
typedef enum TWI_Error_t TWI_Error
 Alias for enum TWI_Error_t representing TWI error status.

Enumerations

enum  TWI_Operation_t { TWI_Write = 0x00 , TWI_Read = 0x01 }
 Specifies the operation type for the next TWI bus transmission. More...
enum  TWI_Acknowledge_t { TWI_NACK = 0x00 , TWI_ACK = 0x01 }
 Indicates acknowledgment status on the TWI bus. More...
enum  TWI_Error_t {
  TWI_None =0 , TWI_Run , TWI_Start , TWI_Arbitration ,
  TWI_Ack , TWI_General
}
 Error codes for software TWI operations. More...

Detailed Description

Enumerations for TWI/I2C interface modes, operations, acknowledgment, and error codes.

This header file defines the enums used to represent various states and configurations related to software TWI (Two-Wire Interface, I2C) communication. It includes enumerations for device operation modes (master/slave), communication operation types (read/write), acknowledgment status (ACK/NACK), and error codes for handling communication results.

Note
These enums improve code readability by providing meaningful symbolic names for TWI-related values, facilitating protocol-compliant and maintainable software design.
Author
g.raf
Date
2025-09-02
Version
1.0 Release
Note
This file is part of a larger project and subject to the license specified in the repository. For updates and the complete revision history, see the GitHub repository.
See also
https://github.com/0x007e/avr-common "AVR ATmega GitHub Repository"

Typedef Documentation

◆ TWI_Acknowledge

Alias for enum TWI_Acknowledge_t representing TWI acknowledge mode.

◆ TWI_Error

typedef enum TWI_Error_t TWI_Error

Alias for enum TWI_Error_t representing TWI error status.

◆ TWI_Mode

typedef enum TWI_Mode_t TWI_Mode

Alias for enum TWI_Mode_t representing TWI device mode.

◆ TWI_Operation

Alias for enum TWI_Operation_t representing TWI operation modes.

Enumeration Type Documentation

◆ TWI_Acknowledge_t

Indicates acknowledgment status on the TWI bus.

This enumeration represents whether an acknowledgment (ACK) or a not-acknowledgment (NACK) was received following a data transfer on the software TWI (I2C) bus.

Enumerator
TWI_NACK 

No acknowledgment received (NACK)

TWI_ACK 

Acknowledgment received (ACK)

◆ TWI_Error_t

Error codes for software TWI operations.

This enumeration defines the possible error statuses that can occur during software TWI (I2C) communication.

Enumerator
TWI_None 

No error occurrs

TWI_Run 

Operation running

TWI_Start 

Start condition error

TWI_Arbitration 

Arbitration error

TWI_Ack 

Acknowledge error

TWI_General 

General error

◆ TWI_Operation_t

Specifies the operation type for the next TWI bus transmission.

This enumeration indicates whether the next software TWI (I2C) communication operation is a write (master to slave) or a read (slave to master).

Enumerator
TWI_Write 

Write operation (master sends data)

TWI_Read 

Read operation (master receives data)