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