magneticrotary6 2.0.0.0
magneticrotary6.h File Reference

This file contains API for Magnetic Rotary 6 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  magneticrotary6_t
 Magnetic Rotary 6 Click context object. More...
 
struct  magneticrotary6_cfg_t
 Magnetic Rotary 6 Click configuration object. More...
 

Macros

#define MAGNETICROTARY6_REG_NOP   0x0000u
 Magnetic Rotary 6 volatile registers list.
 
#define MAGNETICROTARY6_REG_ERRFL   0x0001u
 
#define MAGNETICROTARY6_REG_PROG   0x0003u
 
#define MAGNETICROTARY6_REG_DIA   0x3FF5u
 
#define MAGNETICROTARY6_REG_AGC   0x3FF9u
 
#define MAGNETICROTARY6_REG_SIN_DATA   0x3FFAu
 
#define MAGNETICROTARY6_REG_COS_DATA   0x3FFBu
 
#define MAGNETICROTARY6_REG_VEL   0x3FFCu
 
#define MAGNETICROTARY6_REG_MAG   0x3FFDu
 
#define MAGNETICROTARY6_REG_ANGLEUNC   0x3FFEu
 
#define MAGNETICROTARY6_REG_ANGLECOM   0x3FFFu
 
#define MAGNETICROTARY6_REG_ECC_CHECKSUM   0x00D1u
 
#define MAGNETICROTARY6_REG_DISABLE   0x0015u
 Magnetic Rotary 6 non-volatile registers list.
 
#define MAGNETICROTARY6_REG_ZPOSM   0x0016u
 
#define MAGNETICROTARY6_REG_ZPOSL   0x0017u
 
#define MAGNETICROTARY6_REG_SETTINGS1   0x0018u
 
#define MAGNETICROTARY6_REG_SETTINGS2   0x0019u
 
#define MAGNETICROTARY6_REG_SETTINGS3   0x001Au
 
#define MAGNETICROTARY6_REG_ECC   0x001Bu
 
#define MAGNETICROTARY6_ERRFL_CORDIC_OF   0x0400u
 Magnetic Rotary 6 ERRFL register settings.
 
#define MAGNETICROTARY6_ERRFL_OFF_COMP_NOT_FIN   0x0200u
 
#define MAGNETICROTARY6_ERRFL_BRKHALL   0x0100u
 
#define MAGNETICROTARY6_ERRFL_WDTST   0x0080u
 
#define MAGNETICROTARY6_ERRFL_CRC_ERROR   0x0040u
 
#define MAGNETICROTARY6_ERRFL_CMD_ERROR   0x0020u
 
#define MAGNETICROTARY6_ERRFL_FRAMING_ERROR   0x0010u
 
#define MAGNETICROTARY6_ERRFL_P2RAM_ERROR   0x0008u
 
#define MAGNETICROTARY6_ERRFL_P2RAM_WARNING   0x0004u
 
#define MAGNETICROTARY6_ERRFL_MAGHALF   0x0002u
 
#define MAGNETICROTARY6_ERRFL_AGC_WARNING   0x0001u
 
#define MAGNETICROTARY6_PROG_PROGVER   0x0040u
 Magnetic Rotary 6 PROG register settings.
 
#define MAGNETICROTARY6_PROG_PROGOTP   0x0008u
 
#define MAGNETICROTARY6_PROG_OTPREF   0x0004u
 
#define MAGNETICROTARY6_PROG_PROGEN   0x0001u
 
#define MAGNETICROTARY6_DIA_SPI_CNT   0x1800u
 Magnetic Rotary 6 DIA register settings.
 
#define MAGNETICROTARY6_DIA_FUSA_ERROR   0x0400u
 
#define MAGNETICROTARY6_DIA_AGC_FIN   0x0200u
 
#define MAGNETICROTARY6_DIA_OFF_COMP_FIN   0x0100u
 
#define MAGNETICROTARY6_DIA_SINOFF_FIN   0x0080u
 
#define MAGNETICROTARY6_DIA_COSOFF_FIN   0x0040u
 
#define MAGNETICROTARY6_DIA_MAGHALF_FLAG   0x0020u
 
#define MAGNETICROTARY6_DIA_COMP_H   0x0010u
 
#define MAGNETICROTARY6_DIA_COMP_L   0x0008u
 
#define MAGNETICROTARY6_DIA_CORDIC_OF   0x0004u
 
#define MAGNETICROTARY6_DIA_LOOPSFIN   0x0002u
 
#define MAGNETICROTARY6_DIA_VDD_MODE_5V   0x0001u
 
#define MAGNETICROTARY6_DIA_VDD_MODE_3V   0x0000u
 
#define MAGNETICROTARY6_DISABLE_FILTER_DISABLE   0x0040u
 Magnetic Rotary 6 DISABLE register settings.
 
#define MAGNETICROTARY6_DISABLE_BRKHALL_SET   0x003Cu
 
#define MAGNETICROTARY6_DISABLE_ABI_OFF   0x0002u
 
#define MAGNETICROTARY6_DISABLE_UVW_OFF   0x0001u
 
#define MAGNETICROTARY6_ZPOSL_DIA2_EN   0x0080u
 Magnetic Rotary 6 ZPOSL register settings.
 
