magneticrotary4 2.0.0.0
magneticrotary4.h File Reference

This file contains API for Magnetic Rotary 4 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  magneticrotary4_t
 Magnetic Rotary 4 Click context object. More...
 
struct  magneticrotary4_cfg_t
 Magnetic Rotary 4 Click configuration object. More...
 

Macros

#define MAGNETICROTARY4_REG_NOP   0x0000
 Magnetic Rotary 4 volatile registers list.
 
#define MAGNETICROTARY4_REG_ERRFL   0x0001
 
#define MAGNETICROTARY4_REG_PROG   0x0003
 
#define MAGNETICROTARY4_REG_DIAAGC   0x3FFC
 
#define MAGNETICROTARY4_REG_MAG   0x3FFD
 
#define MAGNETICROTARY4_REG_ANGLEUNC   0x3FFE
 
#define MAGNETICROTARY4_REG_ANGLECOM   0x3FFF
 
#define MAGNETICROTARY4_REG_ZPOSM   0x0016
 Magnetic Rotary 4 non-volatile registers list.
 
#define MAGNETICROTARY4_REG_ZPOSL   0x0017
 
#define MAGNETICROTARY4_REG_SETTINGS1   0x0018
 
#define MAGNETICROTARY4_REG_SETTINGS2   0x0019
 
#define MAGNETICROTARY4_DATA_RESOLUTION   0x3FFF
 Magnetic Rotary 4 angle calculation values.
 
#define MAGNETICROTARY4_FULL_CIRCLE   360
 
#define MAGNETICROTARY4_ODD_PARITY   0x01
 Magnetic Rotary 4 ODD parity flag.
 
#define MAGNETICROTARY4_DIRECTION_CW   0
 Magnetic Rotary 4 rotation direction values.
 
#define MAGNETICROTARY4_DIRECTION_CCW   1
 
#define MAGNETICROTARY4_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define MAGNETICROTARY4_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define MAGNETICROTARY4_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  magneticrotary4_return_value_t { MAGNETICROTARY4_OK = 0 , MAGNETICROTARY4_ERROR = -1 }
 Magnetic Rotary 4 Click return value data. More...
 

Functions

void magneticrotary4_cfg_setup (magneticrotary4_cfg_t *cfg)
 Magnetic Rotary 4 configuration object setup function.
 
err_t magneticrotary4_init (magneticrotary4_t *ctx, magneticrotary4_cfg_t *cfg)
 Magnetic Rotary 4 initialization function.
 
err_t magneticrotary4_write_register (magneticrotary4_t *ctx, uint16_t reg, uint16_t data_in)
 Magnetic Rotary 4 write register function.
 
err_t magneticrotary4_read_register (magneticrotary4_t *ctx, uint16_t reg, uint16_t *data_out)
 Magnetic Rotary 4 read register function.
 
err_t magneticrotary4_get_angle (magneticrotary4_t *ctx, float *angle)
 Magnetic Rotary 4 get angle function.
 
err_t magneticrotary4_calibrate_zero_position (magneticrotary4_t *ctx)
 Magnetic Rotary 4 calibrate zero position function.
 
err_t magneticrotary4_set_rotation_direction (magneticrotary4_t *ctx, uint8_t direction)
 Magnetic Rotary 4 set rotation direction function.
 

Detailed Description

This file contains API for Magnetic Rotary 4 Click Driver.

Enumeration Type Documentation

◆ magneticrotary4_return_value_t

Magnetic Rotary 4 Click return value data.

Predefined enum values for driver return values.

Enumerator
MAGNETICROTARY4_OK 
MAGNETICROTARY4_ERROR