brushless3  2.0.0.0
Functions

Functions

void brushless3_cfg_setup (brushless3_cfg_t *cfg)
 Config Object Initialization function. More...
 
BRUSHLESS3_RETVAL brushless3_init (brushless3_t *ctx, brushless3_cfg_t *cfg)
 Initialization function. More...
 
void brushless3_default_cfg (brushless3_t *ctx)
 Click Default Configuration function. More...
 
void brushless3_write_data (brushless3_t *ctx, uint8_t reg_addr, uint8_t write_data)
 Write function. More...
 
uint8_t brushless3_read_data (brushless3_t *ctx, uint8_t reg_addr)
 Read function. More...
 
void brushless3_set_default_param (brushless3_t *ctx)
 Set default parameter function. More...
 
void brushless3_set_pwm_mode (brushless3_t *ctx)
 Set PWM mode function. More...
 
void brushless3_set_an_mode (brushless3_t *ctx)
 Set Analog mode function. More...
 
void brushless3_disable_sleep_mode (brushless3_t *ctx)
 Disable entering into sleep or standby mode function. More...
 
void brushless3_enable_config (brushless3_t *ctx)
 Enable the writing to the configuration registers function. More...
 
void brushless3_disable_config (brushless3_t *ctx)
 Disable the writing to the configuration registers function. More...
 
void brushless3_copy_eeprom (brushless3_t *ctx)
 Copy EEPROM data to register function. More...
 
void brushless3_enable_write_eeprom (brushless3_t *ctx)
 Enable the writing to the EEPROM registers function. More...
 
void brushless3_disable_write_eeprom (brushless3_t *ctx)
 Disable the writing to the EEPROM registers function. More...
 
uint8_t brushless3_check_over_temp (brushless3_t *ctx)
 Check indicate device temperature is over its limits function. More...
 
uint8_t brushless3_check_sleep_mode (brushless3_t *ctx)
 Check indicate that device went into sleep or standby mode function. More...
 
uint8_t brushless3_check_motor_lock (brushless3_t *ctx)
 Check indicate that the motor is locked function. More...
 
float brushless3_get_supply_voltage_value (brushless3_t *ctx)
 Get the supply voltage function. More...
 
float brushless3_get_speed_cmd (brushless3_t *ctx)
 Get the speed command ( % ) based on analog or PWM or I2C function. More...
 
uint8_t brushless3_check_fault_code (brushless3_t *ctx)
 Check fault code function. More...
 
float brushless3_get_speed (brushless3_t *ctx)
 Get speed function. More...
 
void brushless3_set_speed (brushless3_t *ctx, uint16_t motor_speed_hz)
 Set speed function. More...
 
void brushless3_set_speedPWM (brushless3_t *ctx, uint16_t motor_speed_hz)
 Set speed PWM function. More...
 
float brushless3_get_period (brushless3_t *ctx)
 Get motor period function. More...
 
void brushless3_enable_programming_eeprom (brushless3_t *ctx)
 Set prog key function. More...
 
float brushless3_get_velocity_constant (brushless3_t *ctx)
 Get measured velocity constant function. More...
 
void brushless3_forward_direction (brushless3_t *ctx)
 Set the direction of rotation in the forward direction function. More...
 
void brushless3_reverse_direction (brushless3_t *ctx)
 Set the direction of rotation in the reverse direction function. More...
 
uint8_t brushless3_get_interrupt_status (brushless3_t *ctx)
 Get Interrupt pin state function. More...
 
void brushless3_set_duty_cycle (brushless3_t *ctx, float duty_cycle)
 Generic sets PWM duty cycle. More...
 
void brushless3_pwm_stop (brushless3_t *ctx)
 Stop PWM module. More...
 
void brushless3_pwm_start (brushless3_t *ctx)
 Start PWM module. More...
 

Detailed Description

Function Documentation

◆ brushless3_cfg_setup()

