brushless25 2.1.0.0
Brushless 25 Click Driver

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

Topics

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

Functions

void brushless25_cfg_setup (brushless25_cfg_t *cfg)
 Brushless 25 configuration object setup function.
 
err_t brushless25_init (brushless25_t *ctx, brushless25_cfg_t *cfg)
 Brushless 25 initialization function.
 
err_t brushless25_set_duty_cycle (brushless25_t *ctx, float duty_cycle)
 Brushless 24 sets PWM duty cycle.
 
err_t brushless25_pwm_stop (brushless25_t *ctx)
 Brushless 24 stop PWM module.
 
err_t brushless25_pwm_start (brushless25_t *ctx)
 Brushless 24 start PWM module.
 
err_t brushless25_default_cfg (brushless25_t *ctx)
 Brushless 25 default configuration function.
 
err_t brushless25_i2c_write (brushless25_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Brushless 25 I2C writing function.
 
err_t brushless25_i2c_read (brushless25_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Brushless 25 I2C reading function.
 
err_t brushless25_spi_write (brushless25_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Brushless 25 SPI writing function.
 
void brushless25_enable_drvoff (brushless25_t *ctx)
 Brushless 25 enable drvoff mode function.
 
void brushless25_disable_drvoff (brushless25_t *ctx)
 Brushless 25 disable drvoff mode function.
 
err_t brushless25_cfg_write (brushless25_t *ctx, uint16_t reg, uint32_t data_in)
 Brushless 25 config writing function.
 
err_t brushless25_cfg_write_with_crc (brushless25_t *ctx, uint16_t reg, uint32_t data_in)
 Brushless 25 config writing function with crc on.
 
err_t brushless25_register_write (brushless25_t *ctx, uint16_t reg, uint32_t data_in)
 Brushless 25 data writing function.
 
err_t brushless25_cfg_read (brushless25_t *ctx, uint16_t reg, uint32_t *data_out)
 Brushless 25 config reading function.
 
err_t brushless25_cfg_read_with_crc (brushless25_t *ctx, uint16_t reg, uint32_t *data_out)
 Brushless 25 config reading function.
 
err_t brushless25_register_read (brushless25_t *ctx, uint16_t reg, uint32_t *data_out)
 Brushless 25 data reading function.
 
err_t brushless25_pot_write (brushless25_t *ctx, uint8_t cmd, uint8_t reg, uint16_t data_in)
 Brushless 25 pot writing function.
 
err_t brushless25_set_wiper_position (brushless25_t *ctx, uint16_t data_in)
 Brushless 25 set pot wiper position function.
 
err_t brushless25_set_speed_ctrl_mode (brushless25_t *ctx, uint8_t mode)
 Brushless 25 set speed control mode function.
 
err_t brushless25_set_speed_value (brushless25_t *ctx, float spd_val)
 Brushless 25 set speed function.
 
err_t brushless25_set_brake_state (brushless25_t *ctx, uint8_t brake_state)
 Brushless 25 set brake state function.
 
err_t brushless25_slow_start_config (brushless25_t *ctx)
 Brushless 25 slow start function.
 
err_t brushless25_fast_start_config (brushless25_t *ctx)
 Brushless 25 fast start function.
 
err_t brushless25_ultra_fast_start_config (brushless25_t *ctx)
 Brushless 25 ultra fast start function.
 

Detailed Description

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

◆ brushless25_cfg_read()

err_t brushless25_cfg_read ( brushless25_t * ctx,
uint16_t reg,
uint32_t * data_out )

Brushless 25 config reading function.

This function reads a 32 bite data from the selected register by using SPI serial interface.

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

◆ brushless25_cfg_read_with_crc()

err_t brushless25_cfg_read_with_crc ( brushless25_t * ctx,
uint16_t reg,
uint32_t * data_out )

Brushless 25 config reading function.

This function reads a 32 bite data and crc check from the selected register by using SPI serial interface.

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

◆ brushless25_cfg_setup()

void brushless25_cfg_setup ( brushless25_cfg_t * cfg)

Brushless 25 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ brushless25_cfg_write()

err_t brushless25_cfg_write ( brushless25_t * ctx,
uint16_t reg,
uint32_t data_in )

Brushless 25 config writing function.

This function writes a 32 bite data to the selected register by using SPI serial interface.

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

◆ brushless25_cfg_write_with_crc()

err_t brushless25_cfg_write_with_crc ( brushless25_t * ctx,
uint16_t reg,
uint32_t data_in )

Brushless 25 config writing function with crc on.

This function writes a 32 bite data and crc check to the selected register by using SPI serial interface.

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

◆ brushless25_default_cfg()

err_t brushless25_default_cfg ( brushless25_t * ctx)

Brushless 25 default configuration function.

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

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

◆ brushless25_disable_drvoff()

void brushless25_disable_drvoff ( brushless25_t * ctx)

Brushless 25 disable drvoff mode function.

This function is used to disable drvoff mode.

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

◆ brushless25_enable_drvoff()

void brushless25_enable_drvoff ( brushless25_t * ctx)

Brushless 25 enable drvoff mode function.

This function is used to enable drvoff mode.

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

◆ brushless25_fast_start_config()

err_t brushless25_fast_start_config ( brushless25_t * ctx)

Brushless 25 fast start function.

This function is used to set device into a fast start mode.

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

◆ brushless25_i2c_read()

err_t brushless25_i2c_read ( brushless25_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Brushless 25 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See brushless25_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless25_i2c_write()

err_t brushless25_i2c_write ( brushless25_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Brushless 25 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See brushless25_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless25_init()

err_t brushless25_init ( brushless25_t * ctx,
brushless25_cfg_t * cfg )

Brushless 25 initialization function.

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

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

◆ brushless25_pot_write()

err_t brushless25_pot_write ( brushless25_t * ctx,
uint8_t cmd,
uint8_t reg,
uint16_t data_in )

Brushless 25 pot writing function.

This function writes a desired data into register using I2C interface.

Parameters
[in]ctx: Click context object. See brushless25_t object definition for detailed explanation.
[in]cmd: Command to be sent.
[in]reg: Start register address.
[out]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless25_pwm_start()

err_t brushless25_pwm_start ( brushless25_t * ctx)

Brushless 24 start PWM module.

This function starts the PWM module output.

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

◆ brushless25_pwm_stop()

err_t brushless25_pwm_stop ( brushless25_t * ctx)

Brushless 24 stop PWM module.

This function stops the PWM module output.

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

◆ brushless25_register_read()

err_t brushless25_register_read ( brushless25_t * ctx,
uint16_t reg,
uint32_t * data_out )

Brushless 25 data reading function.

This function reads a 32 bite data from the selected register by using SPI serial interface.

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

◆ brushless25_register_write()

err_t brushless25_register_write ( brushless25_t * ctx,
uint16_t reg,
uint32_t data_in )

Brushless 25 data writing function.

This function writes a 32 bite data to the selected register by using SPI serial interface.

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

◆ brushless25_set_brake_state()

err_t brushless25_set_brake_state ( brushless25_t * ctx,
uint8_t brake_state )

Brushless 25 set brake state function.

This function is used to set motor brake state.

Parameters
[in]ctx: Click context object. See brushless25_t object definition for detailed explanation.
[in]brake_state: State of the brake.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless25_set_duty_cycle()

err_t brushless25_set_duty_cycle ( brushless25_t * ctx,
float duty_cycle )

Brushless 24 sets PWM duty cycle.

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

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

◆ brushless25_set_speed_ctrl_mode()

err_t brushless25_set_speed_ctrl_mode ( brushless25_t * ctx,
uint8_t mode )

Brushless 25 set speed control mode function.

This function is used to set the motor speed control mode.

Parameters
[in]ctx: Click context object. See brushless25_t object definition for detailed explanation.
[in]mode:
  • 0 - Analog speed control,
  • 1 - PWM speed control,
  • 2 - I2C speed control,
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless25_set_speed_value()

err_t brushless25_set_speed_value ( brushless25_t * ctx,
float spd_val )

Brushless 25 set speed function.

This function is used to set the motor speed.

Parameters
[in]ctx: Click context object. See brushless25_t object definition for detailed explanation.
[in]spd_val: Value of the motor speed in percentages.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless25_set_wiper_position()

err_t brushless25_set_wiper_position ( brushless25_t * ctx,
uint16_t data_in )

Brushless 25 set pot wiper position function.

This function is used to set the wiper position of the potentiometer using I2C interface.

Parameters
[in]ctx: Click context object. See brushless25_t object definition for detailed explanation.
[in]data_in: Position of the wiper.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless25_slow_start_config()

err_t brushless25_slow_start_config ( brushless25_t * ctx)

Brushless 25 slow start function.

This function is used to set device into a slow start mode.

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

◆ brushless25_spi_write()

err_t brushless25_spi_write ( brushless25_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Brushless 25 SPI writing function.

This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See brushless25_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ brushless25_ultra_fast_start_config()

err_t brushless25_ultra_fast_start_config ( brushless25_t * ctx)

Brushless 25 ultra fast start function.

This function is used to set device into a ultra fast start mode.

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