vibromotor 2.0.0.0
vibromotor.h File Reference

This file contains API for Vibro Motor Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_pwm.h"

Go to the source code of this file.

Data Structures

struct  vibromotor_t
 Vibro Motor Click driver selector. More...
 
struct  vibromotor_cfg_t
 Vibro Motor Click configuration object. More...
 

Macros

#define VIBROMOTOR_DEF_FREQ   5000
 Vibro Motor default PWM frequency.
 
#define VIBROMOTOR_MAP_MIKROBUS(cfg, mikrobus)    cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM )
 MikroBUS pin mapping.
 

Enumerations

enum  vibromotor_return_value_t { VIBROMOTOR_OK = 0 , VIBROMOTOR_ERROR = -1 }
 Vibro Motor Click return value data. More...
 

Functions

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

Detailed Description

This file contains API for Vibro Motor Click Driver.

Enumeration Type Documentation

◆ vibromotor_return_value_t

Vibro Motor Click return value data.

Predefined enum values for driver return values.

Enumerator
VIBROMOTOR_OK 
VIBROMOTOR_ERROR