compass6 2.0.0.0
compass6.h File Reference

This file contains API for Compass 6 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  compass6_t
 Compass 6 Click context object. More...
 
struct  compass6_cfg_t
 Compass 6 Click configuration object. More...
 
struct  compass6_axes_t
 Compass 6 Click axes data. More...
 

Macros

#define COMPASS6_REG_SELFTEST_RSP   0x0C
 Compass 6 description register.
 
#define COMPASS6_REG_INFO_VERSION   0x0D
 
#define COMPASS6_REG_INFO_ALPS   0x0E
 
#define COMPASS6_REG_WHO_I_AM   0x0F
 
#define COMPASS6_REG_OUTPUT_X_LSB   0x10
 
#define COMPASS6_REG_OUTPUT_X_MSB   0x11
 
#define COMPASS6_REG_OUTPUT_Y_LSB   0x12
 
#define COMPASS6_REG_OUTPUT_Y_MSB   0x13
 
#define COMPASS6_REG_OUTPUT_Z_LSB   0x14
 
#define COMPASS6_REG_OUTPUT_Z_MSB   0x15
 
#define COMPASS6_REG_STATUS   0x18
 
#define COMPASS6_REG_FIFO_PTR_STATUS   0x19
 
#define COMPASS6_REG_CTRL1   0x1B
 
#define COMPASS6_REG_CTRL2   0x1C
 
#define COMPASS6_REG_CTRL3   0x1D
 
#define COMPASS6_REG_CTRL4   0x1E
 
#define COMPASS6_REG_OFFSET_X_LSB   0x20
 
#define COMPASS6_REG_OFFSET_X_MSB   0x21
 
#define COMPASS6_REG_OFFSET_Y_LSB   0x22
 
#define COMPASS6_REG_OFFSET_Y_MSB   0x23
 
#define COMPASS6_REG_OFFSET_Z_LSB   0x24
 
#define COMPASS6_REG_OFFSET_Z_MSB   0x25
 
#define COMPASS6_REG_THR_L   0x26
 
#define COMPASS6_REG_THR_H   0x27
 
#define COMPASS6_REG_TEMPERATURE_VAL   0x31
 
#define COMPASS6_WHO_AM_I   0x49
 Compass 6 identification value.
 
#define COMPASS6_VERSION   0x11
 
#define COMPASS6_ALPS   0x15
 
#define COMPASS6_SET_DEV_ADDR   0x0C
 Compass 6 device address setting.
 
#define COMPASS6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  compass6_return_value_t { COMPASS6_OK = 0 , COMPASS6_ERROR = -1 }
 Compass 6 Click return value data. More...
 

Functions

void compass6_cfg_setup (compass6_cfg_t *cfg)
 Compass 6 configuration object setup function.
 
err_t compass6_init (compass6_t *ctx, compass6_cfg_t *cfg)
 Compass 6 initialization function.
 
err_t compass6_default_cfg (compass6_t *ctx)
 Compass 6 default configuration function.
 
err_t compass6_generic_write (compass6_t *ctx, uint8_t reg, uint8_t tx_data)
 Compass 6 I2C writing function.
 
err_t compass6_generic_read (compass6_t *ctx, uint8_t reg, uint8_t *rx_data)
 Compass 6 I2C reading function.
 
uint8_t compass6_data_ready (compass6_t *ctx)
 Get data ready pin state.
 
err_t compass6_get_axes_data (compass6_t *ctx, compass6_axes_t *axes_data)
 Magnetic axes data reading.
 

Detailed Description

This file contains API for Compass 6 Click Driver.

Enumeration Type Documentation

◆ compass6_return_value_t

Compass 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
COMPASS6_OK 
COMPASS6_ERROR