28#ifndef EZOCARRIERORP_H
29#define EZOCARRIERORP_H
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 EZOCARRIERORP_CMD_BAUD "Baud"
75#define EZOCARRIERORP_CMD_CONT_READ "C"
76#define EZOCARRIERORP_CMD_CAL "Cal"
77#define EZOCARRIERORP_CMD_EXPORT "Export"
78#define EZOCARRIERORP_CMD_FACTORY "Factory"
79#define EZOCARRIERORP_CMD_FIND "Find"
80#define EZOCARRIERORP_CMD_DEV_INFO "i"
81#define EZOCARRIERORP_CMD_I2C "I2C"
82#define EZOCARRIERORP_CMD_IMPORT "Import"
83#define EZOCARRIERORP_CMD_LED "L"
84#define EZOCARRIERORP_CMD_NAME "Name"
85#define EZOCARRIERORP_CMD_PROTOCOL_LOCK "Plock"
86#define EZOCARRIERORP_CMD_SINGLE_READ "R"
87#define EZOCARRIERORP_CMD_SLEEP "Sleep"
88#define EZOCARRIERORP_CMD_STATUS "Status"
89#define EZOCARRIERORP_CMD_RESP_CODES "*OK"
90#define EZOCARRIERORP_CMD_END_COMMAND "\r"
96#define EZOCARRIERORP_RSP_OK "*OK"
97#define EZOCARRIERORP_RSP_ERROR "*ER"
98#define EZOCARRIERORP_RSP_OVER_VOLT "*OV"
99#define EZOCARRIERORP_RSP_UNDER_VOLT "*UV"
100#define EZOCARRIERORP_RSP_RESET "*RS"
101#define EZOCARRIERORP_RSP_READY "*RE"
102#define EZOCARRIERORP_RSP_SLEEP "*SL"
103#define EZOCARRIERORP_RSP_WAKE_UP "*WA"
110#define EZOCARRIERORP_TX_DRV_BUFFER_SIZE 100
111#define EZOCARRIERORP_RX_DRV_BUFFER_SIZE 300
120#define EZOCARRIERORP_DEVICE_ADDRESS 0x61
136#define EZOCARRIERORP_MAP_MIKROBUS( cfg, mikrobus ) \
137 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
138 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
139 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
140 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX )
ezocarrierorp_drv_t
EZO Carrier EC Click driver selector.
Definition ezocarrierorp.h:150
@ EZOCARRIERORP_DRV_SEL_UART
Definition ezocarrierorp.h:152
@ EZOCARRIERORP_DRV_SEL_I2C
Definition ezocarrierorp.h:151
ezocarrierorp_return_value_t
EZO Carrier ORP Click return value data.
Definition ezocarrierorp.h:205
@ EZOCARRIERORP_ERROR
Definition ezocarrierorp.h:207
@ EZOCARRIERORP_ERROR_TIMEOUT
Definition ezocarrierorp.h:208
@ EZOCARRIERORP_OK
Definition ezocarrierorp.h:206
#define EZOCARRIERORP_RX_DRV_BUFFER_SIZE
Definition ezocarrierorp.h:111
#define EZOCARRIERORP_TX_DRV_BUFFER_SIZE
EZO Carrier ORP driver buffer size.
Definition ezocarrierorp.h:110
err_t ezocarrierorp_init(ezocarrierorp_t *ctx, ezocarrierorp_cfg_t *cfg)
EZO Carrier ORP initialization function.
err_t ezocarrierorp_generic_read(ezocarrierorp_t *ctx, uint8_t *data_out, uint16_t len)
EZO Carrier ORP data reading function.
err_t ezocarrierorp_generic_write(ezocarrierorp_t *ctx, uint8_t *data_in, uint16_t len)
EZO Carrier ORP data writing function.
void ezocarrierorp_cfg_setup(ezocarrierorp_cfg_t *cfg)
EZO Carrier ORP configuration object setup function.
void ezocarrierorp_drv_interface_sel(ezocarrierorp_cfg_t *cfg, ezocarrierorp_drv_t drv_sel)
EZO Carrier EC driver interface setup function.
void ezocarrierorp_send_cmd_check(ezocarrierorp_t *ctx, uint8_t *cmd)
Check the sent command.
void ezocarrierorp_send_cmd_with_par(ezocarrierorp_t *ctx, uint8_t *cmd, uint8_t *param_buf)
Send command function with parameter.
void ezocarrierorp_send_cmd(ezocarrierorp_t *ctx, uint8_t *cmd)
Send command function.
EZO Carrier ORP Click configuration object.
Definition ezocarrierorp.h:181
uint32_t baud_rate
Definition ezocarrierorp.h:189
ezocarrierorp_drv_t drv_sel
Definition ezocarrierorp.h:196
uint32_t i2c_speed
Definition ezocarrierorp.h:194
bool uart_blocking
Definition ezocarrierorp.h:190
uart_data_bits_t data_bit
Definition ezocarrierorp.h:191
pin_name_t tx_pin
Definition ezocarrierorp.h:184
pin_name_t rx_pin
Definition ezocarrierorp.h:183
uart_stop_bits_t stop_bit
Definition ezocarrierorp.h:193
pin_name_t scl
Definition ezocarrierorp.h:185
uart_parity_t parity_bit
Definition ezocarrierorp.h:192
pin_name_t sda
Definition ezocarrierorp.h:186
uint8_t i2c_address
Definition ezocarrierorp.h:195
EZO Carrier ORP Click context object.
Definition ezocarrierorp.h:161
ezocarrierorp_drv_t drv_sel
Definition ezocarrierorp.h:172
uart_t uart
Definition ezocarrierorp.h:163
i2c_master_t i2c
Definition ezocarrierorp.h:164
uint8_t slave_address
Definition ezocarrierorp.h:170