angle6 2.0.0.0
angle6.h File Reference

This file contains API for Angle 6 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  angle6_t
 Angle 6 Click context object. More...
 
struct  angle6_cfg_t
 Angle 6 Click configuration object. More...
 

Macros

#define ANGLE6_REG_ZERO_SETTING_LSB   0x00
 Angle 6 Register List.
 
#define ANGLE6_REG_ZERO_SETTING_MSB   0x01
 
#define ANGLE6_REG_BIAS_CURRENT_TIMING   0x02
 
#define ANGLE6_REG_ENABLE_TRIMMING   0x03
 
#define ANGLE6_REG_ABZ_SETTING_LSB   0x04
 
#define ANGLE6_REG_ABZ_SETTING_MSB   0x05
 
#define ANGLE6_REG_MAGNETIC_FIELD_CONFIG   0x06
 
#define ANGLE6_REG_ROTATION_DIRECTION   0x09
 
#define ANGLE6_REG_ALARM_FLAGS   0x1B
 
#define ANGLE6_CMD_READ_ANGLE   0x00
 Angle 6 Command List.
 
#define ANGLE6_CMD_READ_REGISTER   0x40
 
#define ANGLE6_CMD_WRITE_REGISTER   0x80
 
#define ANGLE6_ROTATION_DIRECTION_CW   0x00
 Angle 6 Rotation Direction register setting.
 
#define ANGLE6_ROTATION_DIRECTION_CCW   0x80
 
#define ANGLE6_RESOLUTION   0xFFFF
 Angle 6 Angle calculation values.
 
#define ANGLE6_FULL_CIRCLE   360.0
 
#define ANGLE6_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define ANGLE6_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define ANGLE6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  angle6_return_value_t { ANGLE6_OK = 0 , ANGLE6_ERROR = -1 }
 Angle 6 Click return value data. More...
 

Functions

void angle6_cfg_setup (angle6_cfg_t *cfg)
 Angle 6 configuration object setup function.
 
err_t angle6_init (angle6_t *ctx, angle6_cfg_t *cfg)
 Angle 6 initialization function.
 
err_t angle6_default_cfg (angle6_t *ctx)
 Angle 6 default configuration function.
 
err_t angle6_write_register (angle6_t *ctx, uint8_t reg, uint8_t data_in)
 Angle 6 write register function.
 
err_t angle6_read_register (angle6_t *ctx, uint8_t reg, uint8_t *data_out)
 Angle 6 read register function.
 
err_t angle6_read_angle (angle6_t *ctx, float *angle)
 Angle 6 read angle function.
 
uint8_t angle6_get_pwm_pin (angle6_t *ctx)
 Angle 6 get pwm pin function.
 
uint8_t angle6_get_mgh_pin (angle6_t *ctx)
 Angle 6 get mgh pin function.
 
uint8_t angle6_get_mgl_pin (angle6_t *ctx)
 Angle 6 get mgl pin function.
 

Detailed Description

This file contains API for Angle 6 Click Driver.

Enumeration Type Documentation

◆ angle6_return_value_t

Angle 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
ANGLE6_OK 
ANGLE6_ERROR