dcmotor 2.0.0.0
dcmotor.h File Reference

This file contains API for DC 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  dcmotor_t
 Click ctx object definition. More...
 
struct  dcmotor_cfg_t
 Click configuration structure definition. More...
 

Macros

#define DCMOTOR_MAP_MIKROBUS(cfg, mikrobus)
 
#define DCMOTOR_RETVAL   uint8_t
 
#define DCMOTOR_OK   0x00
 
#define DCMOTOR_INIT_ERROR   0xFF
 
#define DCMOTOR_DEF_FREQ   20000
 

Functions

void dcmotor_cfg_setup (dcmotor_cfg_t *cfg)
 Config Object Initialization function.
 
DCMOTOR_RETVAL dcmotor_init (dcmotor_t *ctx, dcmotor_cfg_t *cfg)
 Initialization function.
 
void dcmotor_set_duty_cycle (dcmotor_t *ctx, float duty_cycle)
 Generic sets PWM duty cycle.
 
void dcmotor_pwm_stop (dcmotor_t *ctx)
 Stop PWM module.
 
void dcmotor_pwm_start (dcmotor_t *ctx)
 Start PWM module.
 
void dcmotor_enable (dcmotor_t *ctx)
 Enable the motor function.
 
void dcmotor_sleep_mode (dcmotor_t *ctx)
 Set sleep mode function.
 
void dcmotor_left_direction_fast (dcmotor_t *ctx)
 Select left direction, fast decay function.
 
void dcmotor_right_direction_fast (dcmotor_t *ctx)
 Select right direction, fast decay function.
 
void dcmotor_left_direction_slow (dcmotor_t *ctx)
 Select left direction, slow decay function.
 
void dcmotor_right_direction_slow (dcmotor_t *ctx)
 Select right direction, slow decay function.
 
uint8_t dcmotor_get_diagnostic (dcmotor_t *ctx)
 Get diagnostic function.
 

Detailed Description

This file contains API for DC MOTOR Click driver.