stepdown5 2.1.0.0
|
API for configuring and manipulating Step Down 5 Click driver. More...
Topics | |
Step Down 5 Registers Settings | |
Settings for registers of Step Down 5 Click driver. | |
Step Down 5 MikroBUS Map | |
MikroBUS pin mapping of Step Down 5 Click driver. | |
Functions | |
void | stepdown5_cfg_setup (stepdown5_cfg_t *cfg) |
Step Down 5 configuration object setup function. | |
err_t | stepdown5_init (stepdown5_t *ctx, stepdown5_cfg_t *cfg) |
Step Down 5 initialization function. | |
err_t | stepdown5_default_cfg (stepdown5_t *ctx) |
Step Down 5 default configuration function. | |
err_t | stepdown5_generic_write (stepdown5_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Step Down 5 I2C writing function. | |
err_t | stepdown5_generic_read (stepdown5_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Step Down 5 I2C reading function. | |
void | stepdown5_set_mode (stepdown5_t *ctx, uint8_t mode) |
Step Down 5 mode selection function. | |
uint8_t | stepdown5_get_pg_state (stepdown5_t *ctx) |
Step Down 5 get PG pin state function. | |
err_t | stepdown5_set_wiper_0_pos (stepdown5_t *ctx, uint16_t wiper_0_pos) |
Step Down 5 set wiper 0 position. | |
err_t | stepdown5_set_wiper_1_pos (stepdown5_t *ctx, uint16_t wiper_1_pos) |
Step Down 5 set wiper 1 position. | |
err_t | stepdown5_set_r1_resistance (stepdown5_t *ctx, uint32_t resistance) |
Step Down 5 set potentiometer 0 resistance. | |
err_t | stepdown5_set_r2_resistance (stepdown5_t *ctx, uint32_t resistance) |
Step Down 5 set potentiometer 1 resistance. | |
err_t | stepdown5_set_output (stepdown5_t *ctx, uint8_t voltage) |
Step Down 5 set output voltage. | |
API for configuring and manipulating Step Down 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void stepdown5_cfg_setup | ( | stepdown5_cfg_t * | cfg | ) |
Step Down 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See stepdown5_cfg_t object definition for detailed explanation. |
err_t stepdown5_default_cfg | ( | stepdown5_t * | ctx | ) |
Step Down 5 default configuration function.
This function executes a default configuration of Step Down 5 click board.
[in] | ctx | : Click context object. See stepdown5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepdown5_generic_read | ( | stepdown5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Step Down 5 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See stepdown5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepdown5_generic_write | ( | stepdown5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Step Down 5 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See stepdown5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t stepdown5_get_pg_state | ( | stepdown5_t * | ctx | ) |
Step Down 5 get PG pin state function.
This function is used to get state of the PG pin.
[out] | cfg | : Click configuration structure. See stepdown5_cfg_t object definition for detailed explanation. |
err_t stepdown5_init | ( | stepdown5_t * | ctx, |
stepdown5_cfg_t * | cfg ) |
Step Down 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See stepdown5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See stepdown5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void stepdown5_set_mode | ( | stepdown5_t * | ctx, |
uint8_t | mode ) |
Step Down 5 mode selection function.
This function sets a desired mode of the PWM.
[out] | cfg | : Click configuration structure. See stepdown5_cfg_t object definition for detailed explanation. |
[in] | mode | : PWM/Sync mode. |
err_t stepdown5_set_output | ( | stepdown5_t * | ctx, |
uint8_t | voltage ) |
Step Down 5 set output voltage.
This function sets a predefined output level.
[in] | ctx | : Click context object. See stepdown5_t object definition for detailed explanation. |
[in] | voltage | : Desired output voltage. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepdown5_set_r1_resistance | ( | stepdown5_t * | ctx, |
uint32_t | resistance ) |
Step Down 5 set potentiometer 0 resistance.
This function sets a resistance of the potentiometer 0 to the desired value.
[in] | ctx | : Click context object. See stepdown5_t object definition for detailed explanation. |
[in] | resistance | : Desired resistance. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepdown5_set_r2_resistance | ( | stepdown5_t * | ctx, |
uint32_t | resistance ) |
Step Down 5 set potentiometer 1 resistance.
This function sets a resistance of the potentiometer 1 to the desired value.
[in] | ctx | : Click context object. See stepdown5_t object definition for detailed explanation. |
[in] | resistance | : Desired resistance. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepdown5_set_wiper_0_pos | ( | stepdown5_t * | ctx, |
uint16_t | wiper_0_pos ) |
Step Down 5 set wiper 0 position.
This function sets a wiper of the potentiometer 0 to the desired position.
[in] | ctx | : Click context object. See stepdown5_t object definition for detailed explanation. |
[in] | wiper_0_pos | : Position of the wiper. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t stepdown5_set_wiper_1_pos | ( | stepdown5_t * | ctx, |
uint16_t | wiper_1_pos ) |
Step Down 5 set wiper 1 position.
This function sets a wiper of the potentiometer 1 to the desired position.
[in] | ctx | : Click context object. See stepdown5_t object definition for detailed explanation. |
[in] | wiper_1_pos | : Position of the wiper. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.