42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
55#include "drv_analog_in.h"
67#define BRUSHLESS_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
69 cfg.an_pin = MIKROBUS( mikrobus, MIKROBUS_AN ); \
70 cfg.dir = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
78#define BRUSHLESS_RETVAL uint8_t
80#define BRUSHLESS_OK 0x00
81#define BRUSHLESS_INIT_ERROR 0xFF
88#define BRUSHLESS_DEF_FREQ 5000
#define BRUSHLESS_RETVAL
Definition brushless.h:78
brushless_data_t brushless_generic_read(brushless_t *ctx)
Generic read function.
void brushless_pwm_stop(brushless_t *ctx)
Stop PWM module.
uint8_t brushless_read_rotation_speed_sensor_output(brushless_t *ctx)
Read rotation speed sensor output function.
void brushless_spin_clockwise(brushless_t *ctx)
Spin motor clockwise function.
void brushless_pwm_start(brushless_t *ctx)
Start PWM module.
void brushless_spin_counter_clockwise(brushless_t *ctx)
Spin motor counter clockwise function.
BRUSHLESS_RETVAL brushless_init(brushless_t *ctx, brushless_cfg_t *cfg)
Initialization function.
void brushless_cfg_setup(brushless_cfg_t *cfg)
Config Object Initialization function.
void brushless_set_duty_cycle(brushless_t *ctx, float duty_cycle)
Generic sets PWM duty cycle.
uint16_t brushless_data_t
Analog data type.
Definition brushless.h:101
Click configuration structure definition.
Definition brushless.h:131
analog_in_resolution_t resolution
Definition brushless.h:146
float vref
Definition brushless.h:147
pin_name_t an_pin
Definition brushless.h:135
uint32_t dev_pwm_freq
Definition brushless.h:144
pin_name_t dir
Definition brushless.h:139
pin_name_t int_pin
Definition brushless.h:140
pin_name_t pwm
Definition brushless.h:134
Click ctx object definition.
Definition brushless.h:107
uint32_t pwm_freq
Definition brushless.h:123
digital_in_t int_pin
Definition brushless.h:114
analog_in_t adc
Definition brushless.h:119
pwm_t pwm
Definition brushless.h:118
digital_out_t dir
Definition brushless.h:110