void brushless3_cfg_setup ( brushless3_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ brushless3_check_fault_code()

uint8_t brushless3_check_fault_code ( brushless3_t ctx)

Check fault code function.

Parameters
ctxClick object.
Returns
  • bit[ 7:6 ] : N/A;
  • bit[ 5 ] : Stuck in closed loop;
  • bit[ 4 ] : Stuck in open loop;
  • bit[ 3 ] : No motor;
  • bit[ 2 ] : Kt abnormal;
  • bit[ 1 ] : Speed abnormal;
  • bit[ 0 ] : Lock detection current limit;

@description Function check fault code by read 8-bit value from the target Fault Code register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_check_motor_lock()

uint8_t brushless3_check_motor_lock ( brushless3_t ctx)

Check indicate that the motor is locked function.

Parameters
ctxClick object.
Returns
0 - Device is operational; 1 - Device its into sleep or standby mode;

@description Function check indicate that the motor is locked by check bit4 from the target Status register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_check_over_temp()

uint8_t brushless3_check_over_temp ( brushless3_t ctx)

Check indicate device temperature is over its limits function.

Parameters
ctxClick object.
Returns
0 - OK; 1 - Temperature is over its limits;

@description Function check indicate device temperature is over its limits by check bit7 from the target Status register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_check_sleep_mode()

uint8_t brushless3_check_sleep_mode ( brushless3_t ctx)

Check indicate that device went into sleep or standby mode function.

Parameters
ctxClick object.
Returns
0 - Device is operational; 1 - Device its into sleep or standby mode;

@description Function check indicate device went into sleep or standby mode by check bit6 from the target Status register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_copy_eeprom()

void brushless3_copy_eeprom ( brushless3_t ctx)

Copy EEPROM data to register function.

Parameters
ctxClick object.

@description Function copy EEPROM data to register by set bit5 to the target EECtrl register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_default_cfg()

void brushless3_default_cfg ( brushless3_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Brushless3 click.

◆ brushless3_disable_config()

void brushless3_disable_config ( brushless3_t ctx)

Disable the writing to the configuration registers function.

Parameters
ctxClick object.

@description Function enable the writing to the configuration registers by clear bit6 to the target EECtrl register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_disable_sleep_mode()

void brushless3_disable_sleep_mode ( brushless3_t ctx)

Disable entering into sleep or standby mode function.

Parameters
ctxClick object.

@description Function set Analog mode by set bit7 to the target EECtrl register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_disable_write_eeprom()

void brushless3_disable_write_eeprom ( brushless3_t ctx)

Disable the writing to the EEPROM registers function.

Parameters
ctxClick object.

@description Function disable the writing to the EEPROM registers by clear bit4 to the target EECtrl register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_enable_config()

void brushless3_enable_config ( brushless3_t ctx)

Enable the writing to the configuration registers function.

Parameters
ctxClick object.

@description Function enable the writing to the configuration registers by set bit6 to the target EECtrl register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_enable_programming_eeprom()

void brushless3_enable_programming_eeprom ( brushless3_t ctx)

Set prog key function.

Parameters
ctxClick object.

@description Function set prog key by write value of 0xB6 from the target Dev CTRL register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_enable_write_eeprom()

void brushless3_enable_write_eeprom ( brushless3_t ctx)

Enable the writing to the EEPROM registers function.

Parameters
ctxClick object.

@description Function enable the writing to the EEPROM registers by set bit4 to the target EECtrl register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_forward_direction()

void brushless3_forward_direction ( brushless3_t ctx)

Set the direction of rotation in the forward direction function.

Parameters
ctxClick object.

@description Function set the direction of rotation in the forward direction by sets PWM and RST pin on Brushless 3 Click board.

◆ brushless3_get_interrupt_status()

uint8_t brushless3_get_interrupt_status ( brushless3_t ctx)

Get Interrupt pin state function.

Parameters
ctxClick object.
Returns
Interrupt pin state (0 - no active; 1 - active)

@description Function get Interrupt ( INT ) pin state of Brushless 3 Click board.

◆ brushless3_get_period()

float brushless3_get_period ( brushless3_t ctx)

Get motor period function.

Parameters
ctxClick object.
Returns
float value of motor period ( ms );

@description Function get motor period by read value from the two target Motor Period 1 and 2 register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_get_speed()

float brushless3_get_speed ( brushless3_t ctx)

Get speed function.

Parameters
ctxClick object.
Returns
float value of motor speed ( Hz );

@description Function get speed by read value from the two target Motor Speed 1 and 2 register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_get_speed_cmd()

float brushless3_get_speed_cmd ( brushless3_t ctx)

Get the speed command ( % ) based on analog or PWM or I2C function.

Parameters
ctxClick object.
Returns
float speed command ( % );

@description Function get the speed command ( % ) based on analog or PWM or I2C by read the value from the target Speed CMD register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_get_supply_voltage_value()

float brushless3_get_supply_voltage_value ( brushless3_t ctx)

Get the supply voltage function.

Parameters
ctxClick object.
Returns
float value of the supply voltage;

@description Function get the supply voltage by read the value from the target Supply Voltage register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_get_velocity_constant()

float brushless3_get_velocity_constant ( brushless3_t ctx)

Get measured velocity constant function.

Parameters
ctxClick object.
Returns
float value of velocity constant ( V/Hz );

@description Function get measured velocity constant by read value from the two target Motor KT 1 and 2 register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_init()

BRUSHLESS3_RETVAL brushless3_init ( brushless3_t ctx,
brushless3_cfg_t cfg 
)

Initialization function.

Parameters
brushless3Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ brushless3_pwm_start()

void brushless3_pwm_start ( brushless3_t ctx)

Start PWM module.

Parameters
ctxClick object.

@description This function starts PWM module.

◆ brushless3_pwm_stop()

void brushless3_pwm_stop ( brushless3_t ctx)

Stop PWM module.

Parameters
ctxClick object.

@description This function stops PWM module.

◆ brushless3_read_data()

uint8_t brushless3_read_data ( brushless3_t ctx,
uint8_t  reg_addr 
)

Read function.

Parameters
ctxClick object.
reg_addrRegister address.
Returns
8-bit read data

@description This function reads data from the desired register.

◆ brushless3_reverse_direction()

void brushless3_reverse_direction ( brushless3_t ctx)

Set the direction of rotation in the reverse direction function.

Parameters
ctxClick object.

@description Function set the direction of rotation in the reverse direction by sets PWM and clear RST pin on Brushless 3 Click board.

◆ brushless3_set_an_mode()

void brushless3_set_an_mode ( brushless3_t ctx)

Set Analog mode function.

Parameters
ctxClick object.

@description Function set Analog mode by clear bit1 to the target SysOpt9 register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_set_default_param()

void brushless3_set_default_param ( brushless3_t ctx)

Set default parameter function.

Parameters
ctxClick object.

@description Function set default parameter by write the default data to the a few target 8-bit register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_set_duty_cycle()

void brushless3_set_duty_cycle ( brushless3_t ctx,
float  duty_cycle 
)

Generic sets PWM duty cycle.

Parameters
ctxClick object.
duty_cycleDuty cycle.

@description This function sets the PWM duty cycle.

◆ brushless3_set_pwm_mode()

void brushless3_set_pwm_mode ( brushless3_t ctx)

Set PWM mode function.

Parameters
ctxClick object.

@description Function set PWM mode by set bit1 to the target SysOpt9 register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_set_speed()

void brushless3_set_speed ( brushless3_t ctx,
uint16_t  motor_speed_hz 
)

Set speed function.

Parameters
ctxClick object.
motor_speed_hzFloat value of motor speed ( Hz );

@description Function set speed by write the desired value to the two target Speed Ctrl 1 and 2 register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_set_speedPWM()

void brushless3_set_speedPWM ( brushless3_t ctx,
uint16_t  motor_speed_hz 
)

Set speed PWM function.

Parameters
ctxClick object.
motor_speed_hzFloat value of motor speed ( Hz );

@description Function set speed by write the desired value to the two target Speed Ctrl 1 and 2 register address of DRV10983 sensorless BLDC motor driver on Brushless 3 click board.

◆ brushless3_write_data()

void brushless3_write_data ( brushless3_t ctx,
uint8_t  reg_addr,
uint8_t  write_data 
)

Write function.

Parameters
ctxClick object.
reg_addrRegister address.
write_dataByte of data to be written.

@description This function writes data to the desired register.