MT2523 API Reference  LinkIt SDK v4

Overview

Enumerations

enum  serial_port_dev_t {
  SERIAL_PORT_DEV_UART_TYPE_BEGIN = 0,
  SERIAL_PORT_DEV_UART_0 = SERIAL_PORT_DEV_UART_TYPE_BEGIN,
  SERIAL_PORT_DEV_UART_1,
  SERIAL_PORT_DEV_UART_2,
  SERIAL_PORT_DEV_UART_3,
  SERIAL_PORT_DEV_UART_TYPE_END = SERIAL_PORT_DEV_UART_3,
  SERIAL_PORT_DEV_USB_TYPE_BEGIN,
  SERIAL_PORT_DEV_USB_COM1 = SERIAL_PORT_DEV_USB_TYPE_BEGIN,
  SERIAL_PORT_DEV_USB_COM2,
  SERIAL_PORT_DEV_USB_TYPE_END = SERIAL_PORT_DEV_USB_COM2,
  SERIAL_PORT_DEV_MAX,
  SERIAL_PORT_DEV_UNDEFINED = 255
}
 This enum defines the port_service device. More...
 
enum  serial_port_type_t {
  SERIAL_PORT_TYPE_BEGIN = 0,
  SERIAL_PORT_TYPE_UART = SERIAL_PORT_TYPE_BEGIN,
  SERIAL_PORT_TYPE_USB,
  SERIAL_PORT_TYPE_MAX
}
 This enum defines the port_service device types. More...
 
enum  serial_port_ctrl_cmd_t {
  SERIAL_PORT_CMD_WRITE_DATA = 0,
  SERIAL_PORT_CMD_READ_DATA,
  SERIAL_PORT_CMD_WRITE_DATA_BLOCKING,
  SERIAL_PORT_CMD_READ_DATA_BLOCKING,
  SERIAL_PORT_CMD_GET_WRITE_AVAIL,
  SERIAL_PORT_CMD_GET_READ_AVAIL,
  SERIAL_PORT_CMD_MAX
}
 This enum defines the commands for each parameter in serial_port_ctrl_para_t. More...
 
enum  serial_port_callback_event_t {
  SERIAL_PORT_EVENT_READY_TO_READ = 0,
  SERIAL_PORT_EVENT_READY_TO_WRITE,
  SERIAL_PORT_EVENT_USB_CONNECTION,
  SERIAL_PORT_EVENT_USB_DISCONNECTION
}
 This enum defines the events that trigger the user's callback. More...
 
enum  serial_port_status_t {
  SERIAL_PORT_STATUS_DEV_NOT_READY = -7,
  SERIAL_PORT_STATUS_BUSY = -6,
  SERIAL_PORT_STATUS_UNINITIALIZED = -5,
  SERIAL_PORT_STATUS_UNSUPPORTED = -4,
  SERIAL_PORT_STATUS_INVALID_DEVICE = -3,
  SERIAL_PORT_STATUS_INVALID_PARAMETER = -2,
  SERIAL_PORT_STATUS_FAIL = -1,
  SERIAL_PORT_STATUS_OK = 0
}
 This enum defines the Serial Port Service status. More...
 

Enumeration Type Documentation

This enum defines the events that trigger the user's callback.

Enumerator
SERIAL_PORT_EVENT_READY_TO_READ 

Ready to read event.

SERIAL_PORT_EVENT_READY_TO_WRITE 

Ready to write event.

SERIAL_PORT_EVENT_USB_CONNECTION 

USB connection event.

SERIAL_PORT_EVENT_USB_DISCONNECTION 

USB disconnection event.

This enum defines the commands for each parameter in serial_port_ctrl_para_t.

Enumerator
SERIAL_PORT_CMD_WRITE_DATA 

Write data command.

SERIAL_PORT_CMD_READ_DATA 

Read data command.

SERIAL_PORT_CMD_WRITE_DATA_BLOCKING 

Write data command in blocking mode.

SERIAL_PORT_CMD_READ_DATA_BLOCKING 

Read data command in blocking mode.

SERIAL_PORT_CMD_GET_WRITE_AVAIL 

UART or USB special command to get the current available space to store the transmit data.

SERIAL_PORT_CMD_GET_READ_AVAIL 

UART or USB special command to get the current available size for the received data.

SERIAL_PORT_CMD_MAX 

The maximum number of commands.

This enum defines the port_service device.

Enumerator
SERIAL_PORT_DEV_UART_TYPE_BEGIN 

The first valid UART port in the port service of a device.

SERIAL_PORT_DEV_UART_0 

UART0 port in the port service of a device.

SERIAL_PORT_DEV_UART_1 

UART1 port in the port service of a device.

SERIAL_PORT_DEV_UART_2 

UART2 port in the port service of a device.

SERIAL_PORT_DEV_UART_3 

UART3 port in the port service of a device.

SERIAL_PORT_DEV_UART_TYPE_END 

The last valid UART port in the port service of a device.

SERIAL_PORT_DEV_USB_TYPE_BEGIN 

The first valid USB port in the port service of a device.

SERIAL_PORT_DEV_USB_COM1 

USB1 port in the port service of a device.

SERIAL_PORT_DEV_USB_COM2 

USB2 port in the port service of a device.

SERIAL_PORT_DEV_USB_TYPE_END 

The last valid USB port in the port service of a device.

SERIAL_PORT_DEV_MAX 

The maximum number of ports in the port service of a device.

SERIAL_PORT_DEV_UNDEFINED 

The invalid port number in the port service of a device.

This enum defines the Serial Port Service status.

Enumerator
SERIAL_PORT_STATUS_DEV_NOT_READY 

The Serial Port Service device is not ready.

SERIAL_PORT_STATUS_BUSY 

The Serial Port Service device is busy.

SERIAL_PORT_STATUS_UNINITIALIZED 

The Serial Port Service device is uninitialized.

SERIAL_PORT_STATUS_UNSUPPORTED 

The Serial Port Service function is not supported.

SERIAL_PORT_STATUS_INVALID_DEVICE 

The Serial Port Service device is invalid.

SERIAL_PORT_STATUS_INVALID_PARAMETER 

The Serial Port Service parameters are invalid.

SERIAL_PORT_STATUS_FAIL 

The Serial Port Service function has failed.

SERIAL_PORT_STATUS_OK 

The Serial Port Service function executed successfully.

This enum defines the port_service device types.

Enumerator
SERIAL_PORT_TYPE_BEGIN 

The first port type in the port service.

SERIAL_PORT_TYPE_UART 

UART port type in the port service.

SERIAL_PORT_TYPE_USB 

USB port type in the port service.

SERIAL_PORT_TYPE_MAX 

The maximum number of port types in the port service.