angle2 2.0.0.0
angle2.h File Reference

This file contains API for Angle 2 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  angle2_t
 Click ctx object definition. More...
 
struct  angle2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define ANGLE2_MAP_MIKROBUS(cfg, mikrobus)
 
#define ANGLE2_RETVAL   uint8_t
 
#define ANGLE2_OK   0x00
 
#define ANGLE2_INIT_ERROR   0xFF
 
#define ANGLE2_WRITE_CMD   0x20
 
#define ANGLE2_READ_CMD   0x10
 
#define ANGLE2_DUMMY_BYTE   0x00
 
#define ANGLE2_REG_ADDR_MASK   0x0F
 
#define ANGLE2_BIAS_CURR_TRIMM_REG_3   0x03
 
#define ANGLE2_ZERO_POS_MSB_REG_4   0x04
 
#define ANGLE2_AXIS_TRIMM_AND_ZERO_LSB_REG_5   0x05
 
#define ANGLE2_FLASH_N_REG_9   0x09
 
#define ANGLE2_X_AXIS_TRIMM_EN   0x10
 
#define ANGLE2_Y_AXIS_TRIMM_EN   0x20
 
#define ANGLE2_AXIS_TRIMM_DIS   0x00
 
#define ANGLE2_FLASH_REG_3   0x08
 
#define ANGLE2_FLASH_REG_4   0x10
 
#define ANGLE2_FLASH_REG_5   0x20
 
#define ANGLE2_NO_FLASH   0x00
 
#define ANGLE2_DEG_LSB   0.08789
 
#define ANGLE2_MAX_SCALE_359_91_DEG   359.91211
 
#define ANGLE2_MIN_SCALE_0_DEG   0
 

Functions

void angle2_cfg_setup (angle2_cfg_t *cfg)
 Config Object Initialization function.
 
ANGLE2_RETVAL angle2_init (angle2_t *ctx, angle2_cfg_t *cfg)
 Initialization function.
 
void angle2_default_cfg (angle2_t *ctx)
 Click Default Configuration function.
 
void angle2_generic_transfer (angle2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
double angle2_write_reg (angle2_t *ctx, uint8_t addr, uint8_t input)
 Register write function.
 
double angle2_read_reg (angle2_t *ctx, uint8_t addr, uint8_t *output)
 Register read function.
 
double angle2_get_angle (angle2_t *ctx)
 Angle read function.
 
double angle2_get_angle_with_time_index (angle2_t *ctx, uint8_t *time_index)
 Angle with time index read function.
 
void angle2_set_zero_scale (angle2_t *ctx, double zero_deg)
 Set zero scale function.
 
void angle2_enable_trimming (angle2_t *ctx, uint8_t state)
 Enable trimming function.
 
void angle2_flash_reg (angle2_t *ctx, uint8_t reg_sel)
 Flash register function.
 

Detailed Description

This file contains API for Angle 2 Click driver.