magneticrotary 2.0.0.0
magneticrotary.h File Reference

This file contains API for Magnetic Rotary Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  magneticrotary_t
 Click ctx object definition. More...
 
struct  magneticrotary_cfg_t
 Click configuration structure definition. More...
 

Macros

#define T_MAGNROTARY_P   const uint8_t*
 
#define MAGNETICROTARY_MAP_MIKROBUS(cfg, mikrobus)
 
#define MAGNETICROTARY_RETVAL   uint8_t
 
#define MAGNETICROTARY_OK   0x00
 
#define MAGNETICROTARY_INIT_ERROR   0xFF
 
#define MAGNROTARY_CHA_POS_GND_NEG   0x80
 
#define MAGNROTARY_CHB_POS_GND_NEG   0xC0
 
#define MAGNROTARY_CHA_POS_CHB_NEG   0x00
 
#define MAGNROTARY_CHB_POS_CHA_NEG   0x40
 
#define MAGNROTARY_MSB_LSB_ORDER   0x00
 
#define MAGNROTARY_MSB_ZEROS_ORDER   0x20
 
#define MAGNROTARY_VDD_3V3   3298
 
#define MAGNROTARY_VDD_5V   4960
 
#define MAGNROTARY_START_BYTE   0x01
 
#define MAGNROTARY_DUMMY_BYTE   0x00
 
#define MAGNROTARY_CMD_MASK   0xE0
 
#define MAGNROTARY_ADC_RESOLUTION   4096
 
#define MAGNROTARY_SIGN_BIT   0x0800
 

Functions

void magneticrotary_cfg_setup (magneticrotary_cfg_t *cfg)
 Config Object Initialization function.
 
MAGNETICROTARY_RETVAL magneticrotary_init (magneticrotary_t *ctx, magneticrotary_cfg_t *cfg)
 Initialization function.
 
void magneticrotary_generic_transfer (magneticrotary_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint16_t magnrotary_out_volt_adc (magneticrotary_t *ctx, uint8_t cmd_byte, uint16_t pwr_volt)
 ADC Output Voltage Get function.
 
uint16_t magnrotary_read_adc (magneticrotary_t *ctx, uint8_t cmnd_byte)
 ADC Result Read function.
 
double magnrotary_get_field_angle (magneticrotary_t *ctx, uint8_t cmd_byte)
 Magnetic Field Angle Get function.
 

Detailed Description

This file contains API for Magnetic Rotary Click driver.