Go to the documentation of this file.
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"
68 #define MAGNETO2_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 )
79 #define MAGNETO2_RETVAL uint8_t
81 #define MAGNETO2_OK 0x00
82 #define MAGNETO2_INIT_ERROR 0xFF
184 #endif // _MAGNETO2_H_
spi_master_chip_select_polarity_t cs_polarity
Definition: magneto2.h:122
pin_name_t sck
Definition: magneto2.h:115
pin_name_t mosi
Definition: magneto2.h:114
pin_name_t cs
Definition: magneto2.h:116
void magneto2_cfg_setup(magneto2_cfg_t *cfg)
Config Object Initialization function.
uint32_t spi_speed
Definition: magneto2.h:120
uint16_t magneto2_read_data(magneto2_t *ctx)
Generic read two bytes command function.
#define MAGNETO2_RETVAL
Definition: magneto2.h:79
pin_name_t chip_select
Definition: magneto2.h:102
uint8_t spi_mode
Definition: magneto2.h:121
digital_out_t cs
Definition: magneto2.h:97
Click configuration structure definition.
Definition: magneto2.h:110
float magneto2_read_angle(magneto2_t *ctx)
Generic read angle function.
pin_name_t miso
Definition: magneto2.h:113
spi_master_t spi
Definition: magneto2.h:101
Click ctx object definition.
Definition: magneto2.h:96
MAGNETO2_RETVAL magneto2_init(magneto2_t *ctx, magneto2_cfg_t *cfg)
Initialization function.