usbuart 2.0.0.0
|
API for configuring and manipulating USB UART Click driver. More...
Topics | |
USB UART Device Settings | |
Settings for registers of USB UART Click driver. | |
USB UART MikroBUS Map | |
MikroBUS pin mapping of USB UART Click driver. | |
Functions | |
void | usbuart_cfg_setup (usbuart_cfg_t *cfg) |
USB UART configuration object setup function. | |
err_t | usbuart_init (usbuart_t *ctx, usbuart_cfg_t *cfg) |
USB UART initialization function. | |
void | usbuart_generic_write (usbuart_t *ctx, char *data_buf, uint16_t len) |
USB UART data writing function. | |
uint32_t | usbuart_generic_read (usbuart_t *ctx, char *data_buf, uint16_t max_len) |
USB UART data reading function. | |
void | usbuart_pwr_ctrl (usbuart_t *ctx, uint8_t state) |
Power control. | |
void | usbuart_set_cts (usbuart_t *ctx, uint8_t state) |
Set CTS (Clear to send) | |
void | usbuart_set_mode (usbuart_t *ctx, uint8_t mode) |
Set device mode. | |
uint8_t | usbuart_get_rts (usbuart_t *ctx) |
Set device mode. | |
void | usbuart_send_command (usbuart_t *ctx, char *command) |
Function for send command. | |
API for configuring and manipulating USB UART Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void usbuart_cfg_setup | ( | usbuart_cfg_t * | cfg | ) |
USB UART configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See usbuart_cfg_t object definition for detailed explanation. |
uint32_t usbuart_generic_read | ( | usbuart_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len ) |
USB UART data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See usbuart_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 usbuart_generic_write | ( | usbuart_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
USB UART data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See usbuart_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 usbuart_get_rts | ( | usbuart_t * | ctx | ) |
Set device mode.
This function reads RTS pin state.
[in] | ctx | : Click context object. |
err_t usbuart_init | ( | usbuart_t * | ctx, |
usbuart_cfg_t * | cfg ) |
USB UART initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See usbuart_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See usbuart_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void usbuart_pwr_ctrl | ( | usbuart_t * | ctx, |
uint8_t | state ) |
Power control.
This function sets the click turns click on.
[out] | ctx | : Click context object. See usbuart_t object definition for detailed explanation. |
[in] | state | : PWR pin state |
void usbuart_send_command | ( | usbuart_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 usbuart_set_cts | ( | usbuart_t * | ctx, |
uint8_t | state ) |
Set CTS (Clear to send)
This function sets CTS pin.
[out] | ctx | : Click context object. See usbuart_t object definition for detailed explanation. |
[in] | state | : CTS pin state |