stepdown10 2.1.0.0
Step Down 10 Click Driver

API for configuring and manipulating Step Down 10 Click driver. More...

Topics

 Step Down 10 Registers List
 List of registers of Step Down 10 Click driver.
 
 Step Down 10 Registers Settings
 Settings for registers of Step Down 10 Click driver.
 
 Step Down 10 MikroBUS Map
 MikroBUS pin mapping of Step Down 10 Click driver.
 

Functions

void stepdown10_cfg_setup (stepdown10_cfg_t *cfg)
 Step Down 10 configuration object setup function.
 
err_t stepdown10_init (stepdown10_t *ctx, stepdown10_cfg_t *cfg)
 Step Down 10 initialization function.
 
err_t stepdown10_default_cfg (stepdown10_t *ctx)
 Step Down 10 default configuration function.
 
err_t stepdown10_generic_write (stepdown10_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Step Down 10 I2C writing function.
 
err_t stepdown10_generic_read (stepdown10_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Step Down 10 I2C reading function.
 
void stepdown10_set_en_pin (stepdown10_t *ctx, uint8_t pin_state)
 Step Down 10 set EN pin state function.
 
void stepdown10_set_md (stepdown10_t *ctx, uint8_t mode)
 Step Down 10 mode selection function.
 
uint8_t stepdown10_get_pg_state (stepdown10_t *ctx)
 Step Down 10 get PG pin state function.
 
err_t stepdown10_set_wiper_pos (stepdown10_t *ctx, uint16_t wiper_pos)
 Step Down 10 set wiper position.
 
err_t stepdown10_set_r2_resistance (stepdown10_t *ctx, uint32_t resistance)
 Step Down 10 set potentiometer resistance.
 
err_t stepdown10_set_output (stepdown10_t *ctx, float voltage)
 Step Down 10 set output voltage.
 

Detailed Description

API for configuring and manipulating Step Down 10 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

◆ stepdown10_cfg_setup()

void stepdown10_cfg_setup ( stepdown10_cfg_t * cfg)

Step Down 10 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ stepdown10_default_cfg()

err_t stepdown10_default_cfg ( stepdown10_t * ctx)

Step Down 10 default configuration function.

This function executes a default configuration of Step Down 10 click board.

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

◆ stepdown10_generic_read()

err_t stepdown10_generic_read ( stepdown10_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Step Down 10 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 stepdown10_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepdown10_generic_write()

err_t stepdown10_generic_write ( stepdown10_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Step Down 10 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 stepdown10_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepdown10_get_pg_state()

uint8_t stepdown10_get_pg_state ( stepdown10_t * ctx)

Step Down 10 get PG pin state function.

This function is used to get state of the PG pin.

Parameters
[out]cfg: Click configuration structure. See stepdown10_cfg_t object definition for detailed explanation.
Returns
State of the PG pin.
Note
None.

◆ stepdown10_init()

err_t stepdown10_init ( stepdown10_t * ctx,
stepdown10_cfg_t * cfg )

Step Down 10 initialization function.

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

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

◆ stepdown10_set_en_pin()

void stepdown10_set_en_pin ( stepdown10_t * ctx,
uint8_t pin_state )

Step Down 10 set EN pin state function.

This function sets a EN pin state.

Parameters
[out]cfg: Click configuration structure. See stepdown10_cfg_t object definition for detailed explanation.
[in]en_state: State of the EN pin.
Returns
Nothing.
Note
None.

◆ stepdown10_set_md()

void stepdown10_set_md ( stepdown10_t * ctx,
uint8_t mode )

Step Down 10 mode selection function.

This function sets a desired mode of the PWM.

Parameters
[out]cfg: Click configuration structure. See stepdown10_cfg_t object definition for detailed explanation.
[in]mode: PWM/Sync mode.
Returns
Nothing.
Note
None.

◆ stepdown10_set_output()

err_t stepdown10_set_output ( stepdown10_t * ctx,
float voltage )

Step Down 10 set output voltage.

This function sets a predefined output level.

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

◆ stepdown10_set_r2_resistance()

err_t stepdown10_set_r2_resistance ( stepdown10_t * ctx,
uint32_t resistance )

Step Down 10 set potentiometer resistance.

This function sets a resistance of the potentiometer to the desired value.

Parameters
[in]ctx: Click context object. See stepdown10_t object definition for detailed explanation.
[in]resistance: Desired resistance.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ stepdown10_set_wiper_pos()

err_t stepdown10_set_wiper_pos ( stepdown10_t * ctx,
uint16_t wiper_pos )

Step Down 10 set wiper position.

This function sets a wiper of the potentiometer to the desired position.

Parameters
[in]ctx: Click context object. See stepdown10_t object definition for detailed explanation.
[in]wiper_pos: Position of the wiper.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.