bucknboost 2.0.0.0
Buck n Boost Click Driver

API for configuring and manipulating Buck n Boost Click driver. More...

Topics

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

Functions

void bucknboost_cfg_setup (bucknboost_cfg_t *cfg)
 Buck n Boost configuration object setup function.
 
err_t bucknboost_init (bucknboost_t *ctx, bucknboost_cfg_t *cfg)
 Buck n Boost initialization function.
 
err_t bucknboost_default_cfg (bucknboost_t *ctx)
 Buck n Boost default configuration function.
 
err_t bucknboost_generic_write (bucknboost_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Buck n Boost I2C writing function.
 
err_t bucknboost_generic_read (bucknboost_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Buck n Boost I2C reading function.
 
err_t bucknboost_send_cmd (bucknboost_t *ctx, uint8_t cmd)
 Buck n Boost send command function.
 
err_t bucknboost_write_byte (bucknboost_t *ctx, uint8_t reg, uint8_t data_in)
 Buck n Boost Write single byte function.
 
err_t bucknboost_read_byte (bucknboost_t *ctx, uint8_t reg, uint8_t *data_out)
 Buck n Boost read single byte function.
 
void bucknboost_pin_standby_mode (bucknboost_t *ctx, uint8_t state)
 Buck n Boost set STB pin mode function.
 
err_t bucknboost_reg_standby_mode (bucknboost_t *ctx, uint8_t state)
 Buck n Boost set standby mode function.
 
void bucknboost_device_enable (bucknboost_t *ctx, uint8_t state)
 Buck n Boost enable device function.
 
uint8_t bucknboost_check_power_good (bucknboost_t *ctx)
 Buck n Boost check power good function.
 
uint8_t bucknboost_check_por (bucknboost_t *ctx)
 Buck n Boost check power on reset function.
 
err_t bucknboost_read_oc_fault (bucknboost_t *ctx, uint8_t *data_out)
 Buck n Boost read overcurrent fault function.
 
err_t bucknboost_set_buck_out_voltage (bucknboost_t *ctx, uint8_t ch_num, uint8_t data_in)
 Buck n Boost set buck output voltage function.
 
err_t bucknboost_set_all_buck_out_voltage (bucknboost_t *ctx, uint8_t data_in)
 Buck n Boost set all bucks output voltage function.
 
err_t bucknboost_set_boost_out_voltage (bucknboost_t *ctx, uint8_t data_in)
 Buck n Boost set boost output voltage function.
 
err_t bucknboost_get_status (bucknboost_t *ctx, bucknboost_status_t *st_data)
 Buck n Boost get status data function.
 
err_t bucknboost_update_cfg_out (bucknboost_t *ctx, uint8_t ch_num, bucknboost_cfg_buck_t b_data)
 Buck n Boost update configuration of the output registers function.
 
err_t bucknboost_get_power_good_status (bucknboost_t *ctx, uint8_t *data_out)
 Buck n Boost get power good status function.
 
err_t bucknboost_check_power_good_status (bucknboost_t *ctx, uint8_t ch_num, uint8_t *data_out)
 Buck n Boost check power good status function.
 
err_t bucknboost_get_eeprom_status (bucknboost_t *ctx, uint8_t *data_out)
 Buck n Boost get eeprom status function.
 
err_t bucknboost_get_overcurrent_fault_status (bucknboost_t *ctx, uint8_t *data_out)
 Buck n Boost get overcurrent fault status function.
 
err_t bucknboost_check_overc_fault_status (bucknboost_t *ctx, uint8_t ch_num, uint8_t *data_out)
 Buck n Boost check overcurrent fault status function.
 

Detailed Description

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

◆ bucknboost_cfg_setup()

void bucknboost_cfg_setup ( bucknboost_cfg_t * cfg)

Buck n Boost configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ bucknboost_check_overc_fault_status()

err_t bucknboost_check_overc_fault_status ( bucknboost_t * ctx,
uint8_t ch_num,
uint8_t * data_out )

Buck n Boost check overcurrent fault status function.

This function checks the overcurrent fault status of a desired channel.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]ch_num: Output channel number [1-6].
[out]data_out: Overcurrent fault status flag.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_check_por()

uint8_t bucknboost_check_por ( bucknboost_t * ctx)

Buck n Boost check power on reset function.

This function returns POR pin state.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
Returns
POR pin state.
Note
None.

◆ bucknboost_check_power_good()

uint8_t bucknboost_check_power_good ( bucknboost_t * ctx)

Buck n Boost check power good function.

This function returns PG pin state.

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

◆ bucknboost_check_power_good_status()

err_t bucknboost_check_power_good_status ( bucknboost_t * ctx,
uint8_t ch_num,
uint8_t * data_out )

Buck n Boost check power good status function.

This function checks the power good status of a desired channel.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]ch_num: Output channel number [1-6].
[out]data_out: Power good status flag.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_default_cfg()

