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"
55#include "drv_analog_in.h"
68#define NOISE_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 ); \
73 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
74 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
75 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
90#define NOISE_DEFAULT_COMMAND 0x07
91#define NOISE_DEFAULT_THRESHOLD 0x0400
92#define NOISE_DAC_A 0x00
93#define NOISE_DAC_B 0x08
94#define NOISE_VREF_UNBUFFERED 0x00
95#define NOISE_VREF_BUFFERED 0x04
96#define NOISE_GAIN_2X 0x00
97#define NOISE_GAIN_1X 0x02
98#define NOISE_SHDN_ENABLE 0x00
99#define NOISE_SHDN_DISABLE 0x01
uint8_t noise_check_int_pin(noise_t *ctx)
Get INT pin state.
err_t noise_read_an_pin_value(noise_t *ctx, uint16_t *data_out)
Noise read AN pin value function.
err_t noise_set_cmd_reg(noise_t *ctx, uint8_t configuration, uint16_t threshold)
Set Command Register.
void noise_reset(noise_t *ctx)
Reset Click.
void noise_write_cmd_reg(noise_t *ctx, uint16_t cmd_data)
Write to Command Register.
void noise_cfg_setup(noise_cfg_t *cfg)
Config Object Initialization function.
err_t noise_read_an_pin_voltage(noise_t *ctx, float *data_out)
Noise read AN pin voltage level function.
void noise_default_cfg(noise_t *ctx)
Click Default Configuration function.
err_t noise_init(noise_t *ctx, noise_cfg_t *cfg)
Initialization function.
void noise_set_state(noise_t *ctx, uint8_t state)
Enable/disable click.
Click configuration structure definition.
Definition noise.h:131
analog_in_resolution_t resolution
Definition noise.h:149
float vref
Definition noise.h:150
spi_master_chip_select_polarity_t cs_polarity
Definition noise.h:146
pin_name_t sck
Definition noise.h:135
spi_master_mode_t spi_mode
Definition noise.h:145
pin_name_t mosi
Definition noise.h:134
uint32_t spi_speed
Definition noise.h:144
pin_name_t int_pin
Definition noise.h:141
pin_name_t miso
Definition noise.h:133
pin_name_t rst
Definition noise.h:140
pin_name_t an
Definition noise.h:139
pin_name_t cs
Definition noise.h:136
Click ctx object definition.
Definition noise.h:113
spi_master_t spi
Definition noise.h:121
digital_in_t int_pin
Definition noise.h:118
digital_out_t rst
Definition noise.h:115
pin_name_t chip_select
Definition noise.h:122
analog_in_t adc
Definition noise.h:123