brushless10 2.1.0.0
brushless10.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  brushless10_t
 Brushless 10 Click context object. More...
 
struct  brushless10_cfg_t
 Brushless 10 Click configuration object. More...
 

Macros

#define BRUSHLESS10_DAC_REG_DEVICE_CONFIG   0x01
 Brushless 10 DAC register list.
 
#define BRUSHLESS10_DAC_REG_STATUS_TRIGGER   0x02
 
#define BRUSHLESS10_DAC_REG_BRDCAST   0x03
 
#define BRUSHLESS10_DAC_REG_DACA_DATA_LA   0x08
 
#define BRUSHLESS10_DAC_REG_DACB_DATA_MIN_SP   0x09
 
#define BRUSHLESS10_DAC_REG_DACC_DATA_SEL_LD   0x0A
 
#define BRUSHLESS10_DAC_REG_DACD_DATA_FPWM   0x0B
 
#define BRUSHLESS10_DAC_REG_DACE_DATA_SEL_LA   0x0C
 
#define BRUSHLESS10_DAC_REG_DACF_DATA_SEL_FG   0x0D
 
#define BRUSHLESS10_DAC_REG_DACG_DATA_SEL_SP   0x0E
 
#define BRUSHLESS10_DAC_REG_DACH_DATA_CW_CCW   0x0F
 
#define BRUSHLESS10_DAC_CHA_LA   0
 Brushless 10 DAC channel setting.
 
#define BRUSHLESS10_DAC_CHB_MIN_SP   1
 
#define BRUSHLESS10_DAC_CHC_SEL_LD   2
 
#define BRUSHLESS10_DAC_CHD_FPWM   3
 
#define BRUSHLESS10_DAC_CHE_SEL_LA   4
 
#define BRUSHLESS10_DAC_CHF_SEL_FG   5
 
#define BRUSHLESS10_DAC_CHG_SEL_SP   6
 
#define BRUSHLESS10_DAC_CHH_CW_CCW   7
 
#define BRUSHLESS10_LA0_STEP_0   88
 Brushless 10 lead angle steps, LA channel setting.
 
#define BRUSHLESS10_LA0_STEP_1   234
 
#define BRUSHLESS10_LA0_STEP_2   332
 
#define BRUSHLESS10_LA0_STEP_3   430
 
#define BRUSHLESS10_LA0_STEP_4   527
 
#define BRUSHLESS10_LA0_STEP_5   625
 
#define BRUSHLESS10_LA0_STEP_6   723
 
#define BRUSHLESS10_LA0_STEP_7   820
 
#define BRUSHLESS10_LA0_STEP_8   918
 
#define BRUSHLESS10_LA0_STEP_9   1016
 
#define BRUSHLESS10_LA0_STEP_10   1113
 
#define BRUSHLESS10_LA0_STEP_11   1211
 
#define BRUSHLESS10_LA0_STEP_12   1309
 
#define BRUSHLESS10_LA0_STEP_13   1406
 
#define BRUSHLESS10_LA0_STEP_14   1504
 
#define BRUSHLESS10_LA0_STEP_15   1602
 
#define BRUSHLESS10_LA0_STEP_16   1699
 
#define BRUSHLESS10_LA0_STEP_17   1797
 
#define BRUSHLESS10_LA0_STEP_18   1894
 
#define BRUSHLESS10_LA0_STEP_19   1992
 
#define BRUSHLESS10_LA0_STEP_20   2090
 
#define BRUSHLESS10_LA0_STEP_21   2187
 
#define BRUSHLESS10_LA0_STEP_22   2285
 
#define BRUSHLESS10_LA0_STEP_23   2383
 
#define BRUSHLESS10_LA0_STEP_24   2480
 
#define BRUSHLESS10_LA0_STEP_25   2578
 
#define BRUSHLESS10_LA0_STEP_26   2676
 
#define BRUSHLESS10_LA0_STEP_27   2773
 
