brushless8 2.0.0.0
brushless8.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  brushless8_s
 Brushless 8 Click context object. More...
 
struct  brushless8_cfg_t
 Brushless 8 Click configuration object. More...
 

Macros

#define BRUSHLESS8_DAC_REG_DEVICE_CONFIG   0x01
 Brushless 8 description register.
 
#define BRUSHLESS8_DAC_REG_STATUS_TRIGGER   0x02
 
#define BRUSHLESS8_DAC_REG_BRDCAST   0x03
 
#define BRUSHLESS8_DAC_REG_CHN_A_DVSP   0x08
 
#define BRUSHLESS8_DAC_REG_CHN_B_FGC   0x09
 
#define BRUSHLESS8_DAC_REG_CHN_C_LA   0x0A
 
#define BRUSHLESS8_DAC_REG_CHN_D_LAS   0x0B
 
#define BRUSHLESS8_DAC_REG_CHN_E_LAL   0x0C
 
#define BRUSHLESS8_DAC_REG_CHN_F_LAAJ   0x0D
 
#define BRUSHLESS8_DIRECTION_CW   1
 Brushless 8 motor direction control.
 
#define BRUSHLESS8_DIRECTION_CCW   0
 
#define BRUSHLESS8_RESET_EN   1
 Brushless 8 motor reset pin state setting.
 
#define BRUSHLESS8_RESET_DIS   0
 
#define BRUSHLESS8_VREF   5000
 Brushless 8 DAC VREF and ADC resolution.
 
#define BRUSHLESS8_RESOLUTION   1024
 
#define BRUSHLESS8_RETVAL   int8_t
 Brushless 8 function status.
 
#define BRUSHLESS8_OK   0
 
#define BRUSHLESS8_ERROR   (-1)
 
#define BRUSHLESS8_PARAM_ERROR   (-2)
 
#define BRUSHLESS8_FGC_STEP_0   0
 Brushless 8 fcg pin functions.
 
#define BRUSHLESS8_FGC_STEP_1   310
 
#define BRUSHLESS8_FGC_STEP_2   630
 
#define BRUSHLESS8_FGC_STEP_3   940
 
#define BRUSHLESS8_FGC_STEP_4   1250
 
#define BRUSHLESS8_FGC_STEP_5   1560
 
#define BRUSHLESS8_FGC_STEP_6   1880
 
#define BRUSHLESS8_FGC_STEP_7   2190
 
#define BRUSHLESS8_FGC_STEP_8   2500
 
#define BRUSHLESS8_FGC_STEP_9   2810
 
#define BRUSHLESS8_LAS_AUTOMATIC_60_DEG_RST   0
 Brushless 8 LAS pin settings.
 
#define BRUSHLESS8_LAS_AUTOMATIC_360_DEG_RST   1250
 
#define BRUSHLESS8_LAS_EXT_IN_60_DEG_RST   2500
 
#define BRUSHLESS8_LAS_EXT_IN_360_DEG_RST   3750
 
#define BRUSHLESS8_LA_STEP_0_DEG_0   0
 Brushless 8 LA pin settings.
 
#define BRUSHLESS8_LA_STEP_1_DEG_1p9   160
 
#define BRUSHLESS8_LA_STEP_2_DEG_3p8   310
 
#define BRUSHLESS8_LA_STEP_3_DEG_5p6   470
 
#define BRUSHLESS8_LA_STEP_4_DEG_7p5   630
 
#define BRUSHLESS8_LA_STEP_5_DEG_9p4   780
 
#define BRUSHLESS8_LA_STEP_6_DEG_11p3   940
 
#define BRUSHLESS8_LA_STEP_7_DEG_13p1   1090
 
#define BRUSHLESS8_LA_STEP_8_DEG_15   1250
 
#define BRUSHLESS8_LA_STEP_9_DEG_16p9   1410
 
#define BRUSHLESS8_LA_STEP_10_DEG_18p8   1560
 
#define BRUSHLESS8_LA_STEP_11_DEG_20p6   1720
 
#define BRUSHLESS8_LA_STEP_12_DEG_22p5   1880
 
