39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
74#define USBUART2_MODE_SLEEP 1
75#define USBUART2_MODE_NORMAL 0
77#define USBUART2_CTS_ACTIVE 1
78#define USBUART2_CTS_NO_ACTIVE 0
80#define USBUART2_POWER_ON 1
81#define USBUART2_POWER_OFF 0
88#define DRV_BUFFER_SIZE 500
106#define USBUART2_MAP_MIKROBUS( cfg, mikrobus ) \
107 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
108 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
109 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_RST ); \
110 cfg.slp = MIKROBUS( mikrobus, MIKROBUS_CS ); \
111 cfg.pwr = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
112 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT );
#define DRV_BUFFER_SIZE
USB UART 2 driver buffer size.
Definition usbuart2.h:88
uint8_t usbuart2_get_rts(usbuart2_t *ctx)
Set device mode.
void usbuart2_set_cts(usbuart2_t *ctx, uint8_t state)
Set CTS (Clear to send)
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.
void usbuart2_set_mode(usbuart2_t *ctx, uint8_t mode)
Set device mode.
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_cfg_setup(usbuart2_cfg_t *cfg)
USB UART 2 configuration object setup function.
void usbuart2_send_command(usbuart2_t *ctx, char *command)
Function for send command.
USB UART 2 Click configuration object.
Definition usbuart2.h:146
pin_name_t rts
Definition usbuart2.h:155
uint32_t baud_rate
Definition usbuart2.h:158
pin_name_t cts
Definition usbuart2.h:152
pin_name_t slp
Definition usbuart2.h:153
bool uart_blocking
Definition usbuart2.h:159
uart_data_bits_t data_bit
Definition usbuart2.h:160
pin_name_t tx_pin
Definition usbuart2.h:149
pin_name_t pwr
Definition usbuart2.h:154
pin_name_t rx_pin
Definition usbuart2.h:148
uart_stop_bits_t stop_bit
Definition usbuart2.h:162
uart_parity_t parity_bit
Definition usbuart2.h:161
USB UART 2 Click context object.
Definition usbuart2.h:122
digital_out_t pwr
Definition usbuart2.h:127
digital_out_t slp
Definition usbuart2.h:126
uart_t uart
Definition usbuart2.h:133
digital_in_t rts
Definition usbuart2.h:130
digital_out_t cts
Definition usbuart2.h:125
usbuart2_return_value_t
USB UART 2 Click return value data.
Definition usbuart2.h:171
@ USBUART2_OK
Definition usbuart2.h:172
@ USBUART2_ERROR
Definition usbuart2.h:173