42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
67#define RS4855_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.de = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.re = MIKROBUS( mikrobus, MIKROBUS_CS )
78#define RS4855_RETVAL uint8_t
81#define RS4855_INIT_ERROR 0xFF
88#define DRV_RX_BUFFER_SIZE 500
91#define RS4855_PIN_STATE_HIGH 1
92#define RS4855_PIN_STATE_LOW 0
#define DRV_RX_BUFFER_SIZE
Definition rs4855.h:88
#define RS4855_RETVAL
Definition rs4855.h:78
void rs4855_set_re_state(rs4855_t *ctx, uint8_t state)
Sets RE pin to high or low state.
void rs4855_set_de_state(rs4855_t *ctx, uint8_t state)
Sets DE pin to high or low state.
void rs4855_cfg_setup(rs4855_cfg_t *cfg)
Config Object Initialization function.
void rs4855_generic_write(rs4855_t *ctx, char *data_buf, uint16_t len)
Generic write function.
RS4855_RETVAL rs4855_init(rs4855_t *ctx, rs4855_cfg_t *cfg)
Initialization function.
int32_t rs4855_generic_read(rs4855_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
uint8_t rs4855_error_t
Error type.
Definition rs4855.h:147
Click configuration structure definition.
Definition rs4855.h:123
uint32_t baud_rate
Definition rs4855.h:136
pin_name_t re
Definition rs4855.h:132
bool uart_blocking
Definition rs4855.h:137
uart_data_bits_t data_bit
Definition rs4855.h:138
pin_name_t tx_pin
Definition rs4855.h:127
pin_name_t de
Definition rs4855.h:131
pin_name_t rx_pin
Definition rs4855.h:126
uart_stop_bits_t stop_bit
Definition rs4855.h:140
uart_parity_t parity_bit
Definition rs4855.h:139
Click ctx object definition.
Definition rs4855.h:104
digital_out_t re
Definition rs4855.h:108
uart_t uart
Definition rs4855.h:112
digital_out_t de
Definition rs4855.h:107