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 ANGLE6_REG_ZERO_SETTING_LSB 0x00
75#define ANGLE6_REG_ZERO_SETTING_MSB 0x01
76#define ANGLE6_REG_BIAS_CURRENT_TIMING 0x02
77#define ANGLE6_REG_ENABLE_TRIMMING 0x03
78#define ANGLE6_REG_ABZ_SETTING_LSB 0x04
79#define ANGLE6_REG_ABZ_SETTING_MSB 0x05
80#define ANGLE6_REG_MAGNETIC_FIELD_CONFIG 0x06
81#define ANGLE6_REG_ROTATION_DIRECTION 0x09
82#define ANGLE6_REG_ALARM_FLAGS 0x1B
88#define ANGLE6_CMD_READ_ANGLE 0x00
89#define ANGLE6_CMD_READ_REGISTER 0x40
90#define ANGLE6_CMD_WRITE_REGISTER 0x80
108#define ANGLE6_ROTATION_DIRECTION_CW 0x00
109#define ANGLE6_ROTATION_DIRECTION_CCW 0x80
115#define ANGLE6_RESOLUTION 0xFFFF
116#define ANGLE6_FULL_CIRCLE 360.0
126#define ANGLE6_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
127#define ANGLE6_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
145#define ANGLE6_MAP_MIKROBUS( cfg, mikrobus ) \
146 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
147 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
148 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
149 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
150 cfg.mgh = MIKROBUS( mikrobus, MIKROBUS_RST ); \
151 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
152 cfg.mgl = MIKROBUS( mikrobus, MIKROBUS_INT )
angle6_return_value_t
Angle 6 Click return value data.
Definition angle6.h:204
@ ANGLE6_ERROR
Definition angle6.h:206
@ ANGLE6_OK
Definition angle6.h:205
err_t angle6_init(angle6_t *ctx, angle6_cfg_t *cfg)
Angle 6 initialization function.
err_t angle6_default_cfg(angle6_t *ctx)
Angle 6 default configuration function.
err_t angle6_write_register(angle6_t *ctx, uint8_t reg, uint8_t data_in)
Angle 6 write register function.
err_t angle6_read_register(angle6_t *ctx, uint8_t reg, uint8_t *data_out)
Angle 6 read register function.
void angle6_cfg_setup(angle6_cfg_t *cfg)
Angle 6 configuration object setup function.
err_t angle6_read_angle(angle6_t *ctx, float *angle)
Angle 6 read angle function.
uint8_t angle6_get_mgh_pin(angle6_t *ctx)
Angle 6 get mgh pin function.
uint8_t angle6_get_mgl_pin(angle6_t *ctx)
Angle 6 get mgl pin function.
uint8_t angle6_get_pwm_pin(angle6_t *ctx)
Angle 6 get pwm pin function.
This file contains SPI specific macros, functions, etc.
Angle 6 Click configuration object.
Definition angle6.h:180
spi_master_chip_select_polarity_t cs_polarity
Definition angle6.h:195
pin_name_t sck
Definition angle6.h:184
spi_master_mode_t spi_mode
Definition angle6.h:194
pin_name_t mgl
Definition angle6.h:190
pin_name_t mosi
Definition angle6.h:183
uint32_t spi_speed
Definition angle6.h:193
pin_name_t mgh
Definition angle6.h:188
pin_name_t pwm
Definition angle6.h:189
pin_name_t miso
Definition angle6.h:182
pin_name_t cs
Definition angle6.h:185
Angle 6 Click context object.
Definition angle6.h:162
spi_master_t spi
Definition angle6.h:169
digital_in_t pwm
Definition angle6.h:165
digital_in_t mgh
Definition angle6.h:164
digital_in_t mgl
Definition angle6.h:166
pin_name_t chip_select
Definition angle6.h:171