brushless3 2.0.0.0

Functions

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

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()

err_t brushless3_check_fault_code ( brushless3_t * ctx,
uint8_t * fault_code )

Check fault code function.

Parameters
ctxClick object.
fault_code
- 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;
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_check_motor_lock ( brushless3_t * ctx,
uint8_t * motor_lock )

Check indicate that the motor is locked function.

Parameters
ctxClick object.
motor_lock0 - Device is operational; 1 - Device its into sleep or standby mode;
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_check_over_temp ( brushless3_t * ctx,
uint8_t * over_temp )

Check indicate device temperature is over its limits function.

Parameters
ctxClick object.
over_temp0 - OK; 1 - Temperature is over its limits;
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_check_sleep_mode ( brushless3_t * ctx,
uint8_t * sleep_mode )

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

Parameters
ctxClick object.
sleep_mode0 - Device is operational; 1 - Device its into sleep or standby mode;
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_copy_eeprom ( brushless3_t * ctx)

Copy EEPROM data to register function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_default_cfg ( brushless3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @description This function executes default configuration for Brushless3 click.

◆ brushless3_dis_config()

err_t brushless3_dis_config ( brushless3_t * ctx)

Disable the writing to the configuration registers function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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_dis_sleep_mode()

err_t brushless3_dis_sleep_mode ( brushless3_t * ctx)

Disable entering into sleep or standby mode function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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_dis_write_eeprom()

err_t brushless3_dis_write_eeprom ( brushless3_t * ctx)

Disable the writing to the EEPROM registers function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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_en_config()

err_t brushless3_en_config ( brushless3_t * ctx)

Enable the writing to the configuration registers function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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_en_prog_eeprom()

err_t brushless3_en_prog_eeprom ( brushless3_t * ctx)

Set prog key function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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_en_write_eeprom()

err_t brushless3_en_write_eeprom ( brushless3_t * ctx)

Enable the writing to the EEPROM registers function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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_int_pin()

uint8_t brushless3_get_int_pin ( 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()

err_t brushless3_get_period ( brushless3_t * ctx,
float * period )

Get motor period function.

Parameters
ctxClick object.
periodfloat value of motor period ( ms );
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_get_speed ( brushless3_t * ctx,
float * speed )

Get speed function.

Parameters
ctxClick object.
speedfloat value of motor speed ( Hz );
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_get_speed_cmd ( brushless3_t * ctx,
float * speed_cmd )

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

Parameters
ctxClick object.
speed_cmdfloat speed command ( % );
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_get_supply_voltage ( brushless3_t * ctx,
float * voltage )

Get the supply voltage function.

Parameters
ctxClick object.
voltagefloat value of the supply voltage;
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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_vel_const()

err_t brushless3_get_vel_const ( brushless3_t * ctx,
float * velocity )

Get measured velocity constant function.

Parameters
ctxClick object.
velocityfloat value of velocity constant ( V/Hz );
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t 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()

err_t brushless3_pwm_start ( brushless3_t * ctx)

Start PWM module.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @description This function starts PWM module.

◆ brushless3_pwm_stop()

err_t brushless3_pwm_stop ( brushless3_t * ctx)

Stop PWM module.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @description This function stops PWM module.

◆ brushless3_read_data()

err_t brushless3_read_data ( brushless3_t * ctx,
uint8_t reg_addr,
uint8_t * read_data )

Read function.

Parameters
ctxClick object.
reg_addrRegister address.
read_dataByte of data read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_set_an_mode ( brushless3_t * ctx)

Set Analog mode function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_set_default_param ( brushless3_t * ctx)

Set default parameter function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_set_duty_cycle ( brushless3_t * ctx,
float duty_cycle )

Generic sets PWM duty cycle.

Parameters
ctxClick object.
duty_cycleDuty cycle.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @description This function sets the PWM duty cycle.

◆ brushless3_set_pwm_mode()

err_t brushless3_set_pwm_mode ( brushless3_t * ctx)

Set PWM mode function.

Parameters
ctxClick object.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t brushless3_set_speed ( brushless3_t * ctx,
uint16_t motor_speed_hz )

Set speed function.

Parameters
ctxClick object.
motor_speed_hzvalue of motor speed ( Hz );
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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_speed_pwm()

err_t brushless3_set_speed_pwm ( brushless3_t * ctx,
uint16_t motor_speed_hz )

Set speed PWM function.

Parameters
ctxClick object.
motor_speed_hzvalue of motor speed ( Hz );
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @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()

err_t 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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation. @description This function writes data to the desired register.