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 RS4854_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.re = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.de = MIKROBUS( mikrobus, MIKROBUS_CS )
78#define RS4854_RETVAL uint8_t
81#define RS4854_INIT_ERROR 0xFF
88#define DRV_RX_BUFFER_SIZE 500
95#define RS4854_PIN_STATE_LOW 0
96#define RS4854_PIN_STATE_HIGH 1
#define DRV_RX_BUFFER_SIZE
Definition rs4854.h:88
#define RS4854_RETVAL
Definition rs4854.h:78
void rs4854_cfg_setup(rs4854_cfg_t *cfg)
Config Object Initialization function.
void rs4854_generic_write(rs4854_t *ctx, char *data_buf, uint16_t len)
Generic write function.
void rs4854_tx_disable(rs4854_t *ctx)
Tx disable function.
void rs4854_rx_enable(rs4854_t *ctx)
Rx enable function.
int32_t rs4854_generic_read(rs4854_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void rs4854_re_pin_set(rs4854_t *ctx, uint8_t pin_state)
Sets RE pin to high or low state.
void rs4854_tx_enable(rs4854_t *ctx)
Tx enable function.
void rs4854_de_pin_set(rs4854_t *ctx, uint8_t pin_state)
Sets DE pin to high or low state.
RS4854_RETVAL rs4854_init(rs4854_t *ctx, rs4854_cfg_t *cfg)
Initialization function.
void rs4854_rx_disable(rs4854_t *ctx)
Rx disable function.
uint8_t rs4854_error_t
Error type.
Definition rs4854.h:152
Click configuration structure definition.
Definition rs4854.h:128
uint32_t baud_rate
Definition rs4854.h:141
pin_name_t re
Definition rs4854.h:136
bool uart_blocking
Definition rs4854.h:142
uart_data_bits_t data_bit
Definition rs4854.h:143
pin_name_t tx_pin
Definition rs4854.h:132
pin_name_t de
Definition rs4854.h:137
pin_name_t rx_pin
Definition rs4854.h:131
uart_stop_bits_t stop_bit
Definition rs4854.h:145
uart_parity_t parity_bit
Definition rs4854.h:144
Click ctx object definition.
Definition rs4854.h:109
digital_out_t re
Definition rs4854.h:112
uart_t uart
Definition rs4854.h:117
digital_out_t de
Definition rs4854.h:113