#define BRUSHLESS10_LA0_STEP_28   2871
 
#define BRUSHLESS10_LA0_STEP_29   2969
 
#define BRUSHLESS10_LA0_STEP_30   3066
 
#define BRUSHLESS10_LA0_STEP_31   4062
 
#define BRUSHLESS10_LA1_STEP_0   234
 
#define BRUSHLESS10_LA1_STEP_1   673
 
#define BRUSHLESS10_LA1_STEP_2   1064
 
#define BRUSHLESS10_LA1_STEP_3   1455
 
#define BRUSHLESS10_LA1_STEP_4   1845
 
#define BRUSHLESS10_LA1_STEP_5   2236
 
#define BRUSHLESS10_LA1_STEP_6   2627
 
#define BRUSHLESS10_LA1_STEP_7   3916
 
#define BRUSHLESS10_MIN_SP_STEP_0   136
 Brushless 10 minimum output duty steps, MIN_SP channel setting.
 
#define BRUSHLESS10_MIN_SP_STEP_1   478
 
#define BRUSHLESS10_MIN_SP_STEP_2   869
 
#define BRUSHLESS10_MIN_SP_STEP_3   1259
 
#define BRUSHLESS10_MIN_SP_STEP_4   1650
 
#define BRUSHLESS10_MIN_SP_STEP_5   2041
 
#define BRUSHLESS10_MIN_SP_STEP_6   2431
 
#define BRUSHLESS10_MIN_SP_STEP_7   2822
 
#define BRUSHLESS10_MIN_SP_STEP_8   3916
 
#define BRUSHLESS10_FPWM_STEP_0   478
 Brushless 10 FPWM channel setting.
 
#define BRUSHLESS10_FPWM_STEP_1   1455
 
#define BRUSHLESS10_FPWM_STEP_2   2431
 
#define BRUSHLESS10_FPWM_STEP_3   3965
 
#define BRUSHLESS10_SEL_LD_STEP_0   478
 Brushless 10 SEL_LD channel setting.
 
#define BRUSHLESS10_SEL_LD_STEP_1   1455
 
#define BRUSHLESS10_SEL_LD_STEP_2   2431
 
#define BRUSHLESS10_SEL_LD_STEP_3   3965
 
#define BRUSHLESS10_SEL_FG_STEP_0   967
 Brushless 10 SEL_FG channel setting.
 
#define BRUSHLESS10_SEL_FG_STEP_1   3476
 
#define BRUSHLESS10_SEL_SP_STEP_0   478
 Brushless 10 SEL_SP channel setting.
 
#define BRUSHLESS10_SEL_SP_STEP_1   1943
 
#define BRUSHLESS10_SEL_SP_STEP_2   3965
 
#define BRUSHLESS10_SEL_LA_STEP_0   478
 Brushless 10 SEL_LA channel setting.
 
#define BRUSHLESS10_SEL_LA_STEP_1   1943
 
#define BRUSHLESS10_SEL_LA_STEP_2   3965
 
#define BRUSHLESS10_CW_CCW_0   0
 Brushless 10 CW_CCW channel setting.
 
#define BRUSHLESS10_CW_CCW_1   5000
 
#define BRUSHLESS10_DAC_VREF   5000
 Brushless 10 DAC vout setting.
 
#define BRUSHLESS10_DAC_RESOLUTION   256
 
#define BRUSHLESS10_DAC_ROUND_TO_INT   0.5f
 
#define BRUSHLESS10_DAC_CONFIG_PDN_ALL   0x0100
 Brushless 10 DAC DEVICE_CONFIG register setting.
 
#define BRUSHLESS10_DAC_CONFIG_PDN_CHA   0x0001
 
#define BRUSHLESS10_DAC_CONFIG_PDN_CHB   0x0002
 
#define BRUSHLESS10_DAC_CONFIG_PDN_CHC   0x0004
 
