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_spi_master.h"
68#define CURRENT2_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
79#define CURRENT2_RETVAL uint8_t
81#define CURRENT2_OK 0x00
82#define CURRENT2_INIT_ERROR 0xFF
uint16_t current2_get_current(current2_t *ctx, uint8_t n_sample)
Get Current function.
void current2_cfg_setup(current2_cfg_t *cfg)
Config Object Initialization function.
uint16_t current2_get_adc(current2_t *ctx)
Get ADC function.
uint16_t current2_get_average_adc(current2_t *ctx, uint8_t n_samp)
Get Averaged ADC function.
uint8_t current2_init(current2_t *ctx, current2_cfg_t *cfg)
Initialization function.
void current2_generic_transfer(current2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
Click configuration structure definition.
Definition current2.h:110
spi_master_chip_select_polarity_t cs_polarity
Definition current2.h:123
pin_name_t sck
Definition current2.h:115
spi_master_mode_t spi_mode
Definition current2.h:122
pin_name_t mosi
Definition current2.h:114
uint32_t spi_speed
Definition current2.h:121
pin_name_t miso
Definition current2.h:113
pin_name_t cs
Definition current2.h:116
Click ctx object definition.
Definition current2.h:96
digital_out_t cs
Definition current2.h:97
spi_master_t spi
Definition current2.h:101
pin_name_t chip_select
Definition current2.h:102