MT2523 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_2 = 2,
  HAL_I2C_MASTER_MAX
}
 This enum defines 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 defines the I2C port.

The platform supports 3 I2C masters. Two of them support polling mode and DMA mode, while the other one only supports polling mode. For more information about the polling mode, DMA mode, queue mode, please refer to Supported features. The details are shown below:

  • I2C masters supported feature table
    V : means support; X : means not support.
    I2C Master Polling mode DMA mode Extended DMA mode
    I2C0 V V V
    I2C1 V V V
    I2C2 V X X
Enumerator
HAL_I2C_MASTER_0 

I2C master 0.

HAL_I2C_MASTER_1 

I2C master 1.

HAL_I2C_MASTER_2 

I2C master 2.

HAL_I2C_MASTER_MAX 

The total number of I2C masters (invalid I2C Master number).

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.