angle7 2.0.0.0
angle7.h File Reference

This file contains API for Angle 7 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_analog_in.h"

Go to the source code of this file.

Data Structures

struct  angle7_t
 Angle 7 Click context object. More...
 
struct  angle7_cfg_t
 Angle 7 Click configuration object. More...
 

Macros

#define ANGLE7_REG_ZMCO   0x00
 Angle 7 register list.
 
#define ANGLE7_REG_ZPOS_MSB   0x01
 
#define ANGLE7_REG_ZPOS_LSB   0x02
 
#define ANGLE7_REG_MPOS_MSB   0x03
 
#define ANGLE7_REG_MPOS_LSB   0x04
 
#define ANGLE7_REG_MANG_MSB   0x05
 
#define ANGLE7_REG_MANG_LSB   0x06
 
#define ANGLE7_REG_CONF_MSB   0x07
 
#define ANGLE7_REG_CONF_LSB   0x08
 
#define ANGLE7_REG_STATUS   0x0B
 
#define ANGLE7_REG_RAW_ANGLE_MSB   0x0C
 
#define ANGLE7_REG_RAW_ANGLE_LSB   0x0D
 
#define ANGLE7_REG_ANGLE_MSB   0x0E
 
#define ANGLE7_REG_ANGLE_LSB   0x0F
 
#define ANGLE7_REG_AGC   0x1A
 
#define ANGLE7_REG_MAGNITUDE_MSB   0x1B
 
#define ANGLE7_REG_MAGNITUDE_LSB   0x1C
 
#define ANGLE7_REG_BURN   0xFF
 
#define ANGLE7_CONF_WATCHDOG_OFF   0x0000
 Angle 7 CONF register settings.
 
#define ANGLE7_CONF_WATCHDOG_ON   0x2000
 
#define ANGLE7_CONF_WATCHDOG_BIT_MASK   0x2000
 
#define ANGLE7_CONF_FTH_SLOW   0x0000
 
#define ANGLE7_CONF_FTH_6LSB   0x0400
 
#define ANGLE7_CONF_FTH_7LSB   0x0800
 
#define ANGLE7_CONF_FTH_9LSB   0x0C00
 
#define ANGLE7_CONF_FTH_18LSB   0x1000
 
#define ANGLE7_CONF_FTH_21LSB   0x1400
 
#define ANGLE7_CONF_FTH_24LSB   0x1800
 
#define ANGLE7_CONF_FTH_10LSB   0x1C00
 
#define ANGLE7_CONF_FTH_BIT_MASK   0x1C00
 
#define ANGLE7_CONF_SF_16X   0x0000
 
#define ANGLE7_CONF_SF_8X   0x0100
 
#define ANGLE7_CONF_SF_4X   0x0200
 
#define ANGLE7_CONF_SF_2X   0x0300
 
#define ANGLE7_CONF_SF_BIT_MASK   0x0300
 
#define ANGLE7_CONF_PWMF_115HZ   0x0000
 
#define ANGLE7_CONF_PWMF_230HZ   0x0040
 
#define ANGLE7_CONF_PWMF_460HZ   0x0080
 
#define ANGLE7_CONF_PWMF_920HZ   0x00C0
 
#define ANGLE7_CONF_PWMF_BIT_MASK   0x00C0
 
#define ANGLE7_CONF_OUTS_ANALOG_FULL   0x0000
 
#define ANGLE7_CONF_OUTS_ANALOG_REDUCED   0x0010
 
#define ANGLE7_CONF_OUTS_PWM   0x0020
 
#define ANGLE7_CONF_OUTS_BIT_MASK   0x0030
 
#define ANGLE7_CONF_HYST_OFF   0x0000
 
#define ANGLE7_CONF_HYST_1LSB   0x0004
 
#define ANGLE7_CONF_HYST_2LSB   0x0008
 
#define ANGLE7_CONF_HYST_3LSB   0x000C
 
#define ANGLE7_CONF_HYST_BIT_MASK   0x000C
 
