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 DCMOTOR4_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
68 cfg.dir = MIKROBUS( mikrobus, MIKROBUS_AN ); \
69 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
70 cfg.flt = MIKROBUS( mikrobus, MIKROBUS_INT )
77#define DCMOTOR4_RETVAL uint8_t
79#define DCMOTOR4_OK 0x00
80#define DCMOTOR4_INIT_ERROR 0xFF
87#define DCMOTOR4_DEF_FREQ 10000
#define DCMOTOR4_RETVAL
Definition dcmotor4.h:77
void dcmotor4_run_clockwise(dcmotor4_t *ctx)
Run clockwise.
void dcmotor4_pwm_stop(dcmotor4_t *ctx)
Stop PWM module.
void dcmotor4_disable_motor(dcmotor4_t *ctx)
Disable motor.
void dcmotor4_cfg_setup(dcmotor4_cfg_t *cfg)
Config Object Initialization function.
uint8_t dcmotor4_get_diagnostic(dcmotor4_t *ctx)
Get diagnostic.
void dcmotor4_run_counter_clockwise(dcmotor4_t *ctx)
Run counter clockwise.
void dcmotor4_set_duty_cycle(dcmotor4_t *ctx, float duty_cycle)
Generic sets PWM duty cycle.
void dcmotor4_enable_motor(dcmotor4_t *ctx)
Enable motor.
DCMOTOR4_RETVAL dcmotor4_init(dcmotor4_t *ctx, dcmotor4_cfg_t *cfg)
Initialization function.
void dcmotor4_pwm_start(dcmotor4_t *ctx)
Start PWM module.
Click configuration structure definition.
Definition dcmotor4.h:126
uint32_t dev_pwm_freq
Definition dcmotor4.h:139
pin_name_t flt
Definition dcmotor4.h:135
pin_name_t dir
Definition dcmotor4.h:133
pin_name_t en
Definition dcmotor4.h:134
pin_name_t pwm
Definition dcmotor4.h:129
Click ctx object definition.
Definition dcmotor4.h:101
digital_in_t flt
Definition dcmotor4.h:110
uint32_t pwm_freq
Definition dcmotor4.h:118
digital_out_t en
Definition dcmotor4.h:106
pwm_t pwm
Definition dcmotor4.h:114
digital_out_t dir
Definition dcmotor4.h:105