buck20 2.1.0.0
Buck 20 Click Driver

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

Topics

 Buck 20 Command byte List
 List of command bytes of Buck 20 Click driver.
 
 Buck 20 Registers Settings
 Settings for registers of Buck 20 Click driver.
 
 Buck 20 MikroBUS Map
 MikroBUS pin mapping of Buck 20 Click driver.
 

Functions

void buck20_cfg_setup (buck20_cfg_t *cfg)
 Buck 20 configuration object setup function.
 
err_t buck20_init (buck20_t *ctx, buck20_cfg_t *cfg)
 Buck 20 initialization function.
 
err_t buck20_generic_write (buck20_t *ctx, uint8_t command, uint8_t address, uint16_t data_in)
 Buck 20 data writing function.
 
err_t buck20_generic_read (buck20_t *ctx, uint8_t command, uint8_t address, uint16_t *data_out)
 Buck 20 data reading function.
 
err_t buck20_set_wiper_1 (buck20_t *ctx, uint16_t data_in)
 Buck 20 Set wiper 1 function.
 
err_t buck20_write_user_data (buck20_t *ctx, uint8_t address, uint16_t data_in)
 Buck 20 write user data function.
 
err_t buck20_read_user_data (buck20_t *ctx, uint8_t address, uint16_t *data_out)
 Buck 20 read user data function.
 
uint8_t buck20_get_rdy_pin (buck20_t *ctx)
 Buck 20 get rdy pin function.
 
void buck20_enable_device (buck20_t *ctx)
 Buck 20 enable device function.
 
void buck20_disable_device (buck20_t *ctx)
 Buck 20 disable device function.
 

Detailed Description

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

◆ buck20_cfg_setup()

void buck20_cfg_setup ( buck20_cfg_t * cfg)

Buck 20 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ buck20_disable_device()

void buck20_disable_device ( buck20_t * ctx)

Buck 20 disable device function.

This function disables the buck device by setting the RST pin to low logic state.

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

◆ buck20_enable_device()

void buck20_enable_device ( buck20_t * ctx)

Buck 20 enable device function.

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

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

◆ buck20_generic_read()

err_t buck20_generic_read ( buck20_t * ctx,
uint8_t command,
uint8_t address,
uint16_t * data_out )

Buck 20 data reading function.

This function reads two data bytes from the selected command and address by using SPI serial interface.

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

◆ buck20_generic_write()

err_t buck20_generic_write ( buck20_t * ctx,
uint8_t command,
uint8_t address,
uint16_t data_in )

Buck 20 data writing function.

This function writes two data bytes to the selected command and address by using SPI serial interface.

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

◆ buck20_get_rdy_pin()

uint8_t buck20_get_rdy_pin ( buck20_t * ctx)

Buck 20 get rdy pin function.

This function returns the digipot RDY pin logic state.

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

◆ buck20_init()

err_t buck20_init ( buck20_t * ctx,
buck20_cfg_t * cfg )

Buck 20 initialization function.

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

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

◆ buck20_read_user_data()

err_t buck20_read_user_data ( buck20_t * ctx,
uint8_t address,
uint16_t * data_out )

Buck 20 read user data function.

This function reads two bytes of user data from a desired address of EEMEM.

Parameters
[in]ctx: Click context object. See buck20_t object definition for detailed explanation.
[in]address: User data address in EEMEM [2-14].
[in]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ buck20_set_wiper_1()

err_t buck20_set_wiper_1 ( buck20_t * ctx,
uint16_t data_in )

Buck 20 Set wiper 1 function.

This function sets wiper 1 to desired value.

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

◆ buck20_write_user_data()

err_t buck20_write_user_data ( buck20_t * ctx,
uint8_t address,
uint16_t data_in )

Buck 20 write user data function.

This function writes two bytes of user data to a desired address of EEMEM.

Parameters
[in]ctx: Click context object. See buck20_t object definition for detailed explanation.
[in]address: User data address in EEMEM [2-14].
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.