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 UARTMUX_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.inh = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.a = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.b = MIKROBUS( mikrobus, MIKROBUS_PWM )
78#define UARTMUX_RETVAL uint8_t
80#define UARTMUX_OK 0x00
81#define UARTMUX_INIT_ERROR 0xFF
88#define UARTMUX_PIN_STATE_HIGH 1
89#define UARTMUX_PIN_STATE_LOW 0
96#define UARTMUX_STATE_A_CHANNEL_1 0
97#define UARTMUX_STATE_B_CHANNEL_1 0
104#define UARTMUX_STATE_A_CHANNEL_2 1
105#define UARTMUX_STATE_B_CHANNEL_2 0
112#define UARTMUX_STATE_A_CHANNEL_3 0
113#define UARTMUX_STATE_B_CHANNEL_3 1
120#define UARTMUX_STATE_A_CHANNEL_4 1
121#define UARTMUX_STATE_B_CHANNEL_4 1
128#define DRV_RX_BUFFER_SIZE 500
#define DRV_RX_BUFFER_SIZE
Definition uartmux.h:128
#define UARTMUX_RETVAL
Definition uartmux.h:78
void uartmux_set_inhibit_communication(uartmux_t *ctx, uint8_t state)
Set INT pin.
UARTMUX_RETVAL uartmux_init(uartmux_t *ctx, uartmux_cfg_t *cfg)
Initialization function.
void uartmux_choose_channel(uartmux_t *ctx, uartmux_channel_t *channel)
Choose channel.
void uartmux_cfg_setup(uartmux_cfg_t *cfg)
Config Object Initialization function.
int32_t uartmux_generic_read(uartmux_t *ctx, char *data_buf, uint16_t max_len, uartmux_channel_t *channel)
Generic read function.
void uartmux_generic_write(uartmux_t *ctx, char *data_buf, uint16_t data_len, uartmux_channel_t *channel)
Generic write function.
uint8_t uartmux_error_t
Error type.
Definition uartmux.h:196
Click configuration structure definition.
Definition uartmux.h:171
uint32_t baud_rate
Definition uartmux.h:185
pin_name_t inh
Definition uartmux.h:179
bool uart_blocking
Definition uartmux.h:186
uart_data_bits_t data_bit
Definition uartmux.h:187
pin_name_t b
Definition uartmux.h:181
pin_name_t tx_pin
Definition uartmux.h:175
pin_name_t a
Definition uartmux.h:180
pin_name_t rx_pin
Definition uartmux.h:174
uart_stop_bits_t stop_bit
Definition uartmux.h:189
uart_parity_t parity_bit
Definition uartmux.h:188
uint8_t state_b
Definition uartmux.h:141
uint8_t state_a
Definition uartmux.h:140
Click ctx object definition.
Definition uartmux.h:149
digital_out_t a
Definition uartmux.h:153
digital_out_t inh
Definition uartmux.h:152
uart_t uart
Definition uartmux.h:158
digital_out_t b
Definition uartmux.h:154