#define BRUSHLESS8_LA_STEP_13_DEG_24p4   2030
 
#define BRUSHLESS8_LA_STEP_14_DEG_26p3   2190
 
#define BRUSHLESS8_LA_STEP_15_DEG_28p1   2340
 
#define BRUSHLESS8_LA_STEP_16_DEG_30   2500
 
#define BRUSHLESS8_LA_STEP_17_DEG_31p9   2660
 
#define BRUSHLESS8_LA_STEP_18_DEG_33p8   2810
 
#define BRUSHLESS8_LA_STEP_19_DEG_35p6   2970
 
#define BRUSHLESS8_LA_STEP_20_DEG_37p5   3130
 
#define BRUSHLESS8_LA_STEP_21_DEG_39p4   3280
 
#define BRUSHLESS8_LA_STEP_22_DEG_41p3   3440
 
#define BRUSHLESS8_LA_STEP_23_DEG_43p1   3590
 
#define BRUSHLESS8_LA_STEP_24_DEG_45   3750
 
#define BRUSHLESS8_LA_STEP_25_DEG_46p9   3910
 
#define BRUSHLESS8_LA_STEP_26_DEG_48p8   4060
 
#define BRUSHLESS8_LA_STEP_27_DEG_50p6   4220
 
#define BRUSHLESS8_LA_STEP_28_DEG_52p5   4380
 
#define BRUSHLESS8_LA_STEP_29_DEG_54p4   4530
 
#define BRUSHLESS8_LA_STEP_30_DEG_56p3   4690
 
#define BRUSHLESS8_LA_STEP_31_DEG_58p1   4840
 
#define BRUSHLESS8_LAL_STEP_0_DEG_0   0
 Brushless 8 LAL pin settings.
 
#define BRUSHLESS8_LAL_STEP_1_DEG_5p6   310
 
#define BRUSHLESS8_LAL_STEP_2_DEG_0   630
 
#define BRUSHLESS8_LAL_STEP_3_DEG_11p3   640
 
#define BRUSHLESS8_LAL_STEP_4_DEG_5p6   1250
 
#define BRUSHLESS8_LAL_STEP_5_DEG_0   1560
 
#define BRUSHLESS8_LAL_STEP_6_DEG_12p2   1880
 
#define BRUSHLESS8_LAL_STEP_7_DEG_6p6   2190
 
#define BRUSHLESS8_LAL_STEP_8_DEG_0   2500
 
#define BRUSHLESS8_LAL_STEP_9_DEG_13p1   2810
 
#define BRUSHLESS8_LAL_STEP_10_DEG_7p5   3130
 
#define BRUSHLESS8_LAL_STEP_11_DEG_0   3440
 
#define BRUSHLESS8_LAL_STEP_12_DEG_18p8   3750
 
#define BRUSHLESS8_LAL_STEP_13_DEG_13p1   4060
 
#define BRUSHLESS8_LAL_STEP_14_DEG_7p5   4380
 
#define BRUSHLESS8_LAL_STEP_15_DEG_0   4690
 
#define BRUSHLESS8_LAAJ_STEP_0_PHASE_DEG_0   0
 Brushless 8 LAAJ pin settings.
 
#define BRUSHLESS8_LAAJ_STEP_1_PHASE_DEG_0   80
 
#define BRUSHLESS8_LAAJ_STEP_2_PHASE_DEG_0   160
 
#define BRUSHLESS8_LAAJ_STEP_3_PHASE_DEG_0   230
 
#define BRUSHLESS8_LAAJ_STEP_4_PHASE_DEG_0   310
 
#define BRUSHLESS8_LAAJ_STEP_5_PHASE_DEG_0   390
 
#define BRUSHLESS8_LAAJ_STEP_6_PHASE_DEG_0   470
 
#define BRUSHLESS8_LAAJ_STEP_7_PHASE_DEG_0   550
 
#define BRUSHLESS8_LAAJ_STEP_8_PHASE_DEG_0p9   630
 
#define BRUSHLESS8_LAAJ_STEP_9_PHASE_DEG_1p9   700
 
