angle3 2.0.0.0
angle3.h File Reference

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

Macros

#define ANGLE3_OK   0
 
#define ANGLE3_ERROR   -1
 
#define ANGLE3_REG_ANG   0x00
 
#define ANGLE3_REG_MAG   0x01
 
#define ANGLE3_REG_CHMD   0x02
 
#define ANGLE3_REG_ERRMON   0x03
 
#define ANGLE3_REG_ZP   0x06
 
#define ANGLE3_REG_RDABZ   0x07
 
#define ANGLE3_REG_MLK   0x08
 
#define ANGLE3_REG_EBDIS   0x09
 
#define ANGLE3_REG_UVW   0x0A
 
#define ANGLE3_EEPROM_ID1   0x04
 
#define ANGLE3_EEPROM_ID2   0x05
 
#define ANGLE3_EEPROM_ZP   0x06
 
#define ANGLE3_EEPROM_RDABZ   0x07
 
#define ANGLE3_EEPROM_MLK   0x08
 
#define ANGLE3_EEPROM_EBDIS   0x09
 
#define ANGLE3_EEPROM_UVW   0x0A
 
#define ANGLE3_OPCODE_LOCK_EEPROM   0x00
 
#define ANGLE3_OPCODE_WRITE_EEPROM   0x01
 
#define ANGLE3_OPCODE_READ_EEPROM   0x02
 
#define ANGLE3_OPCODE_WRITE_REG   0x03
 
#define ANGLE3_OPCODE_READ_REG   0x04
 
#define ANGLE3_OPCODE_CHANGE_MODE   0x05
 
#define ANGLE3_OPCODE_ANGLE_DATA_RENEW   0x08
 
#define ANGLE3_OPCODE_READ_ANGLE   0x09
 
#define ANGLE3_NORMAL_MODE   0x0000
 
#define ANGLE3_USER_MODE   0x050F
 
#define ANGLE3_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define ANGLE3_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define ANGLE3_MAP_MIKROBUS(cfg, mikrobus)
 

Functions

void angle3_cfg_setup (angle3_cfg_t *cfg)
 Config Object Initialization function.
 
void angle3_default_cfg (angle3_t *ctx)
 Default Config Object Initialization function.
 
err_t angle3_init (angle3_t *ctx, angle3_cfg_t *cfg)
 Initialization function.
 
void angle3_write_data (angle3_t *ctx, uint8_t opcode, uint8_t reg, uint16_t write_data)
 Generic write function.
 
uint16_t angle3_read_data (angle3_t *ctx, uint8_t opcode, uint8_t reg)
 Generic read function.
 
void angle3_write_eeprom (angle3_t *ctx, uint8_t reg_addr, uint16_t write_data)
 Write EEPROM function.
 
uint16_t angle3_read_eeprom (angle3_t *ctx, uint8_t reg_addr)
 Read EEPROM function.
 
void angle3_lock_eeprom (angle3_t *ctx)
 EEPROM lock function.
 
void angle3_write_register (angle3_t *ctx, uint8_t reg_addr, uint16_t write_data)
 Write register function.
 
uint16_t angle3_read_register (angle3_t *ctx, uint8_t reg_addr)
 Read register function.
 
void angle3_set_mode (angle3_t *ctx, uint16_t set_mode)
 Set mode function.
 
void angle3_set_normal_mode (angle3_t *ctx)
 Set normal mode function.
 
void angle3_set_user_mode (angle3_t *ctx)
 Set user mode function.
 
uint16_t angle3_read_angle_data (angle3_t *ctx)
 Read angle data function.
 
float angle3_calculate_degrees (angle3_t *ctx, uint16_t angle)
 Degrees Calculation function.
 
uint8_t angle3_read_error (angle3_t *ctx)
 Read state of Error INT Pin.
 

Detailed Description

This file contains API for Angle 3 Click driver.