42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
66#define DCMOTOR3_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
68 cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
69 cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.slp = MIKROBUS( mikrobus, MIKROBUS_CS )
77#define DCMOTOR3_RETVAL uint8_t
79#define DCMOTOR3_OK 0x00
80#define DCMOTOR3_INIT_ERROR 0xFF
87#define DCMOTOR3_DEF_FREQ 15000
#define DCMOTOR3_RETVAL
Definition dcmotor3.h:77
void dcmotor3_set_duty_cycle(dcmotor3_t *ctx, float duty_cycle)
Generic sets PWM duty cycle.
void dcmotor3_short_brake(dcmotor3_t *ctx)
Brake the engine function.
void dcmotor3_enable(dcmotor3_t *ctx)
Enable the engine function.
void dcmotor3_cfg_setup(dcmotor3_cfg_t *cfg)
Config Object Initialization function.
void dcmotor3_counter_clockwise(dcmotor3_t *ctx)
Set the direction of rotation in the counter clockwise direction function.
void dcmotor3_stop(dcmotor3_t *ctx)
Stop the engine function.
void dcmotor3_clockwise(dcmotor3_t *ctx)
Set the direction of rotation in the clockwise direction function.
DCMOTOR3_RETVAL dcmotor3_init(dcmotor3_t *ctx, dcmotor3_cfg_t *cfg)
Initialization function.
void dcmotor3_pwm_start(dcmotor3_t *ctx)
Start PWM module.
void dcmotor3_pwm_stop(dcmotor3_t *ctx)
Stop PWM module.
void dcmotor3_standby(dcmotor3_t *ctx)
Disable the engine function.
Click configuration structure definition.
Definition dcmotor3.h:124
pin_name_t slp
Definition dcmotor3.h:133
pin_name_t in2
Definition dcmotor3.h:132
uint32_t dev_pwm_freq
Definition dcmotor3.h:137
pin_name_t in1
Definition dcmotor3.h:131
pin_name_t pwm
Definition dcmotor3.h:127
Click ctx object definition.
Definition dcmotor3.h:101
digital_out_t in2
Definition dcmotor3.h:106
digital_out_t slp
Definition dcmotor3.h:107
uint32_t pwm_freq
Definition dcmotor3.h:116
digital_out_t in1
Definition dcmotor3.h:105
pwm_t pwm
Definition dcmotor3.h:111
uint16_t pwm_period
Definition dcmotor3.h:115