vibromotor 2.0.0.0
Modules | Functions
Vibro Motor Click Driver

API for configuring and manipulating Vibro Motor Click driver. More...

Modules

 Vibro Motor PWM Settings
 Settings for configuration of Vibro Motor Click driver.
 
 Vibro Motor MikroBUS Map
 MikroBUS pin mapping of Vibro Motor Click driver.
 
 Vibromotor_cfg
 

Functions

void vibromotor_cfg_setup (vibromotor_cfg_t *cfg)
 Vibro Motor configuration object setup function. More...
 
err_t vibromotor_init (vibromotor_t *ctx, vibromotor_cfg_t *cfg)
 Vibro Motor initialization function. More...
 
err_t vibromotor_set_duty_cycle (vibromotor_t *ctx, float duty_cycle)
 Vibro Motor sets PWM duty cycle. More...
 
err_t vibromotor_pwm_stop (vibromotor_t *ctx)
 Vibro Motor stop PWM module. More...
 
err_t vibromotor_pwm_start (vibromotor_t *ctx)
 Vibro Motor start PWM module. More...
 

Detailed Description

API for configuring and manipulating Vibro Motor Click driver.

Function Documentation

◆ vibromotor_cfg_setup()

void vibromotor_cfg_setup ( vibromotor_cfg_t cfg)

Vibro Motor configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ vibromotor_init()

err_t vibromotor_init ( vibromotor_t ctx,
vibromotor_cfg_t cfg 
)

Vibro Motor initialization function.

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

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

◆ vibromotor_pwm_start()

err_t vibromotor_pwm_start ( vibromotor_t ctx)

Vibro Motor start PWM module.

This function starts the PWM moudle output.

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

◆ vibromotor_pwm_stop()

err_t vibromotor_pwm_stop ( vibromotor_t ctx)

Vibro Motor stop PWM module.

This function stops the PWM moudle output.

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

◆ vibromotor_set_duty_cycle()

err_t vibromotor_set_duty_cycle ( vibromotor_t ctx,
float  duty_cycle 
)

Vibro Motor sets PWM duty cycle.

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

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