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 ECG4_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
77#define ECG4_RETVAL uint8_t
80#define ECG4_INIT_ERROR 0xFF
83#define ECG4_SYNC_BYTE 0xAA
84#define ECG4_EXCODE_BYTE 0x55
85#define ECG4_SIGNAL_QUALITY_CODE_BYTE 0x02
86#define ECG4_HEART_RATE_CODE_BYTE 0x03
87#define ECG4_RAW_DATA_CODE_BYTE 0x80
88#define ECG4_RESPONSE_READY 0x01
89#define ECG4_RESPONSE_NOT_READY 0x00
90#define ECG4_ENABLE_LDO_CTRL 0x01
91#define ECG4_DISABLE_LDO_CTRL 0x00
97#define DRV_RX_BUFFER_SIZE 1000
98#define DRV_TX_BUFFER_SIZE 50
113typedef void ( *
ecg4_hdl_t )( uint8_t*, uint8_t*, uint8_t*, uint8_t* );
uint8_t ecg4_error_t
Error type.
Definition ecg4.h:165
void(* ecg4_hdl_t)(uint8_t *, uint8_t *, uint8_t *, uint8_t *)
Definition ecg4.h:113
#define DRV_RX_BUFFER_SIZE
Definition ecg4.h:97
#define DRV_TX_BUFFER_SIZE
Definition ecg4.h:98
#define ECG4_RETVAL
Definition ecg4.h:77
void ecg4_enable_ldo_ctrl(ecg4_t *ctx, uint8_t state)
LDO Control function.
void ecg4_uart_isr(ecg4_t *ctx, uint8_t rx_dat)
Uart Interrupt Routine function.
void ecg4_generic_write(ecg4_t *ctx, char *data_buf, uint16_t len)
Generic write function.
void ecg4_module_reset(ecg4_t *ctx)
Reset module.
void ecg4_cfg_setup(ecg4_cfg_t *cfg)
Config Object Initialization function.
uint8_t ecg4_responseReady(ecg4_t *ctx)
Response ready check function.
ECG4_RETVAL ecg4_init(ecg4_t *ctx, ecg4_cfg_t *cfg)
Initialization function.
int32_t ecg4_generic_read(ecg4_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
Click configuration structure definition.
Definition ecg4.h:141
uint32_t baud_rate
Definition ecg4.h:154
bool uart_blocking
Definition ecg4.h:155
uart_data_bits_t data_bit
Definition ecg4.h:156
pin_name_t tx_pin
Definition ecg4.h:145
pin_name_t rx_pin
Definition ecg4.h:144
uart_stop_bits_t stop_bit
Definition ecg4.h:158
uart_parity_t parity_bit
Definition ecg4.h:157
pin_name_t rst
Definition ecg4.h:149
pin_name_t cs
Definition ecg4.h:150
Click ctx object definition.
Definition ecg4.h:119
digital_out_t cs
Definition ecg4.h:123
uint8_t response_ready
Definition ecg4.h:133
ecg4_hdl_t driver_hdl
Definition ecg4.h:132
uart_t uart
Definition ecg4.h:127
digital_out_t rst
Definition ecg4.h:122