usbuart5  2.1.0.0
Modules | Functions
USB UART 5 Click Driver

API for configuring and manipulating USB UART 5 Click driver. More...

Modules

 USB UART 5 Device Settings
 Settings for registers of USB UART 5 Click driver.
 
 USB UART 5 MikroBUS Map
 MikroBUS pin mapping of USB UART 5 Click driver.
 

Functions

void usbuart5_cfg_setup (usbuart5_cfg_t *cfg)
 USB UART 5 configuration object setup function. More...
 
err_t usbuart5_init (usbuart5_t *ctx, usbuart5_cfg_t *cfg)
 USB UART 5 initialization function. More...
 
err_t usbuart5_default_cfg (usbuart5_t *ctx)
 USB UART 5 default configuration function. More...
 
err_t usbuart5_generic_write (usbuart5_t *ctx, char *data_in, uint16_t len)
 USB UART 5 data writing function. More...
 
err_t usbuart5_generic_read (usbuart5_t *ctx, char *data_out, uint16_t len)
 USB UART 5 data reading function. More...
 
void usbuart5_enable_device (usbuart5_t *ctx)
 USB UART 5 enable the device function. More...
 
void usbuart5_reset_device (usbuart5_t *ctx)
 USB UART 5 reset the device function. More...
 
void usbuart5_set_rts_pin (usbuart5_t *ctx, usbuart5_pin_state_t state)
 USB UART 5 set RTS pin state function. More...
 
void usbuart5_suspend_mode (usbuart5_t *ctx, uint8_t mode)
 USB UART 5 suspend mode function. More...
 
uint8_t usbuart5_get_cts_pin (usbuart5_t *ctx)
 USB UART 5 get RTS pin state function. More...
 
err_t usbuart5_send_data (usbuart5_t *ctx, uint8_t *data_out)
 USB UART 5 send data function. More...
 

Detailed Description

API for configuring and manipulating USB UART 5 Click driver.

Function Documentation

◆ usbuart5_cfg_setup()

void usbuart5_cfg_setup ( usbuart5_cfg_t cfg)

USB UART 5 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See usbuart5_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ usbuart5_default_cfg()

err_t usbuart5_default_cfg ( usbuart5_t ctx)

USB UART 5 default configuration function.

This function executes a default configuration of USB UART 5 click board.

Parameters
[in]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ usbuart5_enable_device()

void usbuart5_enable_device ( usbuart5_t ctx)

USB UART 5 enable the device function.

This function enable the CP2110 Single-Chip HID USB to UART Bridge on the USB UART 5 Click board™.

Parameters
[in]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ usbuart5_generic_read()

err_t usbuart5_generic_read ( usbuart5_t ctx,
char *  data_out,
uint16_t  len 
)

USB UART 5 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ usbuart5_generic_write()

err_t usbuart5_generic_write ( usbuart5_t ctx,
char *  data_in,
uint16_t  len 
)

USB UART 5 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
[in]data_in: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ usbuart5_get_cts_pin()

uint8_t usbuart5_get_cts_pin ( usbuart5_t ctx)

USB UART 5 get RTS pin state function.

This function get state of the Clear To Send control pin of the CP2110 Single-Chip HID USB to UART Bridge on the USB UART 5 Click board™.

Parameters
[in]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
Returns
  • 0 - Clear To Send state,
  • 1 - Not Clear To Send the state. See #err_t definition for detailed explanation.
Note
None.

◆ usbuart5_init()

err_t usbuart5_init ( usbuart5_t ctx,
usbuart5_cfg_t cfg 
)

USB UART 5 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See usbuart5_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ usbuart5_reset_device()

void usbuart5_reset_device ( usbuart5_t ctx)

USB UART 5 reset the device function.

This function performs resets the CP2110 Single-Chip HID USB to UART Bridge on the USB UART 5 Click board™.

Parameters
[in]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ usbuart5_send_data()

err_t usbuart5_send_data ( usbuart5_t ctx,
uint8_t *  data_out 
)

USB UART 5 send data function.

This function is used for sending data of the CP2110 Single-Chip HID USB to UART Bridge on the USB UART 5 Click board™.

Parameters
[in]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
[in]data_out: Data buffer for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ usbuart5_set_rts_pin()

void usbuart5_set_rts_pin ( usbuart5_t ctx,
usbuart5_pin_state_t  state 
)

USB UART 5 set RTS pin state function.

This function sets state of the e Ready To Send pin of the CP2110 Single-Chip HID USB to UART Bridge on the USB UART 5 Click board™.

Parameters
[in]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
[in]state:
  • USBUART5_PIN_STATE_LOW - Data is Ready To Send,
  • USBUART5_PIN_STATE_HIGH - Data is not Ready To Send.
Returns
Nothing.
Note
None.

◆ usbuart5_suspend_mode()

void usbuart5_suspend_mode ( usbuart5_t ctx,
uint8_t  mode 
)

USB UART 5 suspend mode function.

This function sets state of the AN pin to select suspend mode of the CP2110 Single-Chip HID USB to UART Bridge on the USB UART 5 Click board™.

Parameters
[in]ctx: Click context object. See usbuart5_t object definition for detailed explanation.
[in]state:
  • USBUART5_SUSPEND_MODE_DISABLE - Set USB to normal mode,
  • USBUART5_SUSPEND_MODE_ENABLE - Set USB suspended mode.
Returns
Nothing.
Note
None.