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 RS232_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
70 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT )
77#define RS232_RETVAL uint8_t
80#define RS232_INIT_ERROR 0xFF
87#define DRV_RX_BUFFER_SIZE 500
#define DRV_RX_BUFFER_SIZE
Definition rs232.h:87
#define RS232_RETVAL
Definition rs232.h:77
void rs232_cfg_setup(rs232_cfg_t *cfg)
Config Object Initialization function.
void rs232_set_rts_state(rs232_t *ctx, uint8_t state)
Set RTS pin state.
uint8_t rs232_get_cts_state(rs232_t *ctx)
Get CTS pin state (Clear to send)
int32_t rs232_generic_read(rs232_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void rs232_generic_write(rs232_t *ctx, char *data_buf, uint16_t len)
Generic write function.
RS232_RETVAL rs232_init(rs232_t *ctx, rs232_cfg_t *cfg)
Initialization function.
uint8_t rs232_error_t
Error type.
Definition rs232.h:146
Click configuration structure definition.
Definition rs232.h:122
pin_name_t rts
Definition rs232.h:130
uint32_t baud_rate
Definition rs232.h:135
pin_name_t cts
Definition rs232.h:131
bool uart_blocking
Definition rs232.h:136
uart_data_bits_t data_bit
Definition rs232.h:137
pin_name_t tx_pin
Definition rs232.h:126
pin_name_t rx_pin
Definition rs232.h:125
uart_stop_bits_t stop_bit
Definition rs232.h:139
uart_parity_t parity_bit
Definition rs232.h:138
Click ctx object definition.
Definition rs232.h:100
digital_out_t rts
Definition rs232.h:103
uart_t uart
Definition rs232.h:111
digital_in_t cts
Definition rs232.h:107