usbuart2 2.0.0.0
|
API for configuring and manipulating USB UART 2 Click driver. More...
Topics | |
USB UART 2 Device Settings | |
Settings for registers of USB UART 2 Click driver. | |
USB UART 2 MikroBUS Map | |
MikroBUS pin mapping of USB UART 2 Click driver. | |
Functions | |
void | usbuart2_cfg_setup (usbuart2_cfg_t *cfg) |
USB UART 2 configuration object setup function. | |
err_t | usbuart2_init (usbuart2_t *ctx, usbuart2_cfg_t *cfg) |
USB UART 2 initialization function. | |
void | usbuart2_generic_write (usbuart2_t *ctx, char *data_buf, uint16_t len) |
USB UART 2 data writing function. | |
uint32_t | usbuart2_generic_read (usbuart2_t *ctx, char *data_buf, uint16_t max_len) |
USB UART 2 data reading function. | |
void | usbuart2_pwr_ctrl (usbuart2_t *ctx, uint8_t state) |
Power control. | |
void | usbuart2_set_cts (usbuart2_t *ctx, uint8_t state) |
Set CTS (Clear to send) | |
void | usbuart2_set_mode (usbuart2_t *ctx, uint8_t mode) |
Set device mode. | |
uint8_t | usbuart2_get_rts (usbuart2_t *ctx) |
Set device mode. | |
void | usbuart2_send_command (usbuart2_t *ctx, char *command) |
Function for send command. | |
API for configuring and manipulating USB UART 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void usbuart2_cfg_setup | ( | usbuart2_cfg_t * | cfg | ) |
USB UART 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See usbuart2_cfg_t object definition for detailed explanation. |
uint32_t usbuart2_generic_read | ( | usbuart2_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len ) |
USB UART 2 data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See usbuart2_t object definition for detailed explanation. |
[out] | data_buf | : Output read data. |
[in] | max_len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer.void usbuart2_generic_write | ( | usbuart2_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
USB UART 2 data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See usbuart2_t object definition for detailed explanation. |
[in] | data_buf | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error.uint8_t usbuart2_get_rts | ( | usbuart2_t * | ctx | ) |
Set device mode.
This function reads RTS pin state.
[in] | ctx | : Click context object. |
err_t usbuart2_init | ( | usbuart2_t * | ctx, |
usbuart2_cfg_t * | cfg ) |
USB UART 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See usbuart2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See usbuart2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void usbuart2_pwr_ctrl | ( | usbuart2_t * | ctx, |
uint8_t | state ) |
Power control.
This function sets the click turns click on.
[out] | ctx | : Click context object. See usbuart2_t object definition for detailed explanation. |
[in] | state | : PWR pin state |
void usbuart2_send_command | ( | usbuart2_t * | ctx, |
char * | command ) |
Function for send command.
This function is used for sending commands.
[in] | ctx | : Click context object. |
[in] | command | : Data to be send. |
void usbuart2_set_cts | ( | usbuart2_t * | ctx, |
uint8_t | state ) |
Set CTS (Clear to send)
This function sets CTS pin.
[out] | ctx | : Click context object. See usbuart2_t object definition for detailed explanation. |
[in] | state | : CTS pin state |
void usbuart2_set_mode | ( | usbuart2_t * | ctx, |
uint8_t | mode ) |
Set device mode.
This function sets device mode.
[out] | ctx | : Click context object. See usbuart2_t object definition for detailed explanation. |
[in] | mode | : Device mode (Sleep or Normal) |