buck18  2.1.0.0
Modules | Functions
Buck 18 Click Driver

API for configuring and manipulating Buck 18 Click driver. More...

Modules

 Buck 18 Registers List
 List of registers of Buck 18 Click driver.
 
 Buck 18 Registers Settings
 Settings for registers of Buck 18 Click driver.
 
 Buck 18 MikroBUS Map
 MikroBUS pin mapping of Buck 18 Click driver.
 

Functions

void buck18_cfg_setup (buck18_cfg_t *cfg)
 Buck 18 configuration object setup function. More...
 
err_t buck18_init (buck18_t *ctx, buck18_cfg_t *cfg)
 Buck 18 initialization function. More...
 
err_t buck18_default_cfg (buck18_t *ctx)
 Buck 18 default configuration function. More...
 
err_t buck18_read_raw_adc (buck18_t *ctx, uint16_t *raw_adc)
 Buck 18 read raw ADC value function. More...
 
err_t buck18_read_voltage (buck18_t *ctx, float *voltage)
 Buck 18 read voltage level function. More...
 
err_t buck18_set_vref (buck18_t *ctx, float vref)
 Buck 18 set vref function. More...
 
void buck18_enable (buck18_t *ctx)
 Buck 18 enable the device function. More...
 
void buck18_disable (buck18_t *ctx)
 Buck 18 disable the device function. More...
 
err_t buck18_write_data (buck18_t *ctx, uint8_t cmd, uint8_t data_in)
 Buck 18 data writing function. More...
 
err_t buck18_read_data (buck18_t *ctx, uint8_t *data_out)
 Buck 18 data reading function. More...
 
err_t buck18_write_rdac (buck18_t *ctx, uint8_t wiper_pos)
 Buck 18 data writing function. More...
 
err_t buck18_set_resistance (buck18_t *ctx, float res_kohm)
 Buck 18 sets the resistance function. More...
 
err_t buck18_set_vout (buck18_t *ctx, buck18_vout_t vout)
 Buck 18 sets the VOUT function. More...
 

Detailed Description

API for configuring and manipulating Buck 18 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ buck18_cfg_setup()

void buck18_cfg_setup ( buck18_cfg_t cfg)

Buck 18 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See buck18_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ buck18_default_cfg()

err_t buck18_default_cfg ( buck18_t ctx)

Buck 18 default configuration function.

This function executes a default configuration of Buck 18 Click board.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ buck18_disable()

void buck18_disable ( buck18_t ctx)

Buck 18 disable the device function.

This function turns off power switch and disable the buck mode of the MAXM38643, Tiny, 1.8V to 5.5V Input, 330nA IQ, 600mA nanoPower Buck Module on the Buck 18 Click board.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ buck18_enable()

void buck18_enable ( buck18_t ctx)

Buck 18 enable the device function.

This function turns on the power switch and enables the buck mode of the MAXM38643, Tiny, 1.8V to 5.5V Input, 330nA IQ, 600mA nanoPower Buck Module on the Buck 18 Click board.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ buck18_init()

err_t buck18_init ( buck18_t ctx,
buck18_cfg_t cfg 
)

Buck 18 initialization function.

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

Parameters
[out]ctx: Click context object. See buck18_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See buck18_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck18_read_data()

err_t buck18_read_data ( buck18_t ctx,
uint8_t *  data_out 
)

Buck 18 data reading function.

This function reads a data byte of the AD5171, 64-Position OTP Digital Potentiometer on the Buck 18 Click board.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
[out]data_out: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck18_read_raw_adc()

err_t buck18_read_raw_adc ( buck18_t ctx,
uint16_t *  raw_adc 
)

Buck 18 read raw ADC value function.

This function reads raw ADC value.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
[out]raw_adc: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck18_read_voltage()

err_t buck18_read_voltage ( buck18_t ctx,
float *  voltage 
)

Buck 18 read voltage level function.

This function reads raw ADC value and converts it to proportional voltage level.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
[out]voltage: Output voltage level [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered reference voltage.

◆ buck18_set_resistance()

err_t buck18_set_resistance ( buck18_t ctx,
float  res_kohm 
)

Buck 18 sets the resistance function.

This function sets a desired resistance of the AD5171, 64-Position OTP Digital Potentiometer on the Buck 18 Click board.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
[in]res_kohm: Resistance [0-50kOhm].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck18_set_vout()

err_t buck18_set_vout ( buck18_t ctx,
buck18_vout_t  vout 
)

Buck 18 sets the VOUT function.

This function sets the voltage output level of the MAXM38643, Tiny, 1.8V to 5.5V Input, 330nA IQ, 600mA nanoPower Buck Module on the Buck 18 Click board.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
[in]vout: Voltage output [0.9-3.3V]. See buck18_vout_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck18_set_vref()

err_t buck18_set_vref ( buck18_t ctx,
float  vref 
)

Buck 18 set vref function.

This function sets the voltage reference for Buck 18 Click driver.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
[in]vref: Reference voltage (volts).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The default voltage reference set with buck18_init is 3.3V.

◆ buck18_write_data()

err_t buck18_write_data ( buck18_t ctx,
uint8_t  cmd,
uint8_t  data_in 
)

Buck 18 data writing function.

This function writes a desired data byte using the selected command of the AD5171, 64-Position OTP Digital Potentiometer on the Buck 18 Click board.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
[in]cmd: Command.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck18_write_rdac()

err_t buck18_write_rdac ( buck18_t ctx,
uint8_t  wiper_pos 
)

Buck 18 data writing function.

This function writes a RDAC by sets the position of the wiper position of the AD5171, 64-Position OTP Digital Potentiometer on the Buck 18 Click board.

Parameters
[in]ctx: Click context object. See buck18_t object definition for detailed explanation.
[in]wiper_pos: Wiper position [0-63].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.