ContentsIndex
PreviousUpNext
SIO(UART USB)
Topics | Functions | Structs, Records, Enums
Description

To Configure, read and write serial port devices.

Introduction

The Serial Input and Output (SIO) module allows developer to configure and control the hardware UART devices. Most LinkIt HDK comes with one set of UART devices. To use the module,

  1. configure the pin mode to UART mode. Refer to HDK pin-out diagram for corresponding UART pins.
  2. Open the VM_DCL_SIO_UART_PORT1 device with vm_dcl_open.
  3. Fill UART configuration parameters and use vm_dcl_control to send command VM_DCL_SIO_COMMAND_SE_DCB_CONFIG.
  4. Register the VM_DCL_SIO_UART_READY_TO_READ event with vm_dcl_register_callback.
  5. Write data with vm_dcl_write, and read data with vm_dcl_read when VM_DCL_SIO_UART_READY_TO_READ arrives.
Limitation

Currently, only the hardware UART port (TX/RX pins) is available on 2502A. The USB COM ports are used by SDK for debugging and SDK functions, therefore not available to the application. 

The write operation to UART is buffered. When the underlying buffer is full, vm_dcl_write would not be able to write any data, resulting in a written size of 0. In this case, wait for the VM_DCL_SIO_UART_READY_TO_WRITE event to prevent blind retrying and thus congesting the system resource.

Group
Functions
Function 
Description 
Get the usb cable status. 
Structs, Records, Enums
Struct, Record, Enum 
Description 
Commands for serial port hardware. DCB stands for Device Control Block. Call vm_dcl_control with VM_DCL_SIO_COMMAND_SET_DCB_CONFIG to config uart driver. 
This structure is part of the parameter structure vm_dcl_sio_control_dcb_t struct for command VM_DCL_SIO_COMMAND_SET_DCB_CONFIG. This structure allows developer to configure UART parameters such as baud rate and parity bits. Refer to vm_dcl_sio_config_t for usage example. 
Parameter structure for command VM_DCL_SIO_COMMAND_SET_DCB_CONFIG, which configures the parameter for the serial port device. 
Device identifiers for serial ports. Pass this to vm_dcl_open to select one of the serial port devices to use. Currently, only the hardware UART port (TX/RX pins) is available on 2502A. The USB COM ports are used by SDK for debugging and SDK functions, therefore not available to the application. 
VM_DCL_SIO_EVENT are serial port hardware events that can be registered with vm_dcl_registercallback. 
VM_DCL_SIO_UART_BAUDRATE defines values for the baud_rate field in the serial port configuration structure vm_dcl_sio_config_t
Defines values for the data_bits_per_char_length field in vm_dcl_sio_config_t. This configures the length of data bits during UART transmission. 
Defines values for the flow_control field in vm_dcl_sio_config_t. This configures hardware or software flow control is used during UART transmission. 
Defines values for the parity field in vm_dcl_sio_config_t. This configures the behavior of parity bit during UART transmission. 
Defines values for the stop_bits field in vm_dcl_sio_config_t. This configures the stop bits during UART transmission. 
The USB cable status. 
Links
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.