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 NO22_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 ); \
72 cfg.pht = MIKROBUS( mikrobus, MIKROBUS_PWM );
79#define NO22_RETVAL uint8_t
82#define NO22_INIT_ERROR 0xFF
89#define NO22_PIN_STATE_LOW 0
90#define NO22_PIN_STATE_HIGH 1
97#define NO22_DEVICE_ERROR 0xFF
98#define NO22_DEVICE_OK 0xAA
#define NO22_RETVAL
Definition no22.h:79
uint8_t no22_set_pht_state(no22_t *ctx, uint8_t state)
Function for setting pht pin.
uint16_t no22_read_data(no22_t *ctx)
Function for reading ADC data.
float no22_get_ppb(no22_t *ctx)
Function for reading ppb data.
void no22_cfg_setup(no22_cfg_t *cfg)
Config Object Initialization function.
NO22_RETVAL no22_init(no22_t *ctx, no22_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition no22.h:129
uint8_t spi_mode
Definition no22.h:144
spi_master_chip_select_polarity_t cs_polarity
Definition no22.h:145
pin_name_t sck
Definition no22.h:134
pin_name_t mosi
Definition no22.h:133
pin_name_t pht
Definition no22.h:139
uint32_t spi_speed
Definition no22.h:143
pin_name_t miso
Definition no22.h:132
pin_name_t cs
Definition no22.h:135
Click ctx object definition.
Definition no22.h:112
digital_out_t cs
Definition no22.h:116
spi_master_t spi
Definition no22.h:120
digital_out_t pht
Definition no22.h:115
pin_name_t chip_select
Definition no22.h:121