39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define BRUSHLESS11_DEF_FREQ 5000
79#define BRUSHLESS11_PIN_STATE_HIGH 0x01
80#define BRUSHLESS11_PIN_STATE_LOW 0x00
86#define BRUSHLESS11_BRAKE_ON 0x01
87#define BRUSHLESS11_BRAKE_OFF 0x00
105#define BRUSHLESS11_MAP_MIKROBUS( cfg, mikrobus ) \
106 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
107 cfg.fg1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
108 cfg.brk = MIKROBUS( mikrobus, MIKROBUS_RST ); \
109 cfg.fg2 = MIKROBUS( mikrobus, MIKROBUS_INT );
brushless11_return_value_t
Brushless 11 Click return value data.
Definition brushless11.h:159
@ BRUSHLESS11_ERROR
Definition brushless11.h:161
@ BRUSHLESS11_OK
Definition brushless11.h:160
uint8_t brushless11_get_fg2_pin(brushless11_t *ctx)
Brushless 11 get FG2 pin state function.
void brushless11_set_brk_pin(brushless11_t *ctx, uint8_t pin_state)
Brushless 11 set BRK pin state function.
err_t brushless11_set_speed(brushless11_t *ctx, uint8_t speed)
Brushless 11 set motor speed.
err_t brushless11_pwm_start(brushless11_t *ctx)
Brushless 11 start PWM module.
err_t brushless11_init(brushless11_t *ctx, brushless11_cfg_t *cfg)
Brushless 11 initialization function.
err_t brushless11_pwm_stop(brushless11_t *ctx)
Brushless 11 stop PWM module.
void brushless11_set_brake(brushless11_t *ctx, uint8_t brake_state)
Brushless 11 set motor brake state function.
err_t brushless11_default_cfg(brushless11_t *ctx)
Brushless 11 default configuration function.
void brushless11_cfg_setup(brushless11_cfg_t *cfg)
Brushless 11 configuration object setup function.
uint8_t brushless11_get_fg1_pin(brushless11_t *ctx)
Brushless 11 get FG1 pin state function.
err_t brushless11_set_duty_cycle(brushless11_t *ctx, float duty_cycle)
Brushless 11 sets PWM duty cycle.
Brushless 11 Click configuration object.
Definition brushless11.h:140
uint32_t dev_pwm_freq
Definition brushless11.h:150
pin_name_t pwm
Definition brushless11.h:142
pin_name_t fg2
Definition brushless11.h:147
pin_name_t brk
Definition brushless11.h:146
pin_name_t fg1
Definition brushless11.h:145
Brushless 11 Click context object.
Definition brushless11.h:119
digital_in_t fg2
Definition brushless11.h:125
digital_out_t brk
Definition brushless11.h:121
uint32_t pwm_freq
Definition brushless11.h:131
digital_in_t fg1
Definition brushless11.h:124
pwm_t pwm
Definition brushless11.h:128