buck24 2.2.0
Loading...
Searching...
No Matches
Buck 24 Click Driver

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

Topics

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

Functions

void buck24_cfg_setup (buck24_cfg_t *cfg)
 Buck 24 configuration object setup function.
err_t buck24_init (buck24_t *ctx, buck24_cfg_t *cfg)
 Buck 24 initialization function.
err_t buck24_default_cfg (buck24_t *ctx)
 Buck 24 default configuration function.
void buck24_enable_device (buck24_t *ctx)
 Buck 24 enable device function.
void buck24_disable_device (buck24_t *ctx)
 Buck 24 disable device function.
uint8_t buck24_get_pg_pin (buck24_t *ctx)
 Buck 24 get power-good pin function.
err_t buck24_write_reg (buck24_t *ctx, uint8_t reg, uint16_t data_in)
 Buck 24 write register function.
err_t buck24_read_reg (buck24_t *ctx, uint8_t reg, uint16_t *data_out)
 Buck 24 read register function.
err_t buck24_read_data (buck24_t *ctx, buck24_data_t *data_out)
 Buck 24 read measurement data function.
err_t buck24_read_data_avg (buck24_t *ctx, uint16_t num_conv, buck24_data_t *data_out)
 Buck 24 read averaged measurement data function.

Detailed Description

API for configuring and manipulating Buck 24 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

◆ buck24_cfg_setup()

void buck24_cfg_setup ( buck24_cfg_t * cfg)

Buck 24 configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ buck24_default_cfg()

err_t buck24_default_cfg ( buck24_t * ctx)

Buck 24 default configuration function.

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

Parameters
[in]ctx: Click context object. See buck24_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.

◆ buck24_disable_device()

void buck24_disable_device ( buck24_t * ctx)

Buck 24 disable device function.

This function sets the RST pin to low logic level to disable the device.

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

◆ buck24_enable_device()

void buck24_enable_device ( buck24_t * ctx)

Buck 24 enable device function.

This function sets the RST pin to high logic level to enable the device.

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

◆ buck24_get_pg_pin()

uint8_t buck24_get_pg_pin ( buck24_t * ctx)

Buck 24 get power-good pin function.

This function reads the logic level of the PG (power-good) pin.

Parameters
[in]ctx: Click context object. See buck24_t object definition for detailed explanation.
Returns
Logic state of the PG pin.
Note
None.

◆ buck24_init()

err_t buck24_init ( buck24_t * ctx,
buck24_cfg_t * cfg )

Buck 24 initialization function.

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

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

◆ buck24_read_data()

err_t buck24_read_data ( buck24_t * ctx,
buck24_data_t * data_out )

Buck 24 read measurement data function.

This function reads shunt voltage, bus voltage, current, and power measurements from the device.

Parameters
[in]ctx: Click context object. See buck24_t object definition for detailed explanation.
[out]data_out: Pointer to structure where measurement data will be stored. See buck24_data_t structure definition.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ buck24_read_data_avg()

err_t buck24_read_data_avg ( buck24_t * ctx,
uint16_t num_conv,
buck24_data_t * data_out )

Buck 24 read averaged measurement data function.

This function reads multiple samples of measurement data and returns their average values.

Parameters
[in]ctx: Click context object. See buck24_t object definition for detailed explanation.
[in]num_conv: Number of measurement conversions to average.
[out]data_out: Pointer to structure where averaged data will be stored. See buck24_data_t structure definition.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ buck24_read_reg()

err_t buck24_read_reg ( buck24_t * ctx,
uint8_t reg,
uint16_t * data_out )

Buck 24 read register function.

This function reads a 16-bit data value from the specified register.

Parameters
[in]ctx: Click context object. See buck24_t object definition for detailed explanation.
[in]reg: Register address (valid range: 0x00 to 0x05).
[out]data_out: Pointer to 16-bit variable where read data will be stored.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ buck24_write_reg()

err_t buck24_write_reg ( buck24_t * ctx,
uint8_t reg,
uint16_t data_in )

Buck 24 write register function.

This function writes a 16-bit data value to the specified register.

Parameters
[in]ctx: Click context object. See buck24_t object definition for detailed explanation.
[in]reg: Register address (valid range: 0x00 to 0x05).
[in]data_in: 16-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.