compass 2.0.0.0
compass.h File Reference

This file contains API for Compass 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  compass_t
 Click ctx object definition. More...
 
struct  compass_cfg_t
 Click configuration structure definition. More...
 

Macros

#define COMPASS_CTRL_REG1   0x20
 
#define COMPASS_CTRL_REG2   0x21
 
#define COMPASS_CTRL_REG3   0x22
 
#define COMPASS_CTRL_REG4   0x23
 
#define COMPASS_CTRL_REG5   0x24
 
#define COMPASS_CTRL_REG6   0x25
 
#define COMPASS_FIFO_CTRL_REG   0x2E
 
#define COMPASS_STATUS_REG   0x27
 
#define COMPASS_INT1_CFG   0x30
 
#define COMPASS_INT2_CFG   0x34
 
#define COMPASS_CRA_REG   0x00
 
#define COMPASS_CRB_REG   0x01
 
#define COMPASS_MR_REG   0x02
 
#define COMPASS_SR_REG   0x09
 
#define COMPASS_IRA_REG   0x0A
 
#define COMPASS_IRB_REG   0x0B
 
#define COMPASS_IRC_REG   0x0C
 
#define COMPASS_OUT_MAGNET_X_HIGH   0x03
 
#define COMPASS_OUT_MAGNET_X_LOW   0x04
 
#define COMPASS_OUT_MAGNET_Z_HIGH   0x05
 
#define COMPASS_OUT_MAGNET_Z_LOW   0x06
 
#define COMPASS_OUT_MAGNET_Y_HIGH   0x07
 
#define COMPASS_OUT_MAGNET_Y_LOW   0x08
 
#define COMPASS_TEMP_OUT_HIGH   0x31
 
#define COMPASS_TEMP_OUT_LOW   0x32
 
#define COMPASS_OUT_ACCEL_X_LOW   0x28
 
#define COMPASS_OUT_ACCEL_X_HIGH   0x29
 
#define COMPASS_OUT_ACCEL_Y_LOW   0x2A
 
#define COMPASS_OUT_ACCEL_Y_HIGH   0x2B
 
#define COMPASS_OUT_ACCEL_Z_LOW   0x2C
 
#define COMPASS_OUT_ACCEL_Z_HIGH   0x2D
 
#define COMPASS_MAP_MIKROBUS(cfg, mikrobus)
 
#define COMPASS_RETVAL   uint8_t
 
#define COMPASS_OK   0x00
 
#define COMPASS_INIT_ERROR   0xFF
 

Functions

void compass_cfg_setup (compass_cfg_t *cfg)
 Config Object Initialization function.
 
COMPASS_RETVAL compass_init (compass_t *ctx, compass_cfg_t *cfg)
 Initialization function.
 
void compass_accel_generic_write (compass_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic accel write function.
 
void compass_magnet_generic_write (compass_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic magnet write function.
 
void compass_accel_generic_read (compass_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic accel read function.
 
void compass_magnet_generic_read (compass_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic magnet read function.
 
void compass_default_config (compass_t *ctx)
 Default config function.
 
void compass_read_accel_axis (compass_t *ctx, int16_t *x_axis, int16_t *y_axis, int16_t *z_axis)
 Accel axes read function.
 
void compass_read_magnet_axis (compass_t *ctx, int16_t *x_axis, int16_t *y_axis, int16_t *z_axis)
 Magnet axes read function.
 

Detailed Description

This file contains API for Compass Click driver.