39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_spi_master.h"
74#define MRANGLE_MAP_MIKROBUS( cfg, mikrobus ) \
75 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
76 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
77 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
78 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
79 cfg.tce = MIKROBUS( mikrobus, MIKROBUS_RST ); \
80 cfg.pdn = MIKROBUS( mikrobus, MIKROBUS_PWM )
err_t mrangle_get_adc_sin(mrangle_t *ctx, uint16_t *sin_adc)
MR Angle get ADC sine function.
err_t mrangle_get_adc_cos(mrangle_t *ctx, uint16_t *cos_adc)
MR Angle get ADC cosine function.
err_t mrangle_generic_read(mrangle_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
MR Angle data reading function.
void mrangle_output_mode(mrangle_t *ctx, mrangle_output_mode_value_t output_mode)
MR Angle output mode function.
err_t mrangle_get_sin(mrangle_t *ctx, float *sin)
MR Angle get sine function.
err_t mrangle_generic_write(mrangle_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
MR Angle data writing function.
err_t mrangle_get_adc_temp(mrangle_t *ctx, uint16_t *temp_adc)
MR Angle get ADC temperature function.
void mrangle_default_cfg(mrangle_t *ctx)
MR Angle default configuration function.
void mrangle_cfg_setup(mrangle_cfg_t *cfg)
MR Angle configuration object setup function.
void mrangle_powerdown_mode(mrangle_t *ctx, mrangle_powerdown_mode_value_t pd_mode)
MR Angle powerdown mode function.
err_t mrangle_get_temperature(mrangle_t *ctx, float *temperature)
MR Angle get temperature function.
err_t mrangle_get_angle(mrangle_t *ctx, float *angle)
MR Angle get angle function.
err_t mrangle_init(mrangle_t *ctx, mrangle_cfg_t *cfg)
MR Angle initialization function.
err_t mrangle_get_cos(mrangle_t *ctx, float *cos)
MR Angle get cosine function.
mrangle_output_mode_value_t
MR Angle Click output mode value data.
Definition mrangle.h:156
@ OUTPUT_MODE_VOUT_TEMP
Definition mrangle.h:158
@ OUTPUT_MODE_VOUT_SIN_COS
Definition mrangle.h:157
mrangle_powerdown_mode_value_t
MR Angle Click powerdown mode value data.
Definition mrangle.h:145
@ POWERDOWN_MODE_DISABLE
Definition mrangle.h:146
@ POWERDOWN_MODE_ENABLE
Definition mrangle.h:147
mrangle_return_value_t
MR Angle Click return value data.
Definition mrangle.h:134
@ MRANGLE_ERROR
Definition mrangle.h:136
@ MRANGLE_OK
Definition mrangle.h:135
MR Angle Click configuration object.
Definition mrangle.h:109
float vref
Definition mrangle.h:125
spi_master_chip_select_polarity_t cs_polarity
Definition mrangle.h:123
pin_name_t sck
Definition mrangle.h:113
spi_master_mode_t spi_mode
Definition mrangle.h:122
pin_name_t pdn
Definition mrangle.h:118
pin_name_t mosi
Definition mrangle.h:112
uint32_t spi_speed
Definition mrangle.h:121
pin_name_t tce
Definition mrangle.h:117
pin_name_t miso
Definition mrangle.h:111
pin_name_t cs
Definition mrangle.h:114
MR Angle Click context object.
Definition mrangle.h:90
spi_master_t spi
Definition mrangle.h:96
float vref
Definition mrangle.h:100
digital_out_t pdn
Definition mrangle.h:93
digital_out_t tce
Definition mrangle.h:92
pin_name_t chip_select
Definition mrangle.h:98