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 MICROWAVE2_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.da = MIKROBUS( mikrobus, MIKROBUS_AN ); \
71 cfg.dl = MIKROBUS( mikrobus, MIKROBUS_INT )
78#define MICROWAVE2_RETVAL uint8_t
80#define MICROWAVE2_OK 0x00
81#define MICROWAVE2_INIT_ERROR 0xFF
88#define DRV_RX_BUFFER_SIZE 500
95#define MICROWAVE2_MOVING_AWAY 1
96#define MICROWAVE2_MOVING_CLOSER 2
97#define MICROWAVE2_STOPPED_MOVING 4
#define DRV_RX_BUFFER_SIZE
Definition microwave2.h:88
#define MICROWAVE2_RETVAL
Definition microwave2.h:78
uint8_t microwave2_da_state(microwave2_t *ctx)
Set pin DA.
uint8_t microwave2_dl_state(microwave2_t *ctx)
Set pin DL.
void microwave2_cfg_setup(microwave2_cfg_t *cfg)
Config Object Initialization function.
MICROWAVE2_RETVAL microwave2_init(microwave2_t *ctx, microwave2_cfg_t *cfg)
Initialization function.
void microwave2_generic_single_write(microwave2_t *ctx, char tx_data)
Generic single write function.
int32_t microwave2_generic_read(microwave2_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
char microwave2_generic_single_read(microwave2_t *ctx)
Generic single read function.
void microwave2_generic_multi_write(microwave2_t *ctx, char *data_buf, uint8_t len)
Generic multi write function.
Click configuration structure definition.
Definition microwave2.h:131
uint32_t baud_rate
Definition microwave2.h:144
pin_name_t da
Definition microwave2.h:139
bool uart_blocking
Definition microwave2.h:145
uart_data_bits_t data_bit
Definition microwave2.h:146
pin_name_t tx_pin
Definition microwave2.h:135
pin_name_t rx_pin
Definition microwave2.h:134
uart_stop_bits_t stop_bit
Definition microwave2.h:148
uart_parity_t parity_bit
Definition microwave2.h:147
pin_name_t dl
Definition microwave2.h:140
Click ctx object definition.
Definition microwave2.h:112
digital_in_t dl
Definition microwave2.h:116
digital_in_t da
Definition microwave2.h:115
uart_t uart
Definition microwave2.h:120