Astra MCU SDK Peripheral Driver Library
 
Loading...
Searching...
No Matches
Enumerated Types

Enumerated types for I2C driver. More...

Enumerations

enum  i2c_speed_en {
  I2C_SPEED_STANDARD = 1 ,
  I2C_SPEED_FAST ,
  I2C_SPEED_FAST_PLUS
}
 I²C bus speed configuration. More...
 
enum  i2c_transfer_dir_en {
  I2C_TRANSFER_WRITE = 0 ,
  I2C_TRANSFER_READ = 1
}
 I²C transfer direction. More...
 
enum  i2c_status_en {
  I2C_OK = 0 ,
  I2C_ERROR = 1 ,
  I2C_ERROR_BUSY = 2 ,
  I2C_ERROR_TIMEOUT = 3 ,
  I2C_ERROR_UNSUPPORTED = 4 ,
  I2C_ERROR_PARAMETER = 5 ,
  I2C_ERROR_SPECIFIC = 6 ,
  I2C_ERROR_NACK = 7 ,
  I2C_ERROR_SDA_STUCK = 8 ,
  I2C_ERROR_ARBITRATION_LOST = 9 ,
  I2C_ERROR_TX_FLUSHED = 10
}
 I²C driver return status codes. More...
 
enum  i2c_mode_en {
  I2C_MODE_CONTROLLER = 0 ,
  I2C_MODE_TARGET
}
 I²C operation modes. More...
 
enum  i2c_event_en {
  I2C_EVENT_WRITE_COMPLETE ,
  I2C_EVENT_READ_COMPLETE ,
  I2C_EVENT_BUS_ERROR ,
  I2C_EVENT_ABORT ,
  I2C_EVENT_STOP_DET ,
  I2C_EVENT_WRITE_IN_TX_FIFO ,
  I2C_EVENT_TX_OVERFLOW ,
  I2C_EVENT_RX_OVERFLOW ,
  I2C_EVENT_RX_UNDERFLOW ,
  I2C_EVENT_ERROR
}
 I²C callback event types. More...
 
enum  i2c_transfer_status_en {
  I2C_TRANSFER_STATUS_IDLE = 0 ,
  I2C_TRANSFER_STATUS_IN_PROGRESS ,
  I2C_TRANSFER_STATUS_COMPLETE ,
  I2C_TRANSFER_STATUS_ABORTED ,
  I2C_TRANSFER_STATUS_ERROR ,
  I2C_TRANSFER_INVALID_ID
}
 Status codes for a non-blocking I²C transfer. More...
 

Detailed Description

Enumerated types for I2C driver.

Enumeration Type Documentation

◆ i2c_speed_en

I²C bus speed configuration.

This enumeration defines user-selectable bus speed configurations for initializing the I²C hardware.

Enumerator
I2C_SPEED_STANDARD 

100 kHz

I2C_SPEED_FAST 

400 kHz

I2C_SPEED_FAST_PLUS 

1000 kHz

◆ i2c_transfer_dir_en

I²C transfer direction.

This enumeration specifies the direction of an I²C transfer operation, used to distinguish between read and write transfers.

Enumerator
I2C_TRANSFER_WRITE 

Controller sends data to the target

I2C_TRANSFER_READ 

Controller reads data from the target

◆ i2c_status_en

I²C driver return status codes.

This enumeration defines the various return codes used by the I²C driver to indicate operation results and specific error conditions.

Enumerator
I2C_OK 

Operation completed successfully

I2C_ERROR 

General error

I2C_ERROR_BUSY 

Bus or driver is busy

I2C_ERROR_TIMEOUT 

Operation timed out

I2C_ERROR_UNSUPPORTED 

Operation not supported on this instance

I2C_ERROR_PARAMETER 

Invalid parameter provided

I2C_ERROR_SPECIFIC 

Hardware/driver-specific error

I2C_ERROR_NACK 

Target did not acknowledge transfer

I2C_ERROR_SDA_STUCK 

SDA Stuck Error

I2C_ERROR_ARBITRATION_LOST 

Arbitration lost during transfer

I2C_ERROR_TX_FLUSHED 

TX FIFO flushed before all data was transmitted

◆ i2c_mode_en

I²C operation modes.

This enumeration defines whether the device operates as a controller or target in I²C communication.

Enumerator
I2C_MODE_CONTROLLER 

Controller (formerly “master”)

I2C_MODE_TARGET 

Target (formerly “slave”)

◆ i2c_event_en

I²C callback event types.

This enumeration defines the events that can be reported to the application through a callback mechanism when using the I²C driver in asynchronous mode.

Enumerator
I2C_EVENT_WRITE_COMPLETE 

Controller write completed or target received full data

I2C_EVENT_READ_COMPLETE 

Controller read completed or target sent all data

I2C_EVENT_BUS_ERROR 

Arbitration lost or illegal START/STOP detected

I2C_EVENT_ABORT 

Transfer aborted due to error or explicit stop

I2C_EVENT_STOP_DET 

STOP condition detected on the I2C bus

I2C_EVENT_WRITE_IN_TX_FIFO 

TX FIFO has been filled

I2C_EVENT_TX_OVERFLOW 

FIFO overflow while writing data (TX FIFO full)

I2C_EVENT_RX_OVERFLOW 

FIFO overflow while receiving data (RX FIFO full)

I2C_EVENT_RX_UNDERFLOW 

FIFO underflow while receiving data (RX FIFO empty)

I2C_EVENT_ERROR 

Generic/unclassified error occurred

◆ i2c_transfer_status_en

Status codes for a non-blocking I²C transfer.

This is returned by i2c_get_controller_transfer_status() and i2c_get_target_transfer_status(). These let the application know where in the transfer lifecycle the driver is.

Enumerator
I2C_TRANSFER_STATUS_IDLE 

No transfer is active.

I2C_TRANSFER_STATUS_IN_PROGRESS 

Transfer is currently ongoing.

I2C_TRANSFER_STATUS_COMPLETE 

Transfer completed successfully.

I2C_TRANSFER_STATUS_ABORTED 

Transfer was aborted by the user.

I2C_TRANSFER_STATUS_ERROR 

Transfer failed due to an error.

I2C_TRANSFER_INVALID_ID 

Transfer failed due to invalid id.