angle5 2.0.0.0
angle5.h File Reference

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

Macros

#define ANGLE5_MAP_MIKROBUS(cfg, mikrobus)
 
#define ANGLE5_RETVAL   uint8_t
 
#define ANGLE5_OK   0x00
 
#define ANGLE5_INIT_ERROR   0xFF
 
#define ANGLE5_REG_ZERO_SETTING_LSB   0x00
 
#define ANGLE5_REG_ZERO_SETTING_MSB   0x01
 
#define ANGLE5_REG_BIAS_CURRENT_TRIMMING   0x02
 
#define ANGLE5_REG_ENABLE_TRIMMING_XY   0x03
 
#define ANGLE5_REG_CONFIG_1   0x04
 
#define ANGLE5_REG_CONFIG_2   0x05
 
#define ANGLE5_REG_MAGNETIC_FIELD_THR   0x06
 
#define ANGLE5_REG_NUMBER_OF_POLE_PAIRS   0x07
 
#define ANGLE5_REG_ROTATION_DIRECTION   0x09
 
#define ANGLE5_REG_MG_H_L   0x1B
 
#define ANGLE5_CMD_READ_ANGLE   0x00
 
#define ANGLE5_CMD_READ   0x40
 
#define ANGLE5_CMD_WRITE   0x80
 

Functions

void angle5_cfg_setup (angle5_cfg_t *cfg)
 Config Object Initialization function.
 
ANGLE5_RETVAL angle5_init (angle5_t *ctx, angle5_cfg_t *cfg)
 Initialization function.
 
void angle5_default_cfg (angle5_t *ctx)
 Click Default Configuration function.
 
void angle5_generic_transfer (angle5_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint16_t angle5_read_raw_angle (angle5_t *ctx)
 Reads Raw Angle data.
 
float angle5_read_angle_deg (angle5_t *ctx)
 Reads Angle data in deg.
 
uint16_t angle5_read_register (angle5_t *ctx, uint8_t reg_addr, uint8_t *rsp)
 Generic read function.
 
uint16_t angle5_write_register (angle5_t *ctx, uint8_t reg_addr, uint8_t tx_data, uint8_t *status)
 Generic write function.
 
float angle5_calc_rpm (float old_angle, float new_angle)
 Calculating angle data to RPM.
 
uint8_t angle5_get_mgh_pin_state (angle5_t *ctx)
 Gets MGH (PWM) pin state.
 
uint8_t angle5_get_mgl_pin_state (angle5_t *ctx)
 Gets MGL (INT) pin state.
 

Detailed Description

This file contains API for Angle 5 Click driver.