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"
67#define GSR_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
69 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
70 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
78#define GSR_RETVAL uint8_t
81#define GSR_INIT_ERROR 0xFF
#define GSR_RETVAL
Definition gsr.h:78
GSR_RETVAL gsr_init(gsr_t *ctx, gsr_cfg_t *cfg)
Initialization function.
uint16_t gsr_read_value(gsr_t *ctx)
Read Analog Value.
void gsr_cfg_setup(gsr_cfg_t *cfg)
Config Object Initialization function.
void gsr_generic_transfer(gsr_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 gsr.h:108
spi_master_chip_select_polarity_t cs_polarity
Definition gsr.h:120
pin_name_t sck
Definition gsr.h:113
spi_master_mode_t spi_mode
Definition gsr.h:119
pin_name_t mosi
Definition gsr.h:112
uint32_t spi_speed
Definition gsr.h:118
pin_name_t miso
Definition gsr.h:111
pin_name_t cs
Definition gsr.h:114
Click ctx object definition.
Definition gsr.h:95
digital_out_t cs
Definition gsr.h:96
spi_master_t spi
Definition gsr.h:99
pin_name_t chip_select
Definition gsr.h:100