42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
66#define RS2322_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.dtr = MIKROBUS( mikrobus, MIKROBUS_AN ); \
70 cfg.dcd = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.ri = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT )
80#define RS2322_RETVAL uint8_t
83#define RS2322_INIT_ERROR 0xFF
90#define DRV_RX_BUFFER_SIZE 500
#define DRV_RX_BUFFER_SIZE
Definition rs2322.h:90
#define RS2322_RETVAL
Definition rs2322.h:80
void rs2322_set_cts(rs2322_t *ctx, uint8_t state)
This function sets CTS pin state.
void rs2322_set_ri(rs2322_t *ctx, uint8_t state)
This function sets RI pin state.
RS2322_RETVAL rs2322_init(rs2322_t *ctx, rs2322_cfg_t *cfg)
Initialization function.
void rs2322_cfg_setup(rs2322_cfg_t *cfg)
Config Object Initialization function.
int16_t rs2322_generic_read(rs2322_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
uint8_t rs2322_get_rts(rs2322_t *ctx)
This function get RST pin state.
void rs2322_set_dcd(rs2322_t *ctx, uint8_t state)
This function sets DCD pin state.
void rs2322_send_command(rs2322_t *ctx, char *command)
Function for send command.
void rs2322_generic_write(rs2322_t *ctx, char *data_buf, uint16_t len)
Generic write function.
uint8_t rs2322_get_dtr(rs2322_t *ctx)
This function get DTR pin state.
uint8_t rs2322_error_t
Error type.
Definition rs2322.h:155
Click configuration structure definition.
Definition rs2322.h:128
pin_name_t dtr
Definition rs2322.h:136
pin_name_t rts
Definition rs2322.h:140
uint32_t baud_rate
Definition rs2322.h:144
pin_name_t cts
Definition rs2322.h:138
bool uart_blocking
Definition rs2322.h:145
pin_name_t ri
Definition rs2322.h:139
uart_data_bits_t data_bit
Definition rs2322.h:146
pin_name_t tx_pin
Definition rs2322.h:132
pin_name_t dcd
Definition rs2322.h:137
pin_name_t rx_pin
Definition rs2322.h:131
uart_stop_bits_t stop_bit
Definition rs2322.h:148
uart_parity_t parity_bit
Definition rs2322.h:147
Click ctx object definition.
Definition rs2322.h:103
digital_out_t ri
Definition rs2322.h:108
digital_out_t dcd
Definition rs2322.h:106
uart_t uart
Definition rs2322.h:117
digital_in_t rts
Definition rs2322.h:113
digital_out_t cts
Definition rs2322.h:107
digital_in_t dtr
Definition rs2322.h:112