c3dhall7 2.0.0.0
c3dhall7.h File Reference

This file contains API for 3D Hall 7 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  c3dhall7_s
 Click ctx object definition. More...
 
struct  c3dhall7_cfg_t
 Click configuration structure definition. More...
 
struct  c3dhall7_status_t
 
struct  c3dhall7_axis_t
 
struct  c3dhall7_dev_info_t
 
struct  c3dhall7_int_state_t
 

Macros

#define C3DHALL7_MAP_MIKROBUS(cfg, mikrobus)
 
#define C3DHALL7_MASTER_I2C   0
 
#define C3DHALL7_MASTER_SPI   1
 
#define C3DHALL7_RETVAL   uint8_t
 
#define C3DHALL7_OK   0x00
 
#define C3DHALL7_INIT_ERROR   0xFF
 
#define C3DHALL7_REG_DEVICE_ID   0x00
 
#define C3DHALL7_REG_STATUS   0x10
 
#define C3DHALL7_REG_ST_AXIS_X   0x11
 
#define C3DHALL7_REG_ST_AXIS_Y   0x12
 
#define C3DHALL7_REG_ST_AXIS_X_Y   0x13
 
#define C3DHALL7_REG_ST_AXIS_Z   0x14
 
#define C3DHALL7_REG_ST_AXIS_X_Z   0x15
 
#define C3DHALL7_REG_ST_AXIS_Y_Z   0x16
 
#define C3DHALL7_REG_ST_AXIS_X_Y_Z   0x17
 
#define C3DHALL7_REG_STATUS_UP8   0x18
 
#define C3DHALL7_REG_STUP8_AXIS_X   0x19
 
#define C3DHALL7_REG_STUP8_AXIS_Y   0x1A
 
#define C3DHALL7_REG_STUP8_AXIS_X_Y   0x1B
 
#define C3DHALL7_REG_ST8UP_AXIS_Z   0x1C
 
#define C3DHALL7_REG_STUP8_AXIS_X_Z   0x1D
 
#define C3DHALL7_REG_STUP8_AXIS_Y_Z   0x1E
 
#define C3DHALL7_REG_STUP8_AXIS_X_Y_Z   0x1F
 
#define C3DHALL7_REG_INTERRUPT_SETTINGS   0x20
 
#define C3DHALL7_REG_SENSOR_SETTINGS   0x21
 
#define C3DHALL7_REG_THRESHOLD_1_AXIS_X   0x22
 
#define C3DHALL7_REG_THRESHOLD_2_AXIS_X   0x23
 
#define C3DHALL7_REG_THRESHOLD_1_AXIS_Y   0x24
 
#define C3DHALL7_REG_THRESHOLD_2_AXIS_Y   0x25
 
#define C3DHALL7_REG_THRESHOLD_1_AXIS_Z   0x26
 
#define C3DHALL7_REG_THRESHOLD_2_AXIS_Z   0x27
 
#define C3DHALL7_REG_SOFTWARE_RESET   0x30
 
#define C3DHALL7_REG_I2C_DISABLE   0x31
 
#define C3DHALL7_INT_DRDY_ENBALE   0x0001
 
#define C3DHALL7_INT_DRDY_DISABLE   0x0000
 
#define C3DHALL7_INT_SW_X1_ENABLE   0x0002
 
#define C3DHALL7_INT_SW_X1_DISABLE   0x0000
 
#define C3DHALL7_INT_SW_X2_ENABLE   0x0004
 
#define C3DHALL7_INT_SW_X2_DISABLE   0x0000
 
#define C3DHALL7_INT_SW_Y1_ENABLE   0x0008
 
#define C3DHALL7_INT_SW_Y1_DISABLE   0x0000
 
#define C3DHALL7_INT_SW_Y2_ENABLE   0x0010
 
#define C3DHALL7_INT_SW_Y2_DISABLE   0x0000
 
#define C3DHALL7_INT_SW_Z1_ENABLE   0x0020
 
#define C3DHALL7_INT_SW_Z1_DISABLE   0x0000
 
#define C3DHALL7_INT_SW_Z2_ENABLE   0x0040
 