#define ANGLE7_CONF_PM_NOM   0x0000
 
#define ANGLE7_CONF_PM_LPM1   0x0001
 
#define ANGLE7_CONF_PM_LPM2   0x0002
 
#define ANGLE7_CONF_PM_LPM3   0x0003
 
#define ANGLE7_CONF_PM_BIT_MASK   0x0003
 
#define ANGLE7_STATUS_MAGNET_DETECTED   0x20
 Angle 7 STATUS register settings.
 
#define ANGLE7_STATUS_MAGNET_TOO_WEAK   0x10
 
#define ANGLE7_STATUS_MAGNET_TOO_STRONG   0x08
 
#define ANGLE7_BURN_ANGLE   0x80
 Angle 7 BURN register settings.
 
#define ANGLE7_BURN_SETTING   0x40
 
#define ANGLE7_RESOLUTION   0x0FFF
 Angle 7 Angle calculation values.
 
#define ANGLE7_FULL_CIRCLE   360.0
 
#define ANGLE7_ZERO_POSITION   0.0
 
#define ANGLE7_DEVICE_ADDRESS   0x36
 Angle 7 device address setting.
 
#define ANGLE7_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  angle7_return_value_t { ANGLE7_OK = 0 , ANGLE7_ERROR = -1 }
 Angle 7 Click return value data. More...
 

Functions

void angle7_cfg_setup (angle7_cfg_t *cfg)
 Angle 7 configuration object setup function.
 
err_t angle7_init (angle7_t *ctx, angle7_cfg_t *cfg)
 Angle 7 initialization function.
 
err_t angle7_default_cfg (angle7_t *ctx)
 Angle 7 default configuration function.
 
err_t angle7_generic_write (angle7_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Angle 7 I2C writing function.
 
err_t angle7_generic_read (angle7_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Angle 7 I2C reading function.
 
err_t angle7_write_two_bytes (angle7_t *ctx, uint8_t reg, uint16_t data_in)
 Angle 7 write two bytes function.
 
err_t angle7_read_two_bytes (angle7_t *ctx, uint8_t reg, uint16_t *data_out)
 Angle 7 read two bytes function.
 
err_t angle7_read_an_pin_value (angle7_t *ctx, uint16_t *data_out)
 Angle 7 read AN pin value function.
 
err_t angle7_read_an_pin_voltage (angle7_t *ctx, float *data_out)
 Angle 7 read AN pin voltage level function.
 
uint8_t angle7_get_int_pin (angle7_t *ctx)
 Angle 7 get int pin function.
 
void angle7_enable_device (angle7_t *ctx)
 Angle 7 enable device function.
 
void angle7_disable_device (angle7_t *ctx)
 Angle 7 disable device function.
 
err_t angle7_set_start_position (angle7_t *ctx, float angle)
 Angle 7 set start position function.
 
err_t angle7_get_start_position (angle7_t *ctx, float *angle)
 Angle 7 get start position function.
 
err_t angle7_set_stop_position (angle7_t *ctx, float angle)
 Angle 7 set stop position function.
 
err_t angle7_get_stop_position (angle7_t *ctx, float *angle)
 Angle 7 get stop position function.
 
err_t angle7_get_raw_angle (angle7_t *ctx, float *angle)
 Angle 7 get raw angle function.
 
err_t angle7_get_angle (angle7_t *ctx, float *angle)
 Angle 7 get angle function.
 
err_t angle7_get_status (angle7_t *ctx, uint8_t *status)
 Angle 7 get status function.
 
err_t angle7_get_agc (angle7_t *ctx, uint8_t *agc)
 Angle 7 get agc function.
 
err_t angle7_get_magnitude (angle7_t *ctx, uint16_t *magnitude)
 Angle 7 get magnitude function.
 

Detailed Description

This file contains API for Angle 7 Click Driver.

Enumeration Type Documentation

◆ angle7_return_value_t

Angle 7 Click return value data.

Predefined enum values for driver return values.

Enumerator
ANGLE7_OK 
ANGLE7_ERROR