driver2 2.0.0.0
Driver 2 Click Driver

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

Topics

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

Functions

void driver2_cfg_setup (driver2_cfg_t *cfg)
 Driver 2 configuration object setup function.
 
err_t driver2_init (driver2_t *ctx, driver2_cfg_t *cfg)
 Driver 2 initialization function.
 
err_t driver2_default_cfg (driver2_t *ctx)
 Driver 2 default configuration function.
 
err_t driver2_set_duty_cycle (driver2_t *ctx, float duty_cycle)
 Driver 2 sets PWM duty cycle.
 
err_t driver2_pwm_stop (driver2_t *ctx)
 Driver 2 stop PWM module.
 
err_t driver2_pwm_start (driver2_t *ctx)
 Driver 2 start PWM module.
 
void driver2_set_sd_pin (driver2_t *ctx, uint8_t state)
 Set SD pin.
 
void driver2_set_pwm_pin (driver2_t *ctx, uint8_t state)
 Set PWM pin.
 
uint8_t driver2_get_fb_pin (driver2_t *ctx)
 Get FB pin.
 

Detailed Description

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

◆ driver2_cfg_setup()

void driver2_cfg_setup ( driver2_cfg_t * cfg)

Driver 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ driver2_default_cfg()

err_t driver2_default_cfg ( driver2_t * ctx)

Driver 2 default configuration function.

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

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

◆ driver2_get_fb_pin()

uint8_t driver2_get_fb_pin ( driver2_t * ctx)

Get FB pin.

This function is reading state of the FB pin.

Parameters
[in]ctx: Click context object. See driver2_t object definition for detailed explanation.
Returns
State of pin

◆ driver2_init()

err_t driver2_init ( driver2_t * ctx,
driver2_cfg_t * cfg )

Driver 2 initialization function.

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

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

◆ driver2_pwm_start()

err_t driver2_pwm_start ( driver2_t * ctx)

Driver 2 start PWM module.

This function starts the PWM module output.

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

◆ driver2_pwm_stop()

err_t driver2_pwm_stop ( driver2_t * ctx)

Driver 2 stop PWM module.

This function stops the PWM module output.

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

◆ driver2_set_duty_cycle()

err_t driver2_set_duty_cycle ( driver2_t * ctx,
float duty_cycle )

Driver 2 sets PWM duty cycle.

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

Parameters
[out]ctx: Click context object. See driver2_t object definition for detailed explanation.
[in]duty_ratio: PWM duty_ratio.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ driver2_set_pwm_pin()

void driver2_set_pwm_pin ( driver2_t * ctx,
uint8_t state )

Set PWM pin.

This function sets state of the PWM pin.

Parameters
[out]ctx: Click context object. See driver2_t object definition for detailed explanation.
[in]state: State of pin.
Returns
Nothing.

◆ driver2_set_sd_pin()

void driver2_set_sd_pin ( driver2_t * ctx,
uint8_t state )

Set SD pin.

This function sets state of the SD pin.

Parameters
[out]ctx: Click context object. See driver2_t object definition for detailed explanation.
[in]state: State of pin.
Returns
Nothing.