#define BRUSHLESS10_DAC_CONFIG_PDN_CHD   0x0008
 
#define BRUSHLESS10_DAC_CONFIG_PDN_CHE   0x0010
 
#define BRUSHLESS10_DAC_CONFIG_PDN_CHF   0x0020
 
#define BRUSHLESS10_DAC_CONFIG_PDN_CHG   0x0040
 
#define BRUSHLESS10_DAC_CONFIG_PDN_CHH   0x0080
 
#define BRUSHLESS10_DAC_CONFIG_ENABLE_ALL_CH   0x0000
 
#define BRUSHLESS10_DAC_DEVICE_ID   0x0500
 Brushless 10 DAC STATUS/TRIGGER register setting.
 
#define BRUSHLESS10_DAC_DEVICE_ID_MASK   0x0FC0
 
#define BRUSHLESS10_DAC_SW_RESET   0x000A
 
#define BRUSHLESS10_DEF_FREQ   50000
 Brushless 10 default PWM frequency.
 
#define BRUSHLESS10_DAC_DEVICE_ADDRESS_BROADCAST   0x47
 Brushless 10 device address setting.
 
#define BRUSHLESS10_DAC_DEVICE_ADDRESS_0   0x48
 
#define BRUSHLESS10_DAC_DEVICE_ADDRESS_1   0x49
 
#define BRUSHLESS10_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  brushless10_return_value_t { BRUSHLESS10_OK = 0 , BRUSHLESS10_ERROR = -1 }
 Brushless 10 Click return value data. More...
 

Functions

void brushless10_cfg_setup (brushless10_cfg_t *cfg)
 Brushless 10 configuration object setup function.
 
err_t brushless10_init (brushless10_t *ctx, brushless10_cfg_t *cfg)
 Brushless 10 initialization function.
 
err_t brushless10_default_cfg (brushless10_t *ctx)
 Brushless 10 default configuration function.
 
err_t brushless10_dac_write (brushless10_t *ctx, uint8_t reg, uint16_t data_in)
 Brushless 10 DAC write function.
 
err_t brushless10_dac_read (brushless10_t *ctx, uint8_t reg, uint16_t *data_out)
 Brushless 10 DAC read function.
 
err_t brushless10_set_duty_cycle (brushless10_t *ctx, float duty_cycle)
 Brushless 10 sets PWM duty cycle.
 
err_t brushless10_pwm_stop (brushless10_t *ctx)
 Brushless 10 stop PWM module.
 
err_t brushless10_pwm_start (brushless10_t *ctx)
 Brushless 10 start PWM module.
 
uint8_t brushless10_get_fg_out_pin (brushless10_t *ctx)
 Brushless 10 get fg out pin function.
 
uint8_t brushless10_get_ld_out_pin (brushless10_t *ctx)
 Brushless 10 get ld out pin function.
 
void brushless10_pull_brake (brushless10_t *ctx)
 Brushless 10 pull brake function.
 
void brushless10_release_brake (brushless10_t *ctx)
 Brushless 10 release brake function.
 
err_t brushless10_dac_check_com (brushless10_t *ctx)
 Brushless 10 DAC check com function.
 
err_t brushless10_dac_sw_reset (brushless10_t *ctx)
 Brushless 10 DAC sw reset function.
 
err_t brushless10_dac_set_data (brushless10_t *ctx, uint8_t channel, uint8_t data_in)
 Brushless 10 DAC set data function.
 
err_t brushless10_dac_set_vout (brushless10_t *ctx, uint8_t channel, uint16_t vout_mv)
 Brushless 10 DAC set vout function.
 

Detailed Description

This file contains API for Brushless 10 Click Driver.

Enumeration Type Documentation

◆ brushless10_return_value_t

Brushless 10 Click return value data.

Predefined enum values for driver return values.

Enumerator
BRUSHLESS10_OK 
BRUSHLESS10_ERROR