#define C3DHALL7_INT_SW_Z2_DISABLE   0x0000
 
#define C3DHALL7_INT_ERROR_X_Y_ENABLE   0x0080
 
#define C3DHALL7_INT_ERROR_X_Y_DISABLE   0x0000
 
#define C3DHALL7_INT_ERROR_ADC_ENABLE   0x0100
 
#define C3DHALL7_INT_ERROR_ADC_DISABLE   0x0000
 
#define C3DHALL7_INT_INTERRUPT_ENABLE   0x0200
 
#define C3DHALL7_INT_INTERRUPT_DISABLE   0x0000
 
#define C3DHALL7_INT_ODINT_ENABLE   0x0400
 
#define C3DHALL7_INT_ODINT_DISABLE   0x0000
 
#define C3DHALL7_CTRL_MODE_POWER_DOWN   0x0000
 
#define C3DHALL7_CTRL_MODE_SINGLE   0x0001
 
#define C3DHALL7_CTRL_MODE_CONTINUOUS_0p25Hz   0x0002
 
#define C3DHALL7_CTRL_MODE_CONTINUOUS_0p5Hz   0x0004
 
#define C3DHALL7_CTRL_MODE_CONTINUOUS_1Hz   0x0006
 
#define C3DHALL7_CTRL_MODE_CONTINUOUS_10Hz   0x0008
 
#define C3DHALL7_CTRL_MODE_CONTINUOUS_20Hz   0x000A
 
#define C3DHALL7_CTRL_MODE_CONTINUOUS_50Hz   0x000C
 
#define C3DHALL7_CTRL_MODE_CONTINUOUS_100Hz   0x000E
 
#define C3DHALL7_CTRL_SDR_LOW_NOISE_DRIVE   0x0000
 
#define C3DHALL7_CTRL_SDR_LOW_POWER_DRIVE   0x0010
 
#define C3DHALL7_CTRL_SMR_HIGH_SENSITIVITY   0x0000
 
#define C3DHALL7_CTRL_SMR_WIDE_MEASUREMENT   0x0020
 
#define C3DHALL7_DEVICE_ID   0xC0
 
#define C3DHALL7_COMPANY_ID   0x48
 
#define C3DHALL7_DEVICE_SLAVE_ADDR_VCC   0x0D
 
#define C3DHALL7_DEVICE_SLAVE_ADDR_GND   0x0C
 

Typedefs

typedef uint8_t c3dhall7_select_t
 Communication type.
 
typedef void(* c3dhall7_master_io_t) (struct c3dhall7_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct c3dhall7_s c3dhall7_t
 Click ctx object definition.
 

Functions

void c3dhall7_cfg_setup (c3dhall7_cfg_t *cfg)
 Config Object Initialization function.
 
C3DHALL7_RETVAL c3dhall7_init (c3dhall7_t *ctx, c3dhall7_cfg_t *cfg)
 Initialization function.
 
void c3dhall7_default_cfg (c3dhall7_t *ctx)
 Click Default Configuration function.
 
void c3dhall7_generic_write (c3dhall7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void c3dhall7_generic_read (c3dhall7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void c3dhall7_device_reset (c3dhall7_t *ctx)
 Hardware device reset.
 
void c3dhall7_get_axis_data (c3dhall7_t *ctx, c3dhall7_axis_t *axis)
 Get Axis data function.
 
void c3dhall7_software_reset (c3dhall7_t *ctx)
 Software device reset.
 
void c3dhall7_configuration (c3dhall7_t *ctx, uint8_t reg, uint16_t data_in)
 Configuration function (for ctrl register).
 
void c3dhall7_device_info (c3dhall7_t *ctx, c3dhall7_dev_info_t *info)
 Device info function.
 
void c3dhall7_get_status (c3dhall7_t *ctx, c3dhall7_status_t *status)
 Measurement status function.
 
void c3dhall7_get_interrupt_state (c3dhall7_t *ctx, c3dhall7_int_state_t *state)
 Interrupt state function.
 

Detailed Description

This file contains API for 3D Hall 7 Click driver.