dcmotor18 2.0.0.0
dcmotor18.h File Reference

This file contains API for DC Motor 18 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  dcmotor18_t
 DC Motor 18 Click driver selector. More...
 
struct  dcmotor18_cfg_t
 DC Motor 18 Click configuration object. More...
 

Macros

#define DCMOTOR18_DEF_FREQ   5000
 DC Motor 18 default PWM frequency.
 
#define DCMOTOR18_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  dcmotor18_return_value_t { DCMOTOR18_OK = 0 , DCMOTOR18_ERROR = -1 }
 DC Motor 18 Click return value data. More...
 

Functions

void dcmotor18_cfg_setup (dcmotor18_cfg_t *cfg)
 DC Motor 18 configuration object setup function.
 
err_t dcmotor18_init (dcmotor18_t *ctx, dcmotor18_cfg_t *cfg)
 DC Motor 18 initialization function.
 
err_t dcmotor18_default_cfg (dcmotor18_t *ctx)
 DC Motor 18 default configuration function.
 
err_t dcmotor18_set_duty_cycle (dcmotor18_t *ctx, float duty_cycle)
 Sets PWM duty cycle.
 
err_t dcmotor18_pwm_stop (dcmotor18_t *ctx)
 DC Motor 18 stop PWM module.
 
err_t dcmotor18_pwm_start (dcmotor18_t *ctx)
 DC Motor 18 start PWM module.
 
err_t dcmotor18_read_an_pin_value (dcmotor18_t *ctx, uint16_t *data_out)
 DC Motor 18 read AN pin value function.
 
err_t dcmotor18_read_an_pin_voltage (dcmotor18_t *ctx, float *data_out)
 DC Motor 18 read AN pin voltage level function.
 
err_t dcmotor18_read_an_pin_current (dcmotor18_t *ctx, float *data_out)
 Read AN pin current.
 
void dcmotor18_set_direction (dcmotor18_t *ctx, uint8_t state)
 Set diretion of motor rotation.
 
void dcmotor18_set_enable (dcmotor18_t *ctx, uint8_t state)
 Set enable pin state.
 
uint8_t dcmotor18_get_interrupt (dcmotor18_t *ctx)
 Get interrupt pin state.
 
err_t dcmotor18_set_speed_percentage (dcmotor18_t *ctx, float speed_percentage)
 Set speed output percentage.
 

Detailed Description

This file contains API for DC Motor 18 Click Driver.

Enumeration Type Documentation

◆ dcmotor18_return_value_t

DC Motor 18 Click return value data.

Predefined enum values for driver return values.

Enumerator
DCMOTOR18_OK 
DCMOTOR18_ERROR