vreg 2.0.0.0
Public function

Functions

void vreg_cfg_setup (vreg_cfg_t *cfg)
 Config Object Initialization function.
 
VREG_RETVAL vreg_init (vreg_t *ctx, vreg_cfg_t *cfg)
 Initialization function.
 
void vreg_generic_transfer (vreg_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint16_t vreg_get_adc (vreg_t *ctx, uint8_t channel)
 Get ADC value function.
 
void vreg_set_out_voltage (vreg_t *ctx, uint16_t value_dac)
 Set output voltage function.
 
void vreg_set_output_voltage_procentage (vreg_t *ctx, uint8_t value_dac_pct)
 Set output voltage procentage function.
 
void vreg_start_measuring (vreg_t *ctx)
 Start the measuring function.
 
void vreg_stop_measuring (vreg_t *ctx)
 Stop the measuring function.
 

Detailed Description

Function Documentation

◆ vreg_cfg_setup()

void vreg_cfg_setup ( vreg_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ vreg_generic_transfer()

void vreg_generic_transfer ( vreg_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ vreg_get_adc()

uint16_t vreg_get_adc ( vreg_t * ctx,
uint8_t channel )

Get ADC value function.

Parameters
ctxClick object.
channeldesignated channel
Returns
12-bit ADC value reading from designated channel

@description This function reads 2-bit ADC value from designated channel of MCP3204 4-Channel 12-Bit A/D Converters on VREG click board.

◆ vreg_init()

VREG_RETVAL vreg_init ( vreg_t * ctx,
vreg_cfg_t * cfg )

Initialization function.

Parameters
vregClick object.
cfgClick configuration structure.

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

◆ vreg_set_out_voltage()

void vreg_set_out_voltage ( vreg_t * ctx,
uint16_t value_dac )

Set output voltage function.

Parameters
ctxClick object.
value_dac12-bit DAC value

@description This function set DAC increments 12-bit data ( 0..4095 ) --> output voltage ( 0..Vref [mV] ) of 12-Bit Voltage Output Digital-to-Analog Converter on VREG click board.

◆ vreg_set_output_voltage_procentage()

void vreg_set_output_voltage_procentage ( vreg_t * ctx,
uint8_t value_dac_pct )

Set output voltage procentage function.

Parameters
ctxClick object.
value_dac_pct8-bit data procentage value ( 0..100 [%] )

@description This function set DAC increments procentage ( 0..100 [%] ) --> output voltage ( 0..Vref [mV] ) of 12-Bit Voltage Output Digital-to-Analog Converter on VREG click board.

◆ vreg_start_measuring()

void vreg_start_measuring ( vreg_t * ctx)

Start the measuring function.

@description This function start the measuring by set state of PWM pin of VREG click board.

◆ vreg_stop_measuring()

void vreg_stop_measuring ( vreg_t * ctx)

Stop the measuring function.

Parameters
ctxClick object.

@description This function Function stop the measuring by clear state of PWM pin of VREG click board.