#define BRUSHLESS8_LAAJ_STEP_10_PHASE_DEG_2p8   780
 
#define BRUSHLESS8_LAAJ_STEP_11_PHASE_DEG_3p8   860
 
#define BRUSHLESS8_LAAJ_STEP_12_PHASE_DEG_4p7   940
 
#define BRUSHLESS8_LAAJ_STEP_13_PHASE_DEG_5p6   1020
 
#define BRUSHLESS8_LAAJ_STEP_14_PHASE_DEG_6p6   1090
 
#define BRUSHLESS8_LAAJ_STEP_15_PHASE_DEG_7p5   1170
 
#define BRUSHLESS8_LAAJ_STEP_16_PHASE_DEG_8p4   1250
 
#define BRUSHLESS8_LAAJ_STEP_17_PHASE_DEG_9p4   1330
 
#define BRUSHLESS8_LAAJ_STEP_18_PHASE_DEG_10p3   1410
 
#define BRUSHLESS8_LAAJ_STEP_19_PHASE_DEG_11p3   1480
 
#define BRUSHLESS8_LAAJ_STEP_20_PHASE_DEG_12p2   1560
 
#define BRUSHLESS8_LAAJ_STEP_21_PHASE_DEG_13p1   1640
 
#define BRUSHLESS8_LAAJ_STEP_22_PHASE_DEG_13p1   1720
 
#define BRUSHLESS8_LAAJ_STEP_23_PHASE_DEG_15   1800
 
#define BRUSHLESS8_LAAJ_STEP_24_PHASE_DEG_15p9   1880
 
#define BRUSHLESS8_LAAJ_STEP_25_PHASE_DEG_16p9   1950
 
#define BRUSHLESS8_LAAJ_STEP_26_PHASE_DEG_17p8   2030
 
#define BRUSHLESS8_LAAJ_STEP_27_PHASE_DEG_18p8   2110
 
#define BRUSHLESS8_LAAJ_STEP_28_PHASE_DEG_19p7   2190
 
#define BRUSHLESS8_LAAJ_STEP_29_PHASE_DEG_20p6   2270
 
#define BRUSHLESS8_LAAJ_STEP_30_PHASE_DEG_21p6   2340
 
#define BRUSHLESS8_LAAJ_STEP_31_PHASE_DEG_22p5   2420
 
#define BRUSHLESS8_LAAJ_STEP_32_PHASE_DEG_23p4   2500
 
#define BRUSHLESS8_LAAJ_STEP_33_PHASE_DEG_24p4   2580
 
#define BRUSHLESS8_LAAJ_STEP_34_PHASE_DEG_25p3   2660
 
#define BRUSHLESS8_LAAJ_STEP_35_PHASE_DEG_26p3   2730
 
#define BRUSHLESS8_LAAJ_STEP_36_PHASE_DEG_27p2   2810
 
#define BRUSHLESS8_LAAJ_STEP_37_PHASE_DEG_28p1   2890
 
#define BRUSHLESS8_LAAJ_STEP_38_PHASE_DEG_29p1   2970
 
#define BRUSHLESS8_LAAJ_STEP_39_PHASE_DEG_30   3050
 
#define BRUSHLESS8_LAAJ_STEP_40_PHASE_DEG_30   3130
 
#define BRUSHLESS8_LAAJ_STEP_41_PHASE_DEG_30   3200
 
#define BRUSHLESS8_LAAJ_STEP_42_PHASE_DEG_30   3280
 
#define BRUSHLESS8_LAAJ_STEP_43_PHASE_DEG_30   3360
 
#define BRUSHLESS8_LAAJ_STEP_44_PHASE_DEG_30   3440
 
#define BRUSHLESS8_LAAJ_STEP_45_PHASE_DEG_30   3520
 
#define BRUSHLESS8_LAAJ_STEP_46_PHASE_DEG_30   3590
 
#define BRUSHLESS8_LAAJ_STEP_47_PHASE_DEG_30   3670
 
#define BRUSHLESS8_LAAJ_STEP_48_PHASE_DEG_30   3750
 
