brushless9 2.0.0.0
Brushless 9 Click Driver

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

Topics

 Brushless 9 PWM Settings
 Settings for configuration of Brushless 9 Click driver.
 
 Brushless 9 MikroBUS Map
 MikroBUS pin mapping of Brushless 9 Click driver.
 
 Brushless9_cfg
 

Functions

void brushless9_cfg_setup (brushless9_cfg_t *cfg)
 Brushless 9 configuration object setup function.
 
err_t brushless9_init (brushless9_t *ctx, brushless9_cfg_t *cfg)
 Brushless 9 initialization function.
 
err_t brushless9_set_duty_cycle (brushless9_t *ctx, float duty_cycle)
 Brushless 9 sets PWM duty cycle.
 
err_t brushless9_pwm_stop (brushless9_t *ctx)
 Brushless 9 stop PWM module.
 
err_t brushless9_pwm_start (brushless9_t *ctx)
 Brushless 9 start PWM module.
 
void brushless9_set_dir (brushless9_t *ctx, uint8_t state)
 Brushless 9 dir pin setting.
 
void brushless9_set_brk (brushless9_t *ctx, uint8_t state)
 Brushless 9 brk pin setting.
 
uint8_t brushless9_get_fg (brushless9_t *ctx)
 Brushless 9 fg state.
 
uint8_t brushless9_get_int_pin (brushless9_t *ctx)
 Brushless 9 int_pin state.
 

Detailed Description

API for configuring and manipulating Brushless 9 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

◆ brushless9_cfg_setup()

void brushless9_cfg_setup ( brushless9_cfg_t * cfg)

Brushless 9 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ brushless9_get_fg()

uint8_t brushless9_get_fg ( brushless9_t * ctx)

Brushless 9 fg state.

This function reads fg pin input state.

Parameters
[in]ctxClick context object. See brushless9_t object definition for detailed explanation.
Returns
  • 0 - logical state low,
  • 1 - logical state high.

◆ brushless9_get_int_pin()

uint8_t brushless9_get_int_pin ( brushless9_t * ctx)

Brushless 9 int_pin state.

This function reads int_pin pin input state.

Parameters
[in]ctxClick context object. See brushless9_t object definition for detailed explanation.
Returns
  • 0 - logical state low,
  • 1 - logical state high.

◆ brushless9_init()

err_t brushless9_init ( brushless9_t * ctx,
brushless9_cfg_t * cfg )

Brushless 9 initialization function.

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

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

◆ brushless9_pwm_start()

err_t brushless9_pwm_start ( brushless9_t * ctx)

Brushless 9 start PWM module.

This function starts the PWM moudle output.

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

◆ brushless9_pwm_stop()

err_t brushless9_pwm_stop ( brushless9_t * ctx)

Brushless 9 stop PWM module.

This function stops the PWM moudle output.

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

◆ brushless9_set_brk()

void brushless9_set_brk ( brushless9_t * ctx,
uint8_t state )

Brushless 9 brk pin setting.

This function sets brk pin output to status setting.

Parameters
[in]ctxClick context object. See brushless9_t object definition for detailed explanation.
[in]stateOutput value setting.
  • 0 - digital out high,
  • 1 - digital out low.

◆ brushless9_set_dir()

void brushless9_set_dir ( brushless9_t * ctx,
uint8_t state )

Brushless 9 dir pin setting.

This function sets dir pin output to status setting.

Parameters
[in]ctxClick context object. See brushless9_t object definition for detailed explanation.
[in]stateOutput value setting.
  • 0 - digital out high,
  • 1 - digital out low.

◆ brushless9_set_duty_cycle()

err_t brushless9_set_duty_cycle ( brushless9_t * ctx,
float duty_cycle )

Brushless 9 sets PWM duty cycle.

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

Parameters
[out]ctx: Click context object. See brushless9_t object definition for detailed explanation.
[in]duty_ratio: PWM duty_ratio.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.