brushless22 2.0.0.0
brushless22.h File Reference

This file contains API for Brushless 22 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_pwm.h"

Go to the source code of this file.

Data Structures

struct  brushless22_t
 Brushless 22 Click driver selector. More...
 
struct  brushless22_cfg_t
 Brushless 22 Click configuration object. More...
 

Macros

#define BRUSHLESS22_DIGIPOT_MAX_VALUE   100000ul
 Brushless 22 digipot settings.
 
#define BRUSHLESS22_DIGIPOT_RESOLUTION   257
 
#define BRUSHLESS22_ROUND_TO_NEAREST_INT   0.5
 
#define BRUSHLESS22_SLEW_RATE_RES_MAX   47000
 
#define BRUSHLESS22_SLEW_RATE_RES_DEFAULT   10000
 
#define BRUSHLESS22_SLEW_RATE_RES_MIN   4700
 
#define BRUSHLESS22_RPROG_3900   3900
 
#define BRUSHLESS22_RPROG_24000   24000
 
#define BRUSHLESS22_RPROG_ADDRESS   0x10
 
#define BRUSHLESS22_ADDR_A2A1A0_000   0x28
 Brushless 22 device address setting.
 
#define BRUSHLESS22_ADDR_A2A1A0_001   0x29
 
#define BRUSHLESS22_ADDR_A2A1A0_010   0x2A
 
#define BRUSHLESS22_ADDR_A2A1A0_011   0x2B
 
#define BRUSHLESS22_ADDR_A2A1A0_100   0x2C
 
#define BRUSHLESS22_ADDR_A2A1A0_101   0x2D
 
#define BRUSHLESS22_ADDR_A2A1A0_110   0x2E
 
#define BRUSHLESS22_ADDR_A2A1A0_111   0x2F
 
#define BRUSHLESS22_DIR_FORWARD   0
 Brushless 22 direction setting.
 
#define BRUSHLESS22_DIR_REVERSE   1
 
#define BRUSHLESS22_DEF_FREQ   50000
 Brushless 22 default PWM frequency.
 
#define BRUSHLESS22_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  brushless22_return_value_t { BRUSHLESS22_OK = 0 , BRUSHLESS22_ERROR = -1 }
 Brushless 22 Click return value data. More...
 

Functions

void brushless22_cfg_setup (brushless22_cfg_t *cfg)
 Brushless 22 configuration object setup function.
 
err_t brushless22_init (brushless22_t *ctx, brushless22_cfg_t *cfg)
 Brushless 22 initialization function.
 
err_t brushless22_default_cfg (brushless22_t *ctx)
 Brushless 22 default configuration function.
 
err_t brushless22_set_slew_rate_resistance (brushless22_t *ctx, uint16_t res_ohm)
 Brushless 22 set slew rate resistance function.
 
err_t brushless22_set_rprog (brushless22_t *ctx, uint16_t res_ohm)
 Brushless 22 set rprog function.
 
err_t brushless22_set_duty_cycle (brushless22_t *ctx, float duty_cycle)
 Brushless 22 sets PWM duty cycle.
 
err_t brushless22_pwm_stop (brushless22_t *ctx)
 Brushless 22 stop PWM module.
 
err_t brushless22_pwm_start (brushless22_t *ctx)
 Brushless 22 start PWM module.
 
void brushless22_set_strong_start (brushless22_t *ctx)
 Brushless 22 set strong start function.
 
void brushless22_set_soft_start (brushless22_t *ctx)
 Brushless 22 set soft start function.
 
void brushless22_set_direction (brushless22_t *ctx, uint8_t dir)
 Brushless 22 set direction function.
 
void brushless22_switch_direction (brushless22_t *ctx)
 Brushless 22 switch direction function.
 
void brushless22_set_normal_regulation (brushless22_t *ctx)
 Brushless 22 set normal regulation function.
 
void brushless22_set_low_load_regulation (brushless22_t *ctx)
 Brushless 22 set low load regulation function.
 
uint8_t brushless22_get_fg_pin (brushless22_t *ctx)
 Brushless 22 get fd pin function.
 

Detailed Description

This file contains API for Brushless 22 Click Driver.

Enumeration Type Documentation

◆ brushless22_return_value_t

Brushless 22 Click return value data.

Predefined enum values for driver return values.

Enumerator
BRUSHLESS22_OK 
BRUSHLESS22_ERROR