vibrasense2 2.0.0.0
vibrasense2.h File Reference

This file contains API for Vibra Sense 2 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  vibrasense2_t
 Vibra Sense 2 Click context object. More...
 
struct  vibrasense2_cfg_t
 Vibra Sense 2 Click configuration object. More...
 

Macros

#define VIBRASENSE2_RESOLUTION   4096
 Vibra Sense 2 description setting.
 
#define VIBRASENSE2_12_BIT_DATA   0x0FFF
 
#define VIBRASENSE2_VIBRA_LVL_ERROR   -1
 Vibra Sense 2 Vibration levels.
 
#define VIBRASENSE2_VIBRA_LVL_0   0
 
#define VIBRASENSE2_VIBRA_LVL_1   1
 
#define VIBRASENSE2_VIBRA_LVL_2   2
 
#define VIBRASENSE2_VIBRA_LVL_3   3
 
#define VIBRASENSE2_VIBRA_LVL_4   4
 
#define VIBRASENSE2_VIBRA_LVL_5   5
 
#define VIBRASENSE2_VIBRA_LVL_6   6
 
#define VIBRASENSE2_SET_DEV_ADDR   0x4D
 Vibra Sense 2 device address setting.
 
#define VIBRASENSE2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  vibrasense2_return_value_t { VIBRASENSE2_OK = 0 , VIBRASENSE2_ERROR = -1 }
 Vibra Sense 2 Click return value data. More...
 

Functions

void vibrasense2_cfg_setup (vibrasense2_cfg_t *cfg)
 Vibra Sense 2 configuration object setup function.
 
err_t vibrasense2_init (vibrasense2_t *ctx, vibrasense2_cfg_t *cfg)
 Vibra Sense 2 initialization function.
 
err_t vibrasense2_generic_write (vibrasense2_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Vibra Sense 2 I2C writing function.
 
err_t vibrasense2_generic_read (vibrasense2_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Vibra Sense 2 I2C reading function.
 
uint16_t vibrasense2_read_data (vibrasense2_t *ctx)
 Read data function.
 
uint16_t vibrasense2_read_voltage (vibrasense2_t *ctx, uint16_t v_ref)
 Read voltage function.
 
int8_t vibrasense2_vibration_level (vibrasense2_t *ctx)
 Get Vibration Level function.
 

Detailed Description

This file contains API for Vibra Sense 2 Click Driver.

Enumeration Type Documentation

◆ vibrasense2_return_value_t

Vibra Sense 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
VIBRASENSE2_OK 
VIBRASENSE2_ERROR