buck22 2.1.0.0
Buck 22 Click Driver

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

Topics

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

Functions

void buck22_cfg_setup (buck22_cfg_t *cfg)
 Buck 22 configuration object setup function.
 
err_t buck22_init (buck22_t *ctx, buck22_cfg_t *cfg)
 Buck 22 initialization function.
 
err_t buck22_set_vout (buck22_t *ctx, uint16_t vout_mv)
 Buck 22 set vout function.
 
err_t buck22_read_vout (buck22_t *ctx, uint16_t *vout_mv)
 Buck 22 read vout function.
 
err_t buck22_set_control (buck22_t *ctx, uint8_t control)
 Buck 22 set control function.
 
err_t buck22_read_status (buck22_t *ctx, uint8_t *status)
 Buck 22 read status function.
 
uint8_t buck22_get_pg_pin (buck22_t *ctx)
 Buck 22 get pg pin function.
 

Detailed Description

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

◆ buck22_cfg_setup()

void buck22_cfg_setup ( buck22_cfg_t * cfg)

Buck 22 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ buck22_get_pg_pin()

uint8_t buck22_get_pg_pin ( buck22_t * ctx)

Buck 22 get pg pin function.

This function returns the power good (PG) pin logic state.

Parameters
[in]ctx: Click context object. See buck22_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ buck22_init()

err_t buck22_init ( buck22_t * ctx,
buck22_cfg_t * cfg )

Buck 22 initialization function.

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

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

◆ buck22_read_status()

err_t buck22_read_status ( buck22_t * ctx,
uint8_t * status )

Buck 22 read status function.

This function reads the status register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See buck22_t object definition for detailed explanation.
[out]status: Status register value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck22_read_vout()

err_t buck22_read_vout ( buck22_t * ctx,
uint16_t * vout_mv )

Buck 22 read vout function.

This function reads the output voltage by using I2C serial interface.

Parameters
[in]ctx: Click context object. See buck22_t object definition for detailed explanation.
[out]vout_mv: Voltage output in millivolts (800-3350mV).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck22_set_control()

err_t buck22_set_control ( buck22_t * ctx,
uint8_t control )

Buck 22 set control function.

This function sets the control register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See buck22_t object definition for detailed explanation.
[in]control: Control register setting.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck22_set_vout()

err_t buck22_set_vout ( buck22_t * ctx,
uint16_t vout_mv )

Buck 22 set vout function.

This function sets the output voltage by using I2C serial interface.

Parameters
[in]ctx: Click context object. See buck22_t object definition for detailed explanation.
[in]vout_mv: Voltage output in millivolts (800-3350mV).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.