39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
52#include "drv_analog_in.h"
74#define DCMOTOR9_DEF_FREQ 20000
75#define DCMOTOR9_DEF_VREF 3.3
81#define DCMOTOR9_PWM_DUTY_PERCENT_0 0.0
82#define DCMOTOR9_PWM_DUTY_PERCENT_10 0.1
83#define DCMOTOR9_PWM_DUTY_PERCENT_20 0.2
84#define DCMOTOR9_PWM_DUTY_PERCENT_30 0.3
85#define DCMOTOR9_PWM_DUTY_PERCENT_40 0.4
86#define DCMOTOR9_PWM_DUTY_PERCENT_50 0.5
87#define DCMOTOR9_PWM_DUTY_PERCENT_60 0.6
88#define DCMOTOR9_PWM_DUTY_PERCENT_70 0.7
89#define DCMOTOR9_PWM_DUTY_PERCENT_80 0.8
90#define DCMOTOR9_PWM_DUTY_PERCENT_90 0.9
91#define DCMOTOR9_PWM_DUTY_PERCENT_100 1.0
109#define DCMOTOR9_MAP_MIKROBUS( cfg, mikrobus ) \
110 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
111 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
112 cfg.shd = MIKROBUS( mikrobus, MIKROBUS_RST ); \
113 cfg.pw2 = MIKROBUS( mikrobus, MIKROBUS_CS )
dcmotor9_return_value_t
DC Motor 9 Click return value data.
Definition dcmotor9.h:165
@ DCMOTOR9_OK
Definition dcmotor9.h:166
@ DCMOTOR9_ERROR
Definition dcmotor9.h:167
void dcmotor9_counter_clockwise(dcmotor9_t *ctx)
DC Motor 9 Set the counter clockwise direction of rotation function.
void dcmotor9_clockwise(dcmotor9_t *ctx)
DC Motor 9 Set the clockwise direction of rotation function.
err_t dcmotor9_pwm_start(dcmotor9_t *ctx)
DC Motor 9 start PWM module.
err_t dcmotor9_read_an_voltage(dcmotor9_t *ctx, float *data_out)
DC Motor 9 AN Voltage Read function.
err_t dcmotor9_default_cfg(dcmotor9_t *ctx)
DC Motor 9 default configuration function.
void dcmotor9_enable(dcmotor9_t *ctx)
DC Motor 9 Enable the engine function.
err_t dcmotor9_set_duty_cycle(dcmotor9_t *ctx, float duty_cycle)
DC Motor 9 sets PWM duty cycle.
err_t dcmotor9_read_an_value(dcmotor9_t *ctx, uint16_t *data_out)
DC Motor 9 AN Value Read function.
err_t dcmotor9_init(dcmotor9_t *ctx, dcmotor9_cfg_t *cfg)
DC Motor 9 initialization function.
void dcmotor9_short_brake(dcmotor9_t *ctx)
DC Motor 9 Brake the engine function.
void dcmotor9_standby(dcmotor9_t *ctx)
DC Motor 9 Disable the engine function.
void dcmotor9_cfg_setup(dcmotor9_cfg_t *cfg)
DC Motor 9 configuration object setup function.
err_t dcmotor9_pwm_stop(dcmotor9_t *ctx)
DC Motor 9 stop PWM module.
void dcmotor9_stop(dcmotor9_t *ctx)
DC Motor 9 Stop the engine function.
DC Motor 9 Click configuration object.
Definition dcmotor9.h:143
analog_in_resolution_t resolution
Definition dcmotor9.h:155
float vref
Definition dcmotor9.h:156
pin_name_t pw2
Definition dcmotor9.h:151
uint32_t dev_pwm_freq
Definition dcmotor9.h:154
pin_name_t shd
Definition dcmotor9.h:149
pin_name_t pwm
Definition dcmotor9.h:145
pin_name_t pw1
Definition dcmotor9.h:150
pin_name_t an
Definition dcmotor9.h:148
DC Motor 9 Click context object.
Definition dcmotor9.h:123
uint32_t pwm_freq
Definition dcmotor9.h:134
digital_out_t pw2
Definition dcmotor9.h:126
analog_in_t adc
Definition dcmotor9.h:131
pwm_t pwm
Definition dcmotor9.h:129
digital_out_t shd
Definition dcmotor9.h:125