angle8 2.0.0.0
angle8.h File Reference

This file contains API for Angle 8 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  angle8_t
 Angle 8 Click context object. More...
 
struct  angle8_cfg_t
 Angle 8 Click configuration object. More...
 

Macros

#define ANGLE8_REG_ZERO_SETTING_LSB   0x00
 Angle 8 Register List.
 
#define ANGLE8_REG_ZERO_SETTING_MSB   0x01
 
#define ANGLE8_REG_BIAS_CURRENT_TIMING   0x02
 
#define ANGLE8_REG_ENABLE_TRIMMING   0x03
 
#define ANGLE8_REG_CYCLE_TIME_LSB   0x04
 
#define ANGLE8_REG_CYCLE_TIME_MSB   0x05
 
#define ANGLE8_REG_MAGNETIC_FIELD_CONFIG   0x06
 
#define ANGLE8_REG_ND_CONFIG   0x07
 
#define ANGLE8_REG_ASC_MODE_THRESHOLD   0x08
 
#define ANGLE8_REG_ROTATION_DIRECTION   0x09
 
#define ANGLE8_REG_ASC_MODE_REFERENCE   0x0A
 
#define ANGLE8_REG_ASC_MODE_CONFIG   0x0B
 
#define ANGLE8_REG_FILTER_WINDOW   0x0E
 
#define ANGLE8_REG_ERROR_FLAGS   0x1A
 
#define ANGLE8_REG_ALARM_FLAGS   0x1B
 
#define ANGLE8_CMD_READ_ANGLE   0x00
 Angle 8 Command List.
 
#define ANGLE8_CMD_READ_REGISTER   0x40
 
#define ANGLE8_CMD_WRITE_REGISTER   0x80
 
#define ANGLE8_CMD_STORE_SINGLE_REGISTER   0xE0
 
#define ANGLE8_CMD_STORE_ALL_REGISTERS   0xC0
 
#define ANGLE8_CMD_RESTORE_ALL_REGISTERS   0xA0
 
#define ANGLE8_CMD_CLEAR_ERROR_FLAGS   0x20
 
#define ANGLE8_ROTATION_DIRECTION_CW   0x00
 Angle 8 Rotation Direction register setting.
 
#define ANGLE8_ROTATION_DIRECTION_CCW   0x80
 
#define ANGLE8_RESOLUTION   0xFFFF
 Angle 8 Angle calculation values.
 
#define ANGLE8_FULL_CIRCLE   360.0
 
#define ANGLE8_CYCLE_TIME_MAX   6553.5
 Angle 8 Cycle time range values.
 
#define ANGLE8_CYCLE_TIME_100MS   100.0
 
#define ANGLE8_CYCLE_TIME_MIN   0.2
 
#define ANGLE8_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Angle 8 Rotation Direction register setting.
 
#define ANGLE8_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define ANGLE8_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  angle8_return_value_t { ANGLE8_OK = 0 , ANGLE8_ERROR = -1 }
 Angle 8 Click return value data. More...
 

Functions

void angle8_cfg_setup (angle8_cfg_t *cfg)
 Angle 8 configuration object setup function.
 
err_t angle8_init (angle8_t *ctx, angle8_cfg_t *cfg)
 Angle 8 initialization function.
 
err_t angle8_default_cfg (angle8_t *ctx)
 Angle 8 default configuration function.
 
err_t angle8_write_register (angle8_t *ctx, uint8_t reg, uint8_t data_in)
 Angle 8 write register function.
 
err_t angle8_read_register (angle8_t *ctx, uint8_t reg, uint8_t *data_out)
 Angle 8 read register function.
 
err_t angle8_read_angle (angle8_t *ctx, float *angle)
 Angle 8 read angle function.
 
err_t angle8_store_all_registers (angle8_t *ctx)
 Angle 8 store all registers function.
 
err_t angle8_store_single_register (angle8_t *ctx, uint8_t reg)
 Angle 8 store single register function.
 
err_t angle8_clear_error_flags (angle8_t *ctx)
 Angle 8 clear error flags function.
 
void angle8_enable_device (angle8_t *ctx)
 Angle 8 enable device function.
 
void angle8_disable_device (angle8_t *ctx)
 Angle 8 disable device function.
 
uint8_t angle8_get_nd_pin (angle8_t *ctx)
 Angle 8 get nd pin function.
 
uint8_t angle8_get_dv_pin (angle8_t *ctx)
 Angle 8 get dv pin function.
 
uint8_t angle8_get_mgl_pin (angle8_t *ctx)
 Angle 8 get mgl pin function.
 
err_t angle8_set_cycle_time (angle8_t *ctx, float time_ms)
 Angle 8 set cycle time function.
 

Detailed Description

This file contains API for Angle 8 Click Driver.

Enumeration Type Documentation

◆ angle8_return_value_t

Angle 8 Click return value data.

Predefined enum values for driver return values.

Enumerator
ANGLE8_OK 
ANGLE8_ERROR