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 RS4852_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.de = MIKROBUS( mikrobus, MIKROBUS_CS ); \
70 cfg.re = MIKROBUS( mikrobus, MIKROBUS_PWM )
77#define RS4852_RETVAL uint8_t
80#define RS4852_INIT_ERROR 0xFF
87#define DRV_RX_BUFFER_SIZE 500
94#define RS4852_ENABLE_DE 0x01
95#define RS4852_DISABLE_DE 0x00
102#define RS4852_ENABLE_RE 0x00
103#define RS4852_DISABLE_RE 0x01
#define DRV_RX_BUFFER_SIZE
Definition rs4852.h:87
#define RS4852_RETVAL
Definition rs4852.h:77
void rs4852_set_re_pin(rs4852_t *ctx, uint8_t state)
Set RE ( reset ) pin state.
void rs4852_set_de_pin(rs4852_t *ctx, uint8_t state)
Set DE ( cs ) pin state.
int32_t rs4852_generic_read(rs4852_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void rs4852_cfg_setup(rs4852_cfg_t *cfg)
Config Object Initialization function.
void rs4852_generic_write(rs4852_t *ctx, char *data_buf, uint16_t len)
Generic write function.
RS4852_RETVAL rs4852_init(rs4852_t *ctx, rs4852_cfg_t *cfg)
Initialization function.
uint8_t rs4852_error_t
Error type.
Definition rs4852.h:159
Click configuration structure definition.
Definition rs4852.h:135
uint32_t baud_rate
Definition rs4852.h:148
pin_name_t re
Definition rs4852.h:144
bool uart_blocking
Definition rs4852.h:149
uart_data_bits_t data_bit
Definition rs4852.h:150
pin_name_t tx_pin
Definition rs4852.h:139
pin_name_t de
Definition rs4852.h:143
pin_name_t rx_pin
Definition rs4852.h:138
uart_stop_bits_t stop_bit
Definition rs4852.h:152
uart_parity_t parity_bit
Definition rs4852.h:151
Click ctx object definition.
Definition rs4852.h:116
digital_out_t re
Definition rs4852.h:120
uart_t uart
Definition rs4852.h:124
digital_out_t de
Definition rs4852.h:119