buck20 2.1.0.0
|
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. | |
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.
void buck20_cfg_setup | ( | buck20_cfg_t * | cfg | ) |
Buck 20 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See buck20_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See buck20_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See buck20_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t buck20_get_rdy_pin | ( | buck20_t * | ctx | ) |
Buck 20 get rdy pin function.
This function returns the digipot RDY pin logic state.
[in] | ctx | : Click context object. See buck20_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See buck20_t object definition for detailed explanation. |
[in] | data_in | : Data to be written to wiper 1 register. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.