42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define QIRECEIVER_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.teop = MIKROBUS( mikrobus, MIKROBUS_AN ); \
70 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.stat = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.end = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
80#define QIRECEIVER_RETVAL uint8_t
82#define QIRECEIVER_OK 0x00
83#define QIRECEIVER_INIT_ERROR 0xFF
96#define QIRECEIVER_I2C_ADDR 0x25
104#define QIRECEIVER_VRECT_REG0 0x40
105#define QIRECEIVER_VRECT_REG1 0x41
113#define QIRECEIVER_IOUT_REG2 0x42
114#define QIRECEIVER_IOUT_REG3 0x43
121#define QIRECEIVER_FREQ_REG4 0x44
122#define QIRECEIVER_FREQ_REG5 0x45
130#define QIRECEIVER_REG7 0x47
131#define QIRECEIVER_REG8 0x48
139#define QIRECEIVER_WPC_ID_B0 0x54
140#define QIRECEIVER_WPC_ID_B1 0x55
141#define QIRECEIVER_WPC_ID_B2 0x56
142#define QIRECEIVER_WPC_ID_B3 0x57
143#define QIRECEIVER_WPC_ID_B4 0x58
144#define QIRECEIVER_WPC_ID_B5 0x59
145#define QIRECEIVER_WPC_ID_B6 0x5A
153#define QIRECEIVER_FOD9 0x49
154#define QIRECEIVER_FOD10 0x4A
155#define QIRECEIVER_FOD11 0x4B
156#define QIRECEIVER_FOD12 0x4C
157#define QIRECEIVER_FOD13 0x4D
158#define QIRECEIVER_FOD14 0x4E
159#define QIRECEIVER_FOD15 0x4F
160#define QIRECEIVER_FOD16 0x50
161#define QIRECEIVER_FOD17 0x51
162#define QIRECEIVER_FOD18 0x52
163#define QIRECEIVER_FOD19 0x53
#define QIRECEIVER_RETVAL
Definition qireceiver.h:80
void qireceiver_dev_enable(qireceiver_t *ctx)
Device enable function.
float qireceiver_read_voltage(qireceiver_t *ctx)
Read Voltage function.
QIRECEIVER_RETVAL qireceiver_init(qireceiver_t *ctx, qireceiver_cfg_t *cfg)
Initialization function.
void qireceiver_generic_write(qireceiver_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
float qireceiver_read_freq(qireceiver_t *ctx)
Read Frequency function.
void qireceiver_generic_read(qireceiver_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
float qireceiver_read_current(qireceiver_t *ctx)
Read Current function.
void qireceiver_cfg_setup(qireceiver_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition qireceiver.h:203
uint32_t i2c_speed
Definition qireceiver.h:219
pin_name_t scl
Definition qireceiver.h:206
pin_name_t en
Definition qireceiver.h:212
pin_name_t int_pin
Definition qireceiver.h:215
pin_name_t end
Definition qireceiver.h:214
pin_name_t sda
Definition qireceiver.h:207
pin_name_t teop
Definition qireceiver.h:211
pin_name_t stat
Definition qireceiver.h:213
uint8_t i2c_address
Definition qireceiver.h:220
Click ctx object definition.
Definition qireceiver.h:177
digital_out_t teop
Definition qireceiver.h:180
digital_in_t stat
Definition qireceiver.h:186
digital_in_t int_pin
Definition qireceiver.h:187
digital_out_t end
Definition qireceiver.h:182
i2c_master_t i2c
Definition qireceiver.h:191
digital_out_t en
Definition qireceiver.h:181
uint8_t slave_address
Definition qireceiver.h:195