err_t bucknboost_default_cfg ( bucknboost_t * ctx)

Buck n Boost default configuration function.

This function executes a default configuration of Buck n Boost click board.

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

◆ bucknboost_device_enable()

void bucknboost_device_enable ( bucknboost_t * ctx,
uint8_t state )

Buck n Boost enable device function.

This function enables or disables device by setting EN pin state.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]state: - 0x00 : Disable.
  • 0x01 : Enable.
Returns
None.
Note
None.

◆ bucknboost_generic_read()

err_t bucknboost_generic_read ( bucknboost_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Buck n Boost I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_generic_write()

err_t bucknboost_generic_write ( bucknboost_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Buck n Boost I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_get_eeprom_status()

err_t bucknboost_get_eeprom_status ( bucknboost_t * ctx,
uint8_t * data_out )

Buck n Boost get eeprom status function.

This function reads the eeprom status register.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[out]data_out: Eeprom register content.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_get_overcurrent_fault_status()

err_t bucknboost_get_overcurrent_fault_status ( bucknboost_t * ctx,
uint8_t * data_out )

Buck n Boost get overcurrent fault status function.

This function reads the overcurrent fault status register.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[out]data_out: Overcurrent fault register content.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_get_power_good_status()

err_t bucknboost_get_power_good_status ( bucknboost_t * ctx,
uint8_t * data_out )

Buck n Boost get power good status function.

This function reads the power good status register.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[out]data_out: Power good status register content.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_get_status()

err_t bucknboost_get_status ( bucknboost_t * ctx,
bucknboost_status_t * st_data )

Buck n Boost get status data function.

This function reads Power Good, EEPROM, and Overcurrent status registers.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[out]st_data: Status structure output data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_init()

err_t bucknboost_init ( bucknboost_t * ctx,
bucknboost_cfg_t * cfg )

Buck n Boost initialization function.

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

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

◆ bucknboost_pin_standby_mode()

void bucknboost_pin_standby_mode ( bucknboost_t * ctx,
uint8_t state )

Buck n Boost set STB pin mode function.

This function sets standby mode via STB pin.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]state: - 0x00 : Disable.
  • 0x01 : Enable.
Returns
None.
Note
None.

◆ bucknboost_read_byte()

err_t bucknboost_read_byte ( bucknboost_t * ctx,
uint8_t reg,
uint8_t * data_out )

Buck n Boost read single byte function.

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

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

◆ bucknboost_read_oc_fault()

err_t bucknboost_read_oc_fault ( bucknboost_t * ctx,
uint8_t * data_out )

Buck n Boost read overcurrent fault function.

This function reads the overcurrent status fault.

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

◆ bucknboost_reg_standby_mode()

err_t bucknboost_reg_standby_mode ( bucknboost_t * ctx,
uint8_t state )

Buck n Boost set standby mode function.

This function sets standby or wake up mode via registers.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]state: - 0x00 : Wake Up.
  • 0x01 : Standby.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_send_cmd()

err_t bucknboost_send_cmd ( bucknboost_t * ctx,
uint8_t cmd )

Buck n Boost send command function.

This function sends a desired command via I2C serial interface.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]cmd: 8-bit command data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_set_all_buck_out_voltage()

err_t bucknboost_set_all_buck_out_voltage ( bucknboost_t * ctx,
uint8_t data_in )

Buck n Boost set all bucks output voltage function.

This function sets the output voltage of all bucks channel.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]data_in: Buck output voltage data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_set_boost_out_voltage()

err_t bucknboost_set_boost_out_voltage ( bucknboost_t * ctx,
uint8_t data_in )

Buck n Boost set boost output voltage function.

This function sets the output voltage of the boost channel (CH6).

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]data_in: Boost output voltage data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_set_buck_out_voltage()

err_t bucknboost_set_buck_out_voltage ( bucknboost_t * ctx,
uint8_t ch_num,
uint8_t data_in )

Buck n Boost set buck output voltage function.

This function sets the output voltage of a desired buck channel.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]ch_num: Channel number.
[in]data_in: Buck output voltage data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_update_cfg_out()

err_t bucknboost_update_cfg_out ( bucknboost_t * ctx,
uint8_t ch_num,
bucknboost_cfg_buck_t b_data )

Buck n Boost update configuration of the output registers function.

This function updates configuration of the output Buck registers.

Parameters
[in]ctx: Click context object. See bucknboost_t object definition for detailed explanation.
[in]ch_num: Buck output channel number [1-5].
[in]b_data: Buck structure that contains configuration data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ bucknboost_write_byte()

err_t bucknboost_write_byte ( bucknboost_t * ctx,
uint8_t reg,
uint8_t data_in )

Buck n Boost Write single byte function.

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

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