vreg2 2.0.0.0
VREG 2 Click Driver

API for configuring and manipulating VREG 2 Click driver. More...

Topics

 VREG 2 PWM Settings
 Settings for configuration of VREG 2 Click driver.
 
 VREG 2 MikroBUS Map
 MikroBUS pin mapping of VREG 2 Click driver.
 

Functions

void vreg2_cfg_setup (vreg2_cfg_t *cfg)
 VREG 2 configuration object setup function.
 
err_t vreg2_init (vreg2_t *ctx, vreg2_cfg_t *cfg)
 VREG 2 initialization function.
 
err_t vreg2_default_cfg (vreg2_t *ctx)
 VREG 2 default configuration function.
 
err_t vreg2_set_duty_cycle (vreg2_t *ctx, float duty_cycle)
 VREG 2 sets PWM duty cycle.
 
err_t vreg2_pwm_stop (vreg2_t *ctx)
 VREG 2 stop PWM module.
 
err_t vreg2_pwm_start (vreg2_t *ctx)
 VREG 2 start PWM module.
 

Detailed Description

API for configuring and manipulating VREG 2 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

◆ vreg2_cfg_setup()

void vreg2_cfg_setup ( vreg2_cfg_t * cfg)

VREG 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ vreg2_default_cfg()

err_t vreg2_default_cfg ( vreg2_t * ctx)

VREG 2 default configuration function.

This function executes a default configuration of VREG 2 click board.

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

◆ vreg2_init()

err_t vreg2_init ( vreg2_t * ctx,
vreg2_cfg_t * cfg )

VREG 2 initialization function.

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

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

◆ vreg2_pwm_start()

err_t vreg2_pwm_start ( vreg2_t * ctx)

VREG 2 start PWM module.

This function starts the PWM module output.

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

◆ vreg2_pwm_stop()

err_t vreg2_pwm_stop ( vreg2_t * ctx)

VREG 2 stop PWM module.

This function stops the PWM module output.

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

◆ vreg2_set_duty_cycle()

err_t vreg2_set_duty_cycle ( vreg2_t * ctx,
float duty_cycle )

VREG 2 sets PWM duty cycle.

This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).

Parameters
[in]ctx: Click context object. See vreg2_t object definition for detailed explanation.
[in]duty_cycle: PWM duty cycle.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.