MT7687 API Reference  LinkIt SDK v4

Overview

Enumerations

enum  hal_i2c_callback_event_t {
  HAL_I2C_EVENT_ACK_ERROR = -3,
  HAL_I2C_EVENT_NACK_ERROR = -2,
  HAL_I2C_EVENT_TIMEOUT_ERROR = -1,
  HAL_I2C_EVENT_SUCCESS = 0
}
 This enum defines the transaction result event. More...
 
enum  hal_i2c_status_t {
  HAL_I2C_STATUS_ERROR = -4,
  HAL_I2C_STATUS_ERROR_BUSY = -3,
  HAL_I2C_STATUS_INVALID_PORT_NUMBER = -2,
  HAL_I2C_STATUS_INVALID_PARAMETER = -1,
  HAL_I2C_STATUS_OK = 0
}
 This enum defines the HAL interface return value. More...
 
enum  hal_i2c_running_type_t {
  HAL_I2C_STATUS_IDLE = 0,
  HAL_I2C_STATUS_BUS_BUSY = 1
}
 This enum defines the I2C bus status. More...
 
enum  hal_i2c_frequency_t {
  HAL_I2C_FREQUENCY_50K = 0,
  HAL_I2C_FREQUENCY_100K = 1,
  HAL_I2C_FREQUENCY_200K = 2,
  HAL_I2C_FREQUENCY_300K = 3,
  HAL_I2C_FREQUENCY_400K = 4,
  HAL_I2C_FREQUENCY_1M = 5,
  HAL_I2C_FREQUENCY_MAX
}
 This enum defines the I2C transaction speed. More...
 
enum  hal_i2c_port_t {
  HAL_I2C_MASTER_0 = 0,
  HAL_I2C_MASTER_1 = 1,
  HAL_I2C_MASTER_MAX
}
 This enum define the i2c port. More...
 

Enumeration Type Documentation

This enum defines the transaction result event.

These result is passed through a callback function. For more details, please refer to hal_i2c_master_register_callback().

Enumerator
HAL_I2C_EVENT_ACK_ERROR 

An ACK error occurred during transaction.

HAL_I2C_EVENT_NACK_ERROR 

A NACK error occurred during transaction.

HAL_I2C_EVENT_TIMEOUT_ERROR 

A timeout error occurred during transaction.

HAL_I2C_EVENT_SUCCESS 

The transaction completed wihtout any error.

This enum defines the I2C transaction speed.

Enumerator
HAL_I2C_FREQUENCY_50K 

50kbps.

HAL_I2C_FREQUENCY_100K 

100kbps.

HAL_I2C_FREQUENCY_200K 

200kbps.

HAL_I2C_FREQUENCY_300K 

300kbps.

HAL_I2C_FREQUENCY_400K 

400kbps.

HAL_I2C_FREQUENCY_1M 

1mbps.

HAL_I2C_FREQUENCY_MAX 

The total number of supported I2C frequencies (invalid I2C frequency).

This enum define the i2c port.

We have total 2 I2C masters. Both of them support polling mode and DMA mode.

Enumerator
HAL_I2C_MASTER_0 

i2c master 0.

HAL_I2C_MASTER_1 

i2c master 1.

HAL_I2C_MASTER_MAX 

max i2c master number, <invalid>

This enum defines the I2C bus status.

Enumerator
HAL_I2C_STATUS_IDLE 

The I2C bus is idle.

HAL_I2C_STATUS_BUS_BUSY 

The I2C bus is busy.

This enum defines the HAL interface return value.

Enumerator
HAL_I2C_STATUS_ERROR 

An error occurred and the transaction has failed.

HAL_I2C_STATUS_ERROR_BUSY 

The I2C bus is busy, an error occurred.

HAL_I2C_STATUS_INVALID_PORT_NUMBER 

A wrong port number is given.

HAL_I2C_STATUS_INVALID_PARAMETER 

A wrong parameter is given.

HAL_I2C_STATUS_OK 

No error occurred during the function call.