#define MAGNETICROTARY6_ZPOSL_DIA1_EN   0x0040u
 
#define MAGNETICROTARY6_ZPOSL_LSB   0x003Fu
 
#define MAGNETICROTARY6_SETTINGS1_DIA3_EN   0x0040u
 Magnetic Rotary 6 SETTINGS1 register settings.
 
#define MAGNETICROTARY6_SETTINGS1_K_MIN   0x0038u
 
#define MAGNETICROTARY6_SETTINGS1_K_MAX   0x0007u
 
#define MAGNETICROTARY6_SETTINGS2_PWMON   0x0080u
 Magnetic Rotary 6 SETTINGS2 register settings.
 
#define MAGNETICROTARY6_SETTINGS2_DATA_SELECT   0x0040u
 
#define MAGNETICROTARY6_SETTINGS2_ABI_DEC   0x0020u
 
#define MAGNETICROTARY6_SETTINGS2_DAECDIS   0x0010u
 
#define MAGNETICROTARY6_SETTINGS2_UVW_ABI   0x0008u
 
#define MAGNETICROTARY6_SETTINGS2_DIR_CW   0x0000u
 
#define MAGNETICROTARY6_SETTINGS2_DIR_CCW   0x0004u
 
#define MAGNETICROTARY6_SETTINGS2_DIR_MASK   0x0004u
 
#define MAGNETICROTARY6_SETTINGS2_NOISESET   0x0002u
 
#define MAGNETICROTARY6_SETTINGS2_IWIDTH   0x0001u
 
#define MAGNETICROTARY6_SETTINGS3_ABIRES_MASK   0x00E0u
 Magnetic Rotary 6 SETTINGS3 register settings.
 
#define MAGNETICROTARY6_SETTINGS3_HYS_MASK   0x0018u
 
#define MAGNETICROTARY6_SETTINGS3_UVWPP_1PP   0x0000u
 
#define MAGNETICROTARY6_SETTINGS3_UVWPP_2PP   0x0001u
 
#define MAGNETICROTARY6_SETTINGS3_UVWPP_3PP   0x0002u
 
#define MAGNETICROTARY6_SETTINGS3_UVWPP_4PP   0x0003u
 
#define MAGNETICROTARY6_SETTINGS3_UVWPP_5PP   0x0004u
 
#define MAGNETICROTARY6_SETTINGS3_UVWPP_6PP   0x0005u
 
#define MAGNETICROTARY6_SETTINGS3_UVWPP_7PP   0x0006u
 
#define MAGNETICROTARY6_SETTINGS3_UVWPP_MASK   0x0007u
 
#define MAGNETICROTARY6_ECC_EN   0x0080u
 Magnetic Rotary 6 ECC register settings.
 
#define MAGNETICROTARY6_ECC_CHSUM_MASK   0x007Fu
 
#define MAGNETICROTARY6_DIE_BOTTOM   0
 Magnetic Rotary 6 die selection values.
 
#define MAGNETICROTARY6_DIE_TOP   1
 
#define MAGNETICROTARY6_DATA_RESOLUTION   0x3FFFu
 Magnetic Rotary 6 angle calculation values.
 
#define MAGNETICROTARY6_FULL_CIRCLE   360u
 
#define MAGNETICROTARY6_DIR_CW   0
 Magnetic Rotary 6 rotation direction settings.
 
#define MAGNETICROTARY6_DIR_CCW   1
 
#define MAGNETICROTARY6_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define MAGNETICROTARY6_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define MAGNETICROTARY6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  magneticrotary6_return_value_t { MAGNETICROTARY6_OK = 0 , MAGNETICROTARY6_ERROR = -1 }
 Magnetic Rotary 6 Click return value data. More...
 

Functions

void magneticrotary6_cfg_setup (magneticrotary6_cfg_t *cfg)
 Magnetic Rotary 6 configuration object setup function.
 
err_t magneticrotary6_init (magneticrotary6_t *ctx, magneticrotary6_cfg_t *cfg)
 Magnetic Rotary 6 initialization function.
 
err_t magneticrotary6_default_cfg (magneticrotary6_t *ctx)
 Magnetic Rotary 6 default configuration function.
 
err_t magneticrotary6_write_register (magneticrotary6_t *ctx, uint8_t die_sel, uint16_t reg, uint16_t data_in)
 Magnetic Rotary 6 write register function.
 
err_t magneticrotary6_read_register (magneticrotary6_t *ctx, uint8_t die_sel, uint16_t reg, uint16_t *data_out)
 Magnetic Rotary 6 read register b function.
 
err_t magneticrotary6_get_angle (magneticrotary6_t *ctx, uint8_t die_sel, float *angle)
 Magnetic Rotary 6 get angle function.
 
err_t magneticrotary6_set_direction (magneticrotary6_t *ctx, uint8_t die_sel, uint8_t dir)
 Magnetic Rotary 6 set direction function.
 

Detailed Description

This file contains API for Magnetic Rotary 6 Click Driver.

Enumeration Type Documentation

◆ magneticrotary6_return_value_t

Magnetic Rotary 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
MAGNETICROTARY6_OK 
MAGNETICROTARY6_ERROR