brushless4 2.0.0.0

Functions

void brushless4_cfg_setup (brushless4_cfg_t *cfg)
 Config Object Initialization function.
 
BRUSHLESS4_RETVAL brushless4_init (brushless4_t *ctx, brushless4_cfg_t *cfg)
 Initialization function.
 
void brushless4_default_cfg (brushless4_t *ctx)
 Click Default Configuration function.
 
void brushless4_set_duty_cycle (brushless4_t *ctx, float duty_cycle)
 Generic sets PWM duty cycle.
 
void brushless4_pwm_stop (brushless4_t *ctx)
 Stop PWM module.
 
void brushless4_pwm_start (brushless4_t *ctx)
 Start PWM module.
 
void brushless4_motor_parameters (brushless4_t *ctx, uint8_t poles, uint8_t slots)
 Setting the number of poles and number of slots.
 
uint16_t brushless4_get_speed (brushless4_t *ctx, uint16_t pulse_sample)
 Calculation of speed.
 
void brushless4_pwm_pin (brushless4_t *ctx, uint8_t state)
 Set the state of the PWM pin.
 
uint8_t brushless4_fg_get (brushless4_t *ctx)
 The state of the interrupt pin.
 

Detailed Description

Function Documentation

◆ brushless4_cfg_setup()

void brushless4_cfg_setup ( brushless4_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.

◆ brushless4_default_cfg()

void brushless4_default_cfg ( brushless4_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Brushless 4 click.

◆ brushless4_fg_get()

uint8_t brushless4_fg_get ( brushless4_t * ctx)

The state of the interrupt pin.

Parameters
ctxClick object.
Returns
State of the fg pin.

@description This function gets the state of the fg pin.

◆ brushless4_get_speed()

uint16_t brushless4_get_speed ( brushless4_t * ctx,
uint16_t pulse_sample )

Calculation of speed.

Parameters
ctxClick object.
pulse_sampleNumber of samples.
Returns
Rotor speed.

@description This function calculate the speed out of number of samples acumulated over a period of time.

Note
: Motor parameters must be set.

◆ brushless4_init()

BRUSHLESS4_RETVAL brushless4_init ( brushless4_t * ctx,
brushless4_cfg_t * cfg )

Initialization function.

Parameters
brushless4Click object.
cfgClick configuration structure.

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

◆ brushless4_motor_parameters()

void brushless4_motor_parameters ( brushless4_t * ctx,
uint8_t poles,
uint8_t slots )

Setting the number of poles and number of slots.

Parameters
ctxClick object.
polesNumber of poles.
slotsNumber of slots.

@description This function is used for setting the number of poles and number of slots.

◆ brushless4_pwm_pin()

void brushless4_pwm_pin ( brushless4_t * ctx,
uint8_t state )

Set the state of the PWM pin.

Parameters
ctxClick object.
stateDesired state to be set.

@description This function sets the state of the PWM pin.

◆ brushless4_pwm_start()

void brushless4_pwm_start ( brushless4_t * ctx)

Start PWM module.

Parameters
ctxClick object.

@description This function starts PWM module.

◆ brushless4_pwm_stop()

void brushless4_pwm_stop ( brushless4_t * ctx)

Stop PWM module.

Parameters
ctxClick object.

@description This function stops PWM module.

◆ brushless4_set_duty_cycle()

void brushless4_set_duty_cycle ( brushless4_t * ctx,
float duty_cycle )

Generic sets PWM duty cycle.

Parameters
ctxClick object.
duty_cycleDuty cycle.

@description This function sets the PWM duty cycle.