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 DUALLIN_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.en1 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.en2 = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
78#define DUALLIN_RETVAL uint8_t
80#define DUALLIN_OK 0x00
81#define DUALLIN_INIT_ERROR 0xFF
88#define DUALLIN_PIN_STATE_LOW 0
89#define DUALLIN_PIN_STATE_HIGH 1
96#define DRV_RX_BUFFER_SIZE 500
#define DRV_RX_BUFFER_SIZE
Definition duallin.h:96
#define DUALLIN_RETVAL
Definition duallin.h:78
DUALLIN_RETVAL duallin_init(duallin_t *ctx, duallin_cfg_t *cfg)
Initialization function.
void duallin_send_command(duallin_t *ctx, char *command)
Send command.
void duallin_bus1_status(duallin_t *ctx, uint8_t state)
Sets state of RST pin.
int16_t duallin_generic_read(duallin_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void duallin_generic_write(duallin_t *ctx, char *data_buf, uint16_t len)
Generic write function.
void duallin_bus2_status(duallin_t *ctx, uint8_t state)
Sets state of CS pin.
void duallin_cfg_setup(duallin_cfg_t *cfg)
Config Object Initialization function.
uint8_t duallin_error_t
Error type.
Definition duallin.h:158
Click configuration structure definition.
Definition duallin.h:133
pin_name_t en2
Definition duallin.h:142
uint32_t baud_rate
Definition duallin.h:147
bool uart_blocking
Definition duallin.h:148
uart_data_bits_t data_bit
Definition duallin.h:149
pin_name_t en1
Definition duallin.h:141
pin_name_t tx_pin
Definition duallin.h:137
pin_name_t rx_pin
Definition duallin.h:136
uart_stop_bits_t stop_bit
Definition duallin.h:151
pin_name_t int_pin
Definition duallin.h:143
uart_parity_t parity_bit
Definition duallin.h:150
Click ctx object definition.
Definition duallin.h:109
digital_out_t en2
Definition duallin.h:113
digital_out_t en1
Definition duallin.h:112
uart_t uart
Definition duallin.h:122
digital_in_t int_pin
Definition duallin.h:118