brushless22 2.0.0.0
Brushless 22 Click Driver

API for configuring and manipulating Brushless 22 Click driver. More...

Topics

 Brushless 22 Settings
 Settings for configuration of Brushless 22 Click driver.
 
 Brushless 22 MikroBUS Map
 MikroBUS pin mapping of Brushless 22 Click driver.
 
 Brushless22_cfg
 

Functions

void brushless22_cfg_setup (brushless22_cfg_t *cfg)
 Brushless 22 configuration object setup function.
 
err_t brushless22_init (brushless22_t *ctx, brushless22_cfg_t *cfg)
 Brushless 22 initialization function.
 
err_t brushless22_default_cfg (brushless22_t *ctx)
 Brushless 22 default configuration function.
 
err_t brushless22_set_slew_rate_resistance (brushless22_t *ctx, uint16_t res_ohm)
 Brushless 22 set slew rate resistance function.
 
err_t brushless22_set_rprog (brushless22_t *ctx, uint16_t res_ohm)
 Brushless 22 set rprog function.
 
err_t brushless22_set_duty_cycle (brushless22_t *ctx, float duty_cycle)
 Brushless 22 sets PWM duty cycle.
 
err_t brushless22_pwm_stop (brushless22_t *ctx)
 Brushless 22 stop PWM module.
 
err_t brushless22_pwm_start (brushless22_t *ctx)
 Brushless 22 start PWM module.
 
void brushless22_set_strong_start (brushless22_t *ctx)
 Brushless 22 set strong start function.
 
void brushless22_set_soft_start (brushless22_t *ctx)
 Brushless 22 set soft start function.
 
void brushless22_set_direction (brushless22_t *ctx, uint8_t dir)
 Brushless 22 set direction function.
 
void brushless22_switch_direction (brushless22_t *ctx)
 Brushless 22 switch direction function.
 
void brushless22_set_normal_regulation (brushless22_t *ctx)
 Brushless 22 set normal regulation function.
 
void brushless22_set_low_load_regulation (brushless22_t *ctx)
 Brushless 22 set low load regulation function.
 
uint8_t brushless22_get_fg_pin (brushless22_t *ctx)
 Brushless 22 get fd pin function.
 

Detailed Description

API for configuring and manipulating Brushless 22 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ brushless22_cfg_setup()

void brushless22_cfg_setup ( brushless22_cfg_t * cfg)

Brushless 22 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See brushless22_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ brushless22_default_cfg()

err_t brushless22_default_cfg ( brushless22_t * ctx)

Brushless 22 default configuration function.

This function executes a default configuration of Brushless 22 click board.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ brushless22_get_fg_pin()

uint8_t brushless22_get_fg_pin ( brushless22_t * ctx)

Brushless 22 get fd pin function.

This function returns the FD pin logic state.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ brushless22_init()

err_t brushless22_init ( brushless22_t * ctx,
brushless22_cfg_t * cfg )

Brushless 22 initialization function.

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

Parameters
[out]ctx: Click context object. See brushless22_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See brushless22_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ brushless22_pwm_start()

err_t brushless22_pwm_start ( brushless22_t * ctx)

Brushless 22 start PWM module.

This function starts the PWM module output.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ brushless22_pwm_stop()

err_t brushless22_pwm_stop ( brushless22_t * ctx)

Brushless 22 stop PWM module.

This function stops the PWM module output.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ brushless22_set_direction()

void brushless22_set_direction ( brushless22_t * ctx,
uint8_t dir )

Brushless 22 set direction function.

This function sets the motor direction.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
[in]dir
  • 0 - Forward,
  • 1 - Reverse.
Returns
None.
Note
None.

◆ brushless22_set_duty_cycle()

err_t brushless22_set_duty_cycle ( brushless22_t * ctx,
float duty_cycle )

Brushless 22 sets PWM duty cycle.

This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
[in]duty_cycle: PWM duty cycle.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ brushless22_set_low_load_regulation()

void brushless22_set_low_load_regulation ( brushless22_t * ctx)

Brushless 22 set low load regulation function.

This function sets the low load regulation by setting the RT pin to high logic state.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ brushless22_set_normal_regulation()

void brushless22_set_normal_regulation ( brushless22_t * ctx)

Brushless 22 set normal regulation function.

This function sets the normal regulation by setting the RT pin to low logic state.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ brushless22_set_rprog()

err_t brushless22_set_rprog ( brushless22_t * ctx,
uint16_t res_ohm )

Brushless 22 set rprog function.

This function sets the Rprog resistance by configuring the onboard digital potentiometer.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
[in]res_ohm: Resistance in Ohms (valid values are 3900 and 24000 only).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ brushless22_set_slew_rate_resistance()

err_t brushless22_set_slew_rate_resistance ( brushless22_t * ctx,
uint16_t res_ohm )

Brushless 22 set slew rate resistance function.

This function sets the slew rate resistance by configuring the onboard digital potentiometer.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
[in]res_ohm: Resistance in Ohms (valid values from 4700 to 47000).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ brushless22_set_soft_start()

void brushless22_set_soft_start ( brushless22_t * ctx)

Brushless 22 set soft start function.

This function sets the motor soft start by setting the SS pin to high logic state.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ brushless22_set_strong_start()

void brushless22_set_strong_start ( brushless22_t * ctx)

Brushless 22 set strong start function.

This function sets the motor strong start by setting the SS pin to low logic state.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ brushless22_switch_direction()

void brushless22_switch_direction ( brushless22_t * ctx)

Brushless 22 switch direction function.

This function switches the direction by toggling the DIR pin state.

Parameters
[in]ctx: Click context object. See brushless22_t object definition for detailed explanation.
Returns
None.
Note
None.