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 DCMOTOR2_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
68 cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
69 cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_CS ); \
70 cfg.slp = MIKROBUS( mikrobus, MIKROBUS_INT )
77#define DCMOTOR2_RETVAL uint8_t
79#define DCMOTOR2_OK 0x00
80#define DCMOTOR2_INIT_ERROR 0xFF
87#define DCMOTOR2_DEF_FREQ 160000
#define DCMOTOR2_RETVAL
Definition dcmotor2.h:77
void dcmotor2_pwm_stop(dcmotor2_t *ctx)
Stop PWM module.
void dcmotor2_cfg_setup(dcmotor2_cfg_t *cfg)
Config Object Initialization function.
void dcmotor2_spin_counter_clockwise(dcmotor2_t *ctx)
Spin motor counter clockwise.
void dcmotor2_stop_motor(dcmotor2_t *ctx)
Stop motor clockwise.
DCMOTOR2_RETVAL dcmotor2_init(dcmotor2_t *ctx, dcmotor2_cfg_t *cfg)
Initialization function.
void dcmotor2_pwm_start(dcmotor2_t *ctx)
Start PWM module.
void dcmotor2_spin_clockwise(dcmotor2_t *ctx)
Spin motor clockwise.
void dcmotor2_disable_motor(dcmotor2_t *ctx)
Disable motor.
void dcmotor2_set_duty_cycle(dcmotor2_t *ctx, float duty_cycle)
Generic sets PWM duty cycle.
void dcmotor2_pull_brake(dcmotor2_t *ctx)
Pull motor brake.
void dcmotor2_enable_motor(dcmotor2_t *ctx)
Enable motor.
Click configuration structure definition.
Definition dcmotor2.h:123
pin_name_t slp
Definition dcmotor2.h:132
pin_name_t in2
Definition dcmotor2.h:130
uint32_t dev_pwm_freq
Definition dcmotor2.h:136
pin_name_t in1
Definition dcmotor2.h:131
pin_name_t pwm
Definition dcmotor2.h:126
Click ctx object definition.
Definition dcmotor2.h:101
digital_out_t in2
Definition dcmotor2.h:105
digital_out_t slp
Definition dcmotor2.h:107
uint32_t pwm_freq
Definition dcmotor2.h:115
digital_out_t in1
Definition dcmotor2.h:106
pwm_t pwm
Definition dcmotor2.h:111