magneticrotary3 2.0.0.0
magneticrotary3.h File Reference

This file contains API for Magnetic Rotary 3 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  magneticrotary3_t
 Magnetic Rotary 3 Click context object. More...
 
struct  magneticrotary3_cfg_t
 Magnetic Rotary 3 Click configuration object. More...
 

Macros

#define MAGNETICROTARY3_REG_NOP   0x0000
 Magnetic Rotary 3 volatile registers list.
 
#define MAGNETICROTARY3_REG_ERRFL   0x0001
 
#define MAGNETICROTARY3_REG_PROG   0x0003
 
#define MAGNETICROTARY3_REG_DIA   0x3FF5
 
#define MAGNETICROTARY3_REG_AGC   0x3FF9
 
#define MAGNETICROTARY3_REG_SIN_DATA   0x3FFA
 
#define MAGNETICROTARY3_REG_COS_DATA   0x3FFB
 
#define MAGNETICROTARY3_REG_VEL   0x3FFC
 
#define MAGNETICROTARY3_REG_MAG   0x3FFD
 
#define MAGNETICROTARY3_REG_ANGLEUNC   0x3FFE
 
#define MAGNETICROTARY3_REG_ANGLECOM   0x3FFF
 
#define MAGNETICROTARY3_REG_ECC_CHECKSUM   0x00D1
 
#define MAGNETICROTARY3_REG_DISABLE   0x0015
 Magnetic Rotary 3 non-volatile registers list.
 
#define MAGNETICROTARY3_REG_ZPOSM   0x0016
 
#define MAGNETICROTARY3_REG_ZPOSL   0x0017
 
#define MAGNETICROTARY3_REG_SETTINGS1   0x0018
 
#define MAGNETICROTARY3_REG_SETTINGS2   0x0019
 
#define MAGNETICROTARY3_REG_SETTINGS3   0x001A
 
#define MAGNETICROTARY3_REG_ECC   0x001B
 
#define MAGNETICROTARY3_DATA_RESOLUTION   0x3FFF
 Magnetic Rotary 3 angle calculation values.
 
#define MAGNETICROTARY3_FULL_CIRCLE   360
 
#define MAGNETICROTARY3_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define MAGNETICROTARY3_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define MAGNETICROTARY3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  magneticrotary3_return_value_t { MAGNETICROTARY3_OK = 0 , MAGNETICROTARY3_ERROR = -1 }
 Magnetic Rotary 3 Click return value data. More...
 

Functions

void magneticrotary3_cfg_setup (magneticrotary3_cfg_t *cfg)
 Magnetic Rotary 3 configuration object setup function.
 
err_t magneticrotary3_init (magneticrotary3_t *ctx, magneticrotary3_cfg_t *cfg)
 Magnetic Rotary 3 initialization function.
 
err_t magneticrotary3_write_register (magneticrotary3_t *ctx, uint16_t reg, uint16_t data_in)
 Magnetic Rotary 3 write register function.
 
err_t magneticrotary3_read_register (magneticrotary3_t *ctx, uint16_t reg, uint16_t *data_out)
 Magnetic Rotary 3 read register function.
 
err_t magneticrotary3_get_angle (magneticrotary3_t *ctx, float *angle)
 Magnetic Rotary 3 get angle function.
 

Detailed Description

This file contains API for Magnetic Rotary 3 Click Driver.

Enumeration Type Documentation

◆ magneticrotary3_return_value_t

Magnetic Rotary 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
MAGNETICROTARY3_OK 
MAGNETICROTARY3_ERROR