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 EZOCARRIERDO_CMD_BAUD "Baud"
75#define EZOCARRIERDO_CMD_CONT_READ "C"
76#define EZOCARRIERDO_CMD_CAL "Cal"
77#define EZOCARRIERDO_CMD_EXPORT "Export"
78#define EZOCARRIERDO_CMD_FACTORY "Factory"
79#define EZOCARRIERDO_CMD_FIND "Find"
80#define EZOCARRIERDO_CMD_DEV_INFO "i"
81#define EZOCARRIERDO_CMD_I2C "I2C"
82#define EZOCARRIERDO_CMD_IMPORT "Import"
83#define EZOCARRIERDO_CMD_LED "L"
84#define EZOCARRIERDO_CMD_NAME "Name"
85#define EZOCARRIERDO_CMD_PARAMETERS "O"
86#define EZOCARRIERDO_CMD_PRES_COMPENSATION "P"
87#define EZOCARRIERDO_CMD_PROTOCOL_LOCK "Plock"
88#define EZOCARRIERDO_CMD_SINGLE_READ "R"
89#define EZOCARRIERDO_CMD_SALINITY_COMPENSATION "S"
90#define EZOCARRIERDO_CMD_SLEEP "Sleep"
91#define EZOCARRIERDO_CMD_STATUS "Status"
92#define EZOCARRIERDO_CMD_TEMP_COMPENSATION "T"
93#define EZOCARRIERDO_CMD_RESP_CODES "*OK"
94#define EZOCARRIERDO_CMD_END_COMMAND "\r"
100#define EZOCARRIERDO_RSP_OK "*OK"
101#define EZOCARRIERDO_RSP_ERROR "*ER"
102#define EZOCARRIERDO_RSP_OVER_VOLT "*OV"
103#define EZOCARRIERDO_RSP_UNDER_VOLT "*UV"
104#define EZOCARRIERDO_RSP_RESET "*RS"
105#define EZOCARRIERDO_RSP_READY "*RE"
106#define EZOCARRIERDO_RSP_SLEEP "*SL"
107#define EZOCARRIERDO_RSP_WAKE_UP "*WA"
114#define EZOCARRIERDO_TX_DRV_BUFFER_SIZE 100
115#define EZOCARRIERDO_RX_DRV_BUFFER_SIZE 300
124#define EZOCARRIERDO_DEVICE_ADDRESS 0x61
140#define EZOCARRIERDO_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 )
ezocarrierdo_return_value_t
EZO Carrier DO Click return value data.
Definition ezocarrierdo.h:209
@ EZOCARRIERDO_ERROR
Definition ezocarrierdo.h:211
@ EZOCARRIERDO_ERROR_TIMEOUT
Definition ezocarrierdo.h:212
@ EZOCARRIERDO_OK
Definition ezocarrierdo.h:210
ezocarrierdo_drv_t
EZO Carrier DO Click driver selector.
Definition ezocarrierdo.h:154
@ EZOCARRIERDO_DRV_SEL_UART
Definition ezocarrierdo.h:156
@ EZOCARRIERDO_DRV_SEL_I2C
Definition ezocarrierdo.h:155
#define EZOCARRIERDO_RX_DRV_BUFFER_SIZE
Definition ezocarrierdo.h:115
#define EZOCARRIERDO_TX_DRV_BUFFER_SIZE
EZO Carrier DO driver buffer size.
Definition ezocarrierdo.h:114
void ezocarrierdo_send_cmd(ezocarrierdo_t *ctx, uint8_t *cmd)
Send command function.
err_t ezocarrierdo_generic_read(ezocarrierdo_t *ctx, uint8_t *data_out, uint16_t len)
EZO Carrier DO data reading function.
err_t ezocarrierdo_generic_write(ezocarrierdo_t *ctx, uint8_t *data_in, uint16_t len)
EZO Carrier DO data writing function.
void ezocarrierdo_send_cmd_check(ezocarrierdo_t *ctx, uint8_t *cmd)
Check the sent command.
void ezocarrierdo_send_cmd_with_par(ezocarrierdo_t *ctx, uint8_t *cmd, uint8_t *param_buf)
Send command function with parameter.
err_t ezocarrierdo_init(ezocarrierdo_t *ctx, ezocarrierdo_cfg_t *cfg)
EZO Carrier DO initialization function.
void ezocarrierdo_cfg_setup(ezocarrierdo_cfg_t *cfg)
EZO Carrier DO configuration object setup function.
void ezocarrierdo_drv_interface_sel(ezocarrierdo_cfg_t *cfg, ezocarrierdo_drv_t drv_sel)
EZO Carrier DO driver interface setup function.
EZO Carrier DO Click configuration object.
Definition ezocarrierdo.h:185
ezocarrierdo_drv_t drv_sel
Definition ezocarrierdo.h:200
uint32_t baud_rate
Definition ezocarrierdo.h:193
uint32_t i2c_speed
Definition ezocarrierdo.h:198
bool uart_blocking
Definition ezocarrierdo.h:194
uart_data_bits_t data_bit
Definition ezocarrierdo.h:195
pin_name_t tx_pin
Definition ezocarrierdo.h:188
pin_name_t rx_pin
Definition ezocarrierdo.h:187
uart_stop_bits_t stop_bit
Definition ezocarrierdo.h:197
pin_name_t scl
Definition ezocarrierdo.h:189
uart_parity_t parity_bit
Definition ezocarrierdo.h:196
pin_name_t sda
Definition ezocarrierdo.h:190
uint8_t i2c_address
Definition ezocarrierdo.h:199
EZO Carrier DO Click context object.
Definition ezocarrierdo.h:165
ezocarrierdo_drv_t drv_sel
Definition ezocarrierdo.h:176
uart_t uart
Definition ezocarrierdo.h:167
i2c_master_t i2c
Definition ezocarrierdo.h:168
uint8_t slave_address
Definition ezocarrierdo.h:174