#define BRUSHLESS8_LAAJ_STEP_49_PHASE_DEG_30   3830
 
#define BRUSHLESS8_LAAJ_STEP_50_PHASE_DEG_30   3910
 
#define BRUSHLESS8_LAAJ_STEP_51_PHASE_DEG_30   3980
 
#define BRUSHLESS8_LAAJ_STEP_52_PHASE_DEG_30   4060
 
#define BRUSHLESS8_LAAJ_STEP_53_PHASE_DEG_30   4140
 
#define BRUSHLESS8_LAAJ_STEP_54_PHASE_DEG_30   4220
 
#define BRUSHLESS8_LAAJ_STEP_55_PHASE_DEG_30   4300
 
#define BRUSHLESS8_LAAJ_STEP_56_PHASE_DEG_30   4380
 
#define BRUSHLESS8_LAAJ_STEP_57_PHASE_DEG_30   4450
 
#define BRUSHLESS8_LAAJ_STEP_58_PHASE_DEG_30   4530
 
#define BRUSHLESS8_LAAJ_STEP_59_PHASE_DEG_30   4610
 
#define BRUSHLESS8_LAAJ_STEP_60_PHASE_DEG_30   4690
 
#define BRUSHLESS8_LAAJ_STEP_61_PHASE_DEG_30   4770
 
#define BRUSHLESS8_LAAJ_STEP_62_PHASE_DEG_30   4840
 
#define BRUSHLESS8_LAAJ_STEP_63_PHASE_DEG_30   4920
 
#define BRUSHLESS8_SLAVE_ADDRESS_1   0x47
 Brushless 8 device address setting.
 
#define BRUSHLESS8_SLAVE_ADDRESS_2   0x48
 
#define BRUSHLESS8_DAC   1
 Brushless 8 motor control settings.
 
#define BRUSHLESS8_PWM   2
 
#define BRUSHLESS8_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef struct brushless8_s brushless8_t
 Brushless 8 Click context object.
 

Functions

void brushless8_cfg_setup (brushless8_cfg_t *cfg)
 Brushless 8 configuration object setup function.
 
BRUSHLESS8_RETVAL brushless8_init (brushless8_t *ctx, brushless8_cfg_t *cfg)
 Brushless 8 initialization function.
 
BRUSHLESS8_RETVAL brushless8_default_cfg (brushless8_t *ctx)
 Brushless 8 default configuration function.
 
void brushless8_dac_write_data (brushless8_t *ctx, uint8_t reg, uint16_t write_data)
 Brushless 8 I2C write function.
 
uint16_t brushless8_dac_read_data (brushless8_t *ctx, uint8_t reg)
 Brushless 8 I2C read function.
 
uint8_t brushless8_get_fg (brushless8_t *ctx)
 Brushless 8 fg state.
 
void brushless8_set_direction (brushless8_t *ctx, uint8_t status)
 Brushless 8 dir pin setting.
 
void brushless8_set_reset (brushless8_t *ctx, uint8_t status)
 Brushless 8 rst pin setting.
 
int8_t brushless8_set_dac_vout (brushless8_t *ctx, uint8_t dac_chn, uint16_t vout)
 Brushless 8 I2C function for setting vout.
 
void brushless8_set_duty_cycle (brushless8_t *ctx, float duty_cycle)
 Sets PWM duty cycle.
 
void brushless8_pwm_stop (brushless8_t *ctx)
 Stops PWM module.
 
void brushless8_pwm_start (brushless8_t *ctx)
 Starts PWM module.
 
BRUSHLESS8_RETVAL brushless8_read_adc (brushless8_t *ctx, uint16_t *data_out)
 ADC read function.
 
BRUSHLESS8_RETVAL brushless8_read_an_voltage (brushless8_t *ctx, float *data_out)
 AN voltage read function.
 

Detailed Description

This file contains API for Brushless 8 Click Driver.

Typedef Documentation

◆ brushless8_t

typedef struct brushless8_s brushless8_t

Brushless 8 Click context object.

Context object definition of Brushless 8 Click driver.