brushless10 2.1.0.0
Brushless 10 Click Driver

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

Topics

 Brushless 10 Registers List
 List of registers of Brushless 10 Click driver.
 
 Brushless 10 Registers Settings
 Settings for registers of Brushless 10 Click driver.
 
 Brushless 10 MikroBUS Map
 MikroBUS pin mapping of Brushless 10 Click driver.
 

Functions

void brushless10_cfg_setup (brushless10_cfg_t *cfg)
 Brushless 10 configuration object setup function.
 
err_t brushless10_init (brushless10_t *ctx, brushless10_cfg_t *cfg)
 Brushless 10 initialization function.
 
err_t brushless10_default_cfg (brushless10_t *ctx)
 Brushless 10 default configuration function.
 
err_t brushless10_dac_write (brushless10_t *ctx, uint8_t reg, uint16_t data_in)
 Brushless 10 DAC write function.
 
err_t brushless10_dac_read (brushless10_t *ctx, uint8_t reg, uint16_t *data_out)
 Brushless 10 DAC read function.
 
err_t brushless10_set_duty_cycle (brushless10_t *ctx, float duty_cycle)
 Brushless 10 sets PWM duty cycle.
 
err_t brushless10_pwm_stop (brushless10_t *ctx)
 Brushless 10 stop PWM module.
 
err_t brushless10_pwm_start (brushless10_t *ctx)
 Brushless 10 start PWM module.
 
uint8_t brushless10_get_fg_out_pin (brushless10_t *ctx)
 Brushless 10 get fg out pin function.
 
uint8_t brushless10_get_ld_out_pin (brushless10_t *ctx)
 Brushless 10 get ld out pin function.
 
void brushless10_pull_brake (brushless10_t *ctx)
 Brushless 10 pull brake function.
 
void brushless10_release_brake (brushless10_t *ctx)
 Brushless 10 release brake function.
 
err_t brushless10_dac_check_com (brushless10_t *ctx)
 Brushless 10 DAC check com function.
 
err_t brushless10_dac_sw_reset (brushless10_t *ctx)
 Brushless 10 DAC sw reset function.
 
err_t brushless10_dac_set_data (brushless10_t *ctx, uint8_t channel, uint8_t data_in)
 Brushless 10 DAC set data function.
 
err_t brushless10_dac_set_vout (brushless10_t *ctx, uint8_t channel, uint16_t vout_mv)
 Brushless 10 DAC set vout function.
 

Detailed Description

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

◆ brushless10_cfg_setup()

void brushless10_cfg_setup ( brushless10_cfg_t * cfg)

Brushless 10 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ brushless10_dac_check_com()

err_t brushless10_dac_check_com ( brushless10_t * ctx)

Brushless 10 DAC check com function.

This function checks the communication with a DAC by reading and verifying the DAC device ID.

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

◆ brushless10_dac_read()

err_t brushless10_dac_read ( brushless10_t * ctx,
uint8_t reg,
uint16_t * data_out )

Brushless 10 DAC read function.

This function reads a data word from the selected DAC register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See brushless10_t object definition for detailed explanation.
[in]reg: DAC register address.
[out]data_out: 16-bit output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless10_dac_set_data()

err_t brushless10_dac_set_data ( brushless10_t * ctx,
uint8_t channel,
uint8_t data_in )

Brushless 10 DAC set data function.

This function writes the raw data value to the selected DAC channel.

Parameters
[in]ctx: Click context object. See brushless10_t object definition for detailed explanation.
[in]channel: DAC channel.
  • 0 - LA,
  • 1 - MIN_SP,
  • 2 - SEL_LD,
  • 3 - FPWM,
  • 4 - SEL_LA,
  • 5 - SEL_FG,
  • 6 - SEL_SP,
  • 7 - CW_CCW.
[in]data_in: 8-bit RAW DAC data to be set.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The channels 4-7 are disconnected by default on the click board. Refer to the click board schematic.

◆ brushless10_dac_set_vout()

err_t brushless10_dac_set_vout ( brushless10_t * ctx,
uint8_t channel,
uint16_t vout_mv )

Brushless 10 DAC set vout function.

This function sets the voltage output at the selected DAC channel.

Parameters
[in]ctx: Click context object. See brushless10_t object definition for detailed explanation.
[in]channel: DAC channel.
  • 0 - LA,
  • 1 - MIN_SP,
  • 2 - SEL_LD,
  • 3 - FPWM,
  • 4 - SEL_LA,
  • 5 - SEL_FG,
  • 6 - SEL_SP,
  • 7 - CW_CCW.
[in]vout_mv: Voltage output in millivolts to be set [0-5000mV].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The channels 4-7 are disconnected by default on the click board. Refer to the click board schematic.

◆ brushless10_dac_sw_reset()

err_t brushless10_dac_sw_reset ( brushless10_t * ctx)

Brushless 10 DAC sw reset function.

This function performs the DAC software reset.

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

◆ brushless10_dac_write()

err_t brushless10_dac_write ( brushless10_t * ctx,
uint8_t reg,
uint16_t data_in )

Brushless 10 DAC write function.

This function writes a data word to the selected DAC register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See brushless10_t object definition for detailed explanation.
[in]reg: DAC register address.
[in]data_in: 16-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless10_default_cfg()

err_t brushless10_default_cfg ( brushless10_t * ctx)

Brushless 10 default configuration function.

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

Parameters
[in]ctx: Click context object. See brushless10_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.

◆ brushless10_get_fg_out_pin()

uint8_t brushless10_get_fg_out_pin ( brushless10_t * ctx)

Brushless 10 get fg out pin function.

This function returns the FG_OUT pin logic state.

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

◆ brushless10_get_ld_out_pin()

uint8_t brushless10_get_ld_out_pin ( brushless10_t * ctx)

Brushless 10 get ld out pin function.

This function returns the LD_OUT pin logic state.

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

◆ brushless10_init()

err_t brushless10_init ( brushless10_t * ctx,
brushless10_cfg_t * cfg )

Brushless 10 initialization function.

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

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

◆ brushless10_pull_brake()

void brushless10_pull_brake ( brushless10_t * ctx)

Brushless 10 pull brake function.

This function pulls brake by setting the BRAKE pin to high logic state.

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

◆ brushless10_pwm_start()

err_t brushless10_pwm_start ( brushless10_t * ctx)

Brushless 10 start PWM module.

This function starts the PWM module output.

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

◆ brushless10_pwm_stop()

err_t brushless10_pwm_stop ( brushless10_t * ctx)

Brushless 10 stop PWM module.

This function stops the PWM module output.

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

◆ brushless10_release_brake()

void brushless10_release_brake ( brushless10_t * ctx)

Brushless 10 release brake function.

This function releases brake by setting the BRAKE pin to low logic state.

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

◆ brushless10_set_duty_cycle()

err_t brushless10_set_duty_cycle ( brushless10_t * ctx,
float duty_cycle )

Brushless 10 sets PWM duty cycle.

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

Parameters
[in]ctx: Click context object. See brushless10_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.