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 BRUSHLESS2_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
68 cfg.cfg = MIKROBUS( mikrobus, MIKROBUS_AN ); \
69 cfg.fr = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.fgs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
78#define BRUSHLESS2_RETVAL uint8_t
80#define BRUSHLESS2_OK 0x00
81#define BRUSHLESS2_INIT_ERROR 0xFF
88#define BRUSHLESS2_DEF_FREQ 5000
#define BRUSHLESS2_RETVAL
Definition brushless2.h:78
void brushless2_invert_direction(brushless2_t *ctx)
Invert the direction of rotation.
void brushless2_pwm_start(brushless2_t *ctx)
Start PWM module.
void brushless2_cfg_setup(brushless2_cfg_t *cfg)
Config Object Initialization function.
void brushless2_set_duty_cycle(brushless2_t *ctx, float duty_cycle)
Generic sets PWM duty cycle.
uint8_t brushless2_get_interrupt_status(brushless2_t *ctx)
Get Interrupt pin state function.
void brushless2_pwm_stop(brushless2_t *ctx)
Stop PWM module.
void brushless2_clockwise(brushless2_t *ctx)
Set the direction of rotation in the clockwise direction function.
void brushless2_counter_clockwise(brushless2_t *ctx)
Set the direction of rotation in the counterclockwise direction function.
BRUSHLESS2_RETVAL brushless2_init(brushless2_t *ctx, brushless2_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition brushless2.h:128
pin_name_t fgs
Definition brushless2.h:137
pin_name_t cfg
Definition brushless2.h:135
uint32_t dev_pwm_freq
Definition brushless2.h:142
pin_name_t int_pin
Definition brushless2.h:138
pin_name_t pwm
Definition brushless2.h:131
pin_name_t fr
Definition brushless2.h:136
Click ctx object definition.
Definition brushless2.h:102
digital_out_t fgs
Definition brushless2.h:107
digital_in_t cfg
Definition brushless2.h:111
uint32_t pwm_freq
Definition brushless2.h:120
digital_in_t int_pin
Definition brushless2.h:112
pwm_t pwm
Definition brushless2.h:116
digital_out_t fr
Definition brushless2.h:106