vumeter 2.0.0.0
vumeter.h File Reference

This file contains API for VU Meter Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"
#include "drv_analog_in.h"

Go to the source code of this file.

Data Structures

struct  vumeter_t
 VU Meter Click context object. More...
 
struct  vumeter_cfg_t
 VU Meter Click configuration object. More...
 

Macros

#define VUMETER_GAIN_LEVEL_MAX   0xFF
 VU Meter gain level values.
 
#define VUMETER_GAIN_LEVEL_MID   0x80
 
#define VUMETER_GAIN_LEVEL_MIN   0x00
 
#define VUMETER_DBU_VREF   0.7746
 VU Meter VU level calculation constants.
 
#define VUMETER_DBU_TO_VU   4.0
 
#define VUMETER_RMS_FOR_20VU   0.123
 
#define VUMETER_MIN_VU   -20.0
 
#define VUMETER_VCC_3V3   3.3
 
#define VUMETER_VCC_5V   5.0
 
#define VUMETER_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define VUMETER_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define VUMETER_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  vumeter_return_value_t { VUMETER_OK = 0 , VUMETER_ERROR = -1 }
 VU Meter Click return value data. More...
 

Functions

void vumeter_cfg_setup (vumeter_cfg_t *cfg)
 VU Meter configuration object setup function.
 
err_t vumeter_init (vumeter_t *ctx, vumeter_cfg_t *cfg)
 VU Meter initialization function.
 
err_t vumeter_read_an_pin_value (vumeter_t *ctx, uint16_t *data_out)
 VU Meter read AN pin value function.
 
err_t vumeter_read_an_pin_voltage (vumeter_t *ctx, float *data_out)
 VU Meter read AN pin voltage level function.
 
err_t vumeter_set_gain_level (vumeter_t *ctx, uint8_t gain_lvl)
 VU Meter set gain level function.
 
float vumeter_calculate_vu_level (vumeter_t *ctx, uint16_t sample_rate_ms)
 VU Meter calculate VU level function.
 

Detailed Description

This file contains API for VU Meter Click Driver.

Enumeration Type Documentation

◆ vumeter_return_value_t

VU Meter Click return value data.

Predefined enum values for driver return values.

Enumerator
VUMETER_OK 
VUMETER_ERROR