39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_spi_master.h"
52#include "drv_analog_in.h"
75#define AMRANGLE_ARM_TOOLCHAIN 0x00
81#define AMRANGLE_PIC_TOOLCHAIN 0x01
99#define AMRANGLE_GAIN_CONTROL_EN 0x01
105#define AMRANGLE_GAIN_CONTROL_DIS 0x00
123#define AMRANGLE_POWER_DOWN_EN 0x01
129#define AMRANGLE_POWER_DOWN_DIS 0x00
147#define AMRANGLE_MAP_MIKROBUS( cfg, mikrobus ) \
148 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
149 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
150 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
151 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
152 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
153 cfg.gc = MIKROBUS( mikrobus, MIKROBUS_RST ); \
154 cfg.pd = MIKROBUS( mikrobus, MIKROBUS_PWM )
amrangle_return_value_t
AMR Angle Click return value data.
Definition amrangle.h:215
@ AMRANGLE_OK
Definition amrangle.h:216
@ AMRANGLE_ERROR
Definition amrangle.h:217
float amrangle_angle_read(amrangle_t *ctx)
AMR Angle read angle function.
void amrangle_gain_control_mode(amrangle_t *ctx, uint8_t gain_control)
AMR Angle gain control mode function.
err_t amrangle_read_vtp_voltage(amrangle_t *ctx, float *vtp_volts)
AMR Angle read vtp voltage function.
err_t amrangle_init(amrangle_t *ctx, amrangle_cfg_t *cfg)
AMR Angle initialization function.
void amrangle_default_cfg(amrangle_t *ctx)
AMR Angle default configuration function.
float amrangle_read_vtp_temp(amrangle_t *ctx)
AMR Angle read temperature function.
void amrangle_power_down_pin(amrangle_t *ctx, uint8_t pd_state)
AMR Angle power down function.
void amrangle_cfg_setup(amrangle_cfg_t *cfg, uint8_t sel_toolchain)
AMR Angle configuration object setup function.
AMR Angle Click configuration object.
Definition amrangle.h:185
analog_in_resolution_t resolution
Definition amrangle.h:205
float vref
Definition amrangle.h:206
spi_master_chip_select_polarity_t cs_polarity
Definition amrangle.h:203
pin_name_t sck
Definition amrangle.h:190
spi_master_mode_t spi_mode
Definition amrangle.h:202
pin_name_t mosi
Definition amrangle.h:189
uint32_t spi_speed
Definition amrangle.h:201
pin_name_t miso
Definition amrangle.h:188
pin_name_t pd
Definition amrangle.h:197
pin_name_t gc
Definition amrangle.h:196
pin_name_t an
Definition amrangle.h:195
pin_name_t cs
Definition amrangle.h:191
AMR Angle Click context object.
Definition amrangle.h:164
digital_out_t gc
Definition amrangle.h:167
spi_master_t spi
Definition amrangle.h:174
digital_out_t pd
Definition amrangle.h:168
pin_name_t chip_select
Definition amrangle.h:176
analog_in_t adc
Definition amrangle.h:172