voltmeter  2.0.0.0
Functions
Public function

Functions

void voltmeter_cfg_setup (voltmeter_cfg_t *cfg)
 Config Object Initialization function. More...
 
VOLTMETER_RETVAL voltmeter_init (voltmeter_t *ctx, voltmeter_cfg_t *cfg)
 Initialization function. More...
 
void voltmeter_write_data (voltmeter_t *ctx, uint16_t write_data)
 Generic write the byte of the data function. More...
 
uint8_t voltmeter_read_byte (voltmeter_t *ctx)
 Generic read the byte of the data function. More...
 
uint16_t voltmeter_read_data (voltmeter_t *ctx)
 Generic reading 16-bit data function. More...
 
void voltmeter_calibration (voltmeter_t *ctx)
 Calibration reading function. More...
 
float voltmeter_get_voltage (voltmeter_t *ctx, float coefficient)
 Voltage reading function. More...
 

Detailed Description

Function Documentation

◆ voltmeter_calibration()

void voltmeter_calibration ( voltmeter_t ctx)

Calibration reading function.

Parameters
ctxClick object.

Function reading calibration parameter from the register of MCP3201 chip on Voltmeter click board.

◆ voltmeter_cfg_setup()

void voltmeter_cfg_setup ( voltmeter_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ voltmeter_get_voltage()

float voltmeter_get_voltage ( voltmeter_t ctx,
float  coefficient 
)

Voltage reading function.

Parameters
ctxClick object.
coefficientValue depends on the selected development system.

Generic SPI transfer, for sending and receiving packages

◆ voltmeter_init()

VOLTMETER_RETVAL voltmeter_init ( voltmeter_t ctx,
voltmeter_cfg_t cfg 
)

Initialization function.

Parameters
voltmeterClick object.
cfgClick configuration structure.

This function initializes all necessary pins and peripherals used for this click.

◆ voltmeter_read_byte()

uint8_t voltmeter_read_byte ( voltmeter_t ctx)

Generic read the byte of the data function.

Parameters
ctxClick object.

Function read the byte of the data from the register of MCP3201 chip on Voltmeter click board.

◆ voltmeter_read_data()

uint16_t voltmeter_read_data ( voltmeter_t ctx)

Generic reading 16-bit data function.

Parameters
ctxClick object.
blockTransfer block structure.

Function reading 16-bit data from the register of MCP3201 chip on Voltmeter click board.

◆ voltmeter_write_data()

void voltmeter_write_data ( voltmeter_t ctx,
uint16_t  write_data 
)

Generic write the byte of the data function.

Parameters
ctxClick object.
write_dataByte of data to write.

Function write the 8-bit of data to the register of MCP3201 chip on Voltmeter click board.