buck23 2.1.0.0
Buck 23 Click Driver

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

Topics

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

Functions

void buck23_cfg_setup (buck23_cfg_t *cfg)
 Buck 23 configuration object setup function.
 
err_t buck23_init (buck23_t *ctx, buck23_cfg_t *cfg)
 Buck 23 initialization function.
 
err_t buck23_default_cfg (buck23_t *ctx)
 Buck 23 default configuration function.
 
err_t buck23_write_register (buck23_t *ctx, uint8_t reg, uint8_t data_in)
 Buck 23 write register function.
 
err_t buck23_read_register (buck23_t *ctx, uint8_t reg, uint8_t *data_out)
 Buck 23 read register function.
 
void buck23_enable_device (buck23_t *ctx)
 Buck 23 enable device function.
 
void buck23_disable_device (buck23_t *ctx)
 Buck 23 disable device function.
 
void buck23_restart_device (buck23_t *ctx)
 Buck 23 restart device function.
 
void buck23_set_sync_pin (buck23_t *ctx, uint8_t state)
 Buck 23 set sync pin function.
 
uint8_t buck23_get_pg_pin (buck23_t *ctx)
 Buck 23 get pg pin function.
 
err_t buck23_check_communication (buck23_t *ctx)
 Buck 23 check communication function.
 
err_t buck23_set_vstep (buck23_t *ctx, uint8_t vstep)
 Buck 23 set vstep function.
 
err_t buck23_set_vout (buck23_t *ctx, uint16_t vout_mv)
 Buck 23 set vout function.
 

Detailed Description

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

◆ buck23_cfg_setup()

void buck23_cfg_setup ( buck23_cfg_t * cfg)

Buck 23 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ buck23_check_communication()

err_t buck23_check_communication ( buck23_t * ctx)

Buck 23 check communication function.

This function checks the communication by reading and verifying the device ID.

Parameters
[in]ctx: Click context object. See buck23_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The device ID value contains the device revision number, so make sure that the device revision number mathes the value defined in the BUCK23_DEVICE_ID macro.

◆ buck23_default_cfg()

err_t buck23_default_cfg ( buck23_t * ctx)

Buck 23 default configuration function.

This function executes a default configuration of Buck 23 click board.

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

◆ buck23_disable_device()

void buck23_disable_device ( buck23_t * ctx)

Buck 23 disable device function.

This function disables the device by setting the EN pin to high logic state.

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

◆ buck23_enable_device()

void buck23_enable_device ( buck23_t * ctx)

Buck 23 enable device function.

This function enables the device by setting the EN pin to high logic state.

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

◆ buck23_get_pg_pin()

uint8_t buck23_get_pg_pin ( buck23_t * ctx)

Buck 23 get pg pin function.

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

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

◆ buck23_init()

err_t buck23_init ( buck23_t * ctx,
buck23_cfg_t * cfg )

Buck 23 initialization function.

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

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

◆ buck23_read_register()

err_t buck23_read_register ( buck23_t * ctx,
uint8_t reg,
uint8_t * data_out )

Buck 23 read register function.

This function reads data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See buck23_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck23_restart_device()

void buck23_restart_device ( buck23_t * ctx)

Buck 23 restart device function.

This function restarts the device by toggling the EN pin logic state.

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

◆ buck23_set_sync_pin()

void buck23_set_sync_pin ( buck23_t * ctx,
uint8_t state )

Buck 23 set sync pin function.

This function sets the SYNC pin logic state.

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

◆ buck23_set_vout()

err_t buck23_set_vout ( buck23_t * ctx,
uint16_t vout_mv )

Buck 23 set vout function.

This function sets the voltage output.

Parameters
[in]ctx: Click context object. See buck23_t object definition for detailed explanation.
[in]vout_mv: Voltage output in millivolts. Depending on the vstep settings the voltage output ranges from 500mV to 1270mV or from 625mV to 1587.5mV.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck23_set_vstep()

err_t buck23_set_vstep ( buck23_t * ctx,
uint8_t vstep )

Buck 23 set vstep function.

This function sets the voltage output step to 10mV or 12.5mV.

Parameters
[in]ctx: Click context object. See buck23_t object definition for detailed explanation.
[in]vstep:
  • 0 - 10mV voltage output step - VOUT range: 500mV to 1270mV,
  • 1 - 12.5mV voltage output step - VOUT range: 625mV to 1587.5mV.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck23_write_register()

err_t buck23_write_register ( buck23_t * ctx,
uint8_t reg,
uint8_t data_in )

Buck 23 write register function.

This function writes a desired data to the selected register by using I2C serial interface.

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