39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
74#define EZOCARRIEREC_CMD_BAUD "Baud"
75#define EZOCARRIEREC_CMD_CONT_READ "C"
76#define EZOCARRIEREC_CMD_CAL "Cal"
77#define EZOCARRIEREC_CMD_EXPORT "Export"
78#define EZOCARRIEREC_CMD_FACTORY "Factory"
79#define EZOCARRIEREC_CMD_FIND "Find"
80#define EZOCARRIEREC_CMD_DEV_INFO "i"
81#define EZOCARRIEREC_CMD_I2C "I2C"
82#define EZOCARRIEREC_CMD_IMPORT "Import"
83#define EZOCARRIEREC_CMD_SET_PROBE_TYPE "K"
84#define EZOCARRIEREC_CMD_LED "L"
85#define EZOCARRIEREC_CMD_NAME "Name"
86#define EZOCARRIEREC_CMD_PARAMETERS "O"
87#define EZOCARRIEREC_CMD_PROTOCOL_LOCK "Plock"
88#define EZOCARRIEREC_CMD_SINGLE_READ "R"
89#define EZOCARRIEREC_CMD_SLEEP "Sleep"
90#define EZOCARRIEREC_CMD_STATUS "Status"
91#define EZOCARRIEREC_CMD_TEMP_COMPENSATION "T"
92#define EZOCARRIEREC_CMD_TDS "TDS"
93#define EZOCARRIEREC_CMD_RESP_CODES "*OK"
94#define EZOCARRIEREC_CMD_END_COMMAND "\r"
100#define EZOCARRIEREC_RSP_OK "*OK"
101#define EZOCARRIEREC_RSP_ERROR "*ER"
102#define EZOCARRIEREC_RSP_OVER_VOLT "*OV"
103#define EZOCARRIEREC_RSP_UNDER_VOLT "*UV"
104#define EZOCARRIEREC_RSP_RESET "*RS"
105#define EZOCARRIEREC_RSP_READY "*RE"
106#define EZOCARRIEREC_RSP_SLEEP "*SL"
107#define EZOCARRIEREC_RSP_WAKE_UP "*WA"
114#define EZOCARRIEREC_TX_DRV_BUFFER_SIZE 100
115#define EZOCARRIEREC_RX_DRV_BUFFER_SIZE 300
124#define EZOCARRIEREC_DEVICE_ADDRESS 0x61
140#define EZOCARRIEREC_MAP_MIKROBUS( cfg, mikrobus ) \
141 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
142 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
143 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
144 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX )
171 uint8_t uart_rx_buffer[ EZOCARRIEREC_RX_DRV_BUFFER_SIZE ];
172 uint8_t uart_tx_buffer[ EZOCARRIEREC_TX_DRV_BUFFER_SIZE ];
ezocarrierec_return_value_t
EZO Carrier EC Click return value data.
Definition ezocarrierec.h:209
@ EZOCARRIEREC_ERROR_TIMEOUT
Definition ezocarrierec.h:212
@ EZOCARRIEREC_ERROR
Definition ezocarrierec.h:211
@ EZOCARRIEREC_OK
Definition ezocarrierec.h:210
ezocarrierec_drv_t
EZO Carrier EC Click driver selector.
Definition ezocarrierec.h:154
@ EZOCARRIEREC_DRV_SEL_I2C
Definition ezocarrierec.h:155
@ EZOCARRIEREC_DRV_SEL_UART
Definition ezocarrierec.h:156
void ezocarrierec_send_cmd(ezocarrierec_t *ctx, uint8_t *cmd)
Send command function.
void ezocarrierec_cfg_setup(ezocarrierec_cfg_t *cfg)
EZO Carrier EC configuration object setup function.
err_t ezocarrierec_init(ezocarrierec_t *ctx, ezocarrierec_cfg_t *cfg)
EZO Carrier EC initialization function.
void ezocarrierec_send_cmd_with_par(ezocarrierec_t *ctx, uint8_t *cmd, uint8_t *param_buf)
Send command function with parameter.
void ezocarrierec_send_cmd_check(ezocarrierec_t *ctx, uint8_t *cmd)
Check the sent command.
err_t ezocarrierec_generic_write(ezocarrierec_t *ctx, uint8_t *data_in, uint16_t len)
EZO Carrier EC data writing function.
err_t ezocarrierec_generic_read(ezocarrierec_t *ctx, uint8_t *data_out, uint16_t len)
EZO Carrier EC data reading function.
void ezocarrierec_drv_interface_sel(ezocarrierec_cfg_t *cfg, ezocarrierec_drv_t drv_sel)
EZO Carrier EC driver interface setup function.
EZO Carrier EC Click configuration object.
Definition ezocarrierec.h:185
uint32_t baud_rate
Definition ezocarrierec.h:193
uint32_t i2c_speed
Definition ezocarrierec.h:198
bool uart_blocking
Definition ezocarrierec.h:194
uart_data_bits_t data_bit
Definition ezocarrierec.h:195
pin_name_t tx_pin
Definition ezocarrierec.h:188
pin_name_t rx_pin
Definition ezocarrierec.h:187
uart_stop_bits_t stop_bit
Definition ezocarrierec.h:197
pin_name_t scl
Definition ezocarrierec.h:189
ezocarrierec_drv_t drv_sel
Definition ezocarrierec.h:200
uart_parity_t parity_bit
Definition ezocarrierec.h:196
pin_name_t sda
Definition ezocarrierec.h:190
uint8_t i2c_address
Definition ezocarrierec.h:199
EZO Carrier EC Click context object.
Definition ezocarrierec.h:165
uart_t uart
Definition ezocarrierec.h:167
i2c_master_t i2c
Definition ezocarrierec.h:168
uint8_t slave_address
Definition ezocarrierec.h:174
ezocarrierec_drv_t drv_sel
Definition ezocarrierec.h:176