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 DCMOTOR18_DEF_FREQ 5000
92#define DCMOTOR18_MAP_MIKROBUS( cfg, mikrobus ) \
93 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
94 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
95 cfg.pw2 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
96 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
97 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
dcmotor18_return_value_t
DC Motor 18 Click return value data.
Definition dcmotor18.h:157
@ DCMOTOR18_ERROR
Definition dcmotor18.h:159
@ DCMOTOR18_OK
Definition dcmotor18.h:158
err_t dcmotor18_set_speed_percentage(dcmotor18_t *ctx, float speed_percentage)
Set speed output percentage.
err_t dcmotor18_read_an_pin_voltage(dcmotor18_t *ctx, float *data_out)
DC Motor 18 read AN pin voltage level function.
void dcmotor18_set_direction(dcmotor18_t *ctx, uint8_t state)
Set diretion of motor rotation.
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_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_read_an_pin_current(dcmotor18_t *ctx, float *data_out)
Read AN pin current.
void dcmotor18_set_enable(dcmotor18_t *ctx, uint8_t state)
Set enable pin state.
void dcmotor18_cfg_setup(dcmotor18_cfg_t *cfg)
DC Motor 18 configuration object setup function.
uint8_t dcmotor18_get_interrupt(dcmotor18_t *ctx)
Get interrupt pin state.
err_t dcmotor18_init(dcmotor18_t *ctx, dcmotor18_cfg_t *cfg)
DC Motor 18 initialization function.
err_t dcmotor18_pwm_stop(dcmotor18_t *ctx)
DC Motor 18 stop PWM module.
DC Motor 18 Click configuration object.
Definition dcmotor18.h:135
analog_in_resolution_t resolution
Definition dcmotor18.h:147
float vref
Definition dcmotor18.h:148
pin_name_t pw2
Definition dcmotor18.h:141
uint32_t dev_pwm_freq
Definition dcmotor18.h:146
pin_name_t en
Definition dcmotor18.h:142
pin_name_t int_pin
Definition dcmotor18.h:143
pin_name_t pwm
Definition dcmotor18.h:137
pin_name_t an
Definition dcmotor18.h:138
DC Motor 18 Click driver selector.
Definition dcmotor18.h:112
uint32_t pwm_freq
Definition dcmotor18.h:125
digital_out_t pw2
Definition dcmotor18.h:114
digital_in_t int_pin
Definition dcmotor18.h:118
digital_out_t en
Definition dcmotor18.h:115
uint8_t direction
Definition dcmotor18.h:126
analog_in_t adc
Definition dcmotor18.h:122
pwm_t pwm
Definition dcmotor18.h:121