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"
74#define ANGLE9_REG_EWA 0x02
75#define ANGLE9_REG_EWDH 0x04
76#define ANGLE9_REG_EWDL 0x06
77#define ANGLE9_REG_EWCS 0x08
78#define ANGLE9_REG_ERA 0x0A
79#define ANGLE9_REG_ERCS 0x0C
80#define ANGLE9_REG_ERDH 0x0E
81#define ANGLE9_REG_ERDL 0x10
82#define ANGLE9_REG_CTRL 0x1E
83#define ANGLE9_REG_ANG 0x20
84#define ANGLE9_REG_STA 0x22
85#define ANGLE9_REG_ERR 0x24
86#define ANGLE9_REG_WARN 0x26
87#define ANGLE9_REG_TSEN 0x28
88#define ANGLE9_REG_FIELD 0x2A
89#define ANGLE9_REG_HANG 0x30
90#define ANGLE9_REG_ANG15 0x32
91#define ANGLE9_REG_ZANG 0x34
92#define ANGLE9_REG_KEY 0x3C
110#define ANGLE9_WRITE_BIT 0x40
116#define ANGLE9_DATA_RESOLUTION 0x0FFFu
117#define ANGLE9_FULL_CIRCLE 360.0f
118#define ANGLE9_TEMP_RESOLUTION 8.0f
119#define ANGLE9_TEMP_OFFSET 25.0f
125#define ANGLE9_ODD_PARITY 0x01
135#define ANGLE9_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
136#define ANGLE9_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
154#define ANGLE9_MAP_MIKROBUS( cfg, mikrobus ) \
155 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
156 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
157 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
158 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
159 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM );
angle9_return_value_t
Angle 9 Click return value data.
Definition angle9.h:207
@ ANGLE9_ERROR
Definition angle9.h:209
@ ANGLE9_OK
Definition angle9.h:208
err_t angle9_write_register(angle9_t *ctx, uint8_t reg, uint16_t data_in)
Angle 9 write register function.
void angle9_cfg_setup(angle9_cfg_t *cfg)
Angle 9 configuration object setup function.
err_t angle9_read_register(angle9_t *ctx, uint8_t reg, uint16_t *data_out)
Angle 9 read register function.
err_t angle9_init(angle9_t *ctx, angle9_cfg_t *cfg)
Angle 9 initialization function.
uint8_t angle9_get_pwm_pin(angle9_t *ctx)
Angle 9 get pwm pin function.
err_t angle9_read_temperature(angle9_t *ctx, float *temperature)
Angle 9 read temperature function.
err_t angle9_read_field_strength(angle9_t *ctx, uint16_t *field_str)
Angle 9 read field strength function.
err_t angle9_read_angle(angle9_t *ctx, float *angle)
Angle 9 read angle function.
This file contains SPI specific macros, functions, etc.
Angle 9 Click configuration object.
Definition angle9.h:185
spi_master_chip_select_polarity_t cs_polarity
Definition angle9.h:198
pin_name_t sck
Definition angle9.h:189
spi_master_mode_t spi_mode
Definition angle9.h:197
pin_name_t mosi
Definition angle9.h:188
uint32_t spi_speed
Definition angle9.h:196
pin_name_t pwm
Definition angle9.h:193
pin_name_t miso
Definition angle9.h:187
pin_name_t cs
Definition angle9.h:190
Angle 9 Click context object.
Definition angle9.h:169
spi_master_t spi
Definition angle9.h:174
digital_in_t pwm
Definition angle9.h:171
pin_name_t chip_select
Definition angle9.h:176