brushless15 2.0.0.0

Modules | Functions
Brushless 15 Click Driver

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

## Modules
| Brushless 15 PWM Settings
| Settings for configuration of Brushless 15 Click driver.
| Brushless 15 MikroBUS Map
| MikroBUS pin mapping of Brushless 15 Click driver.
| Brushless15_cfg

## Functions
void | brushless15_cfg_setup (brushless15_cfg_t *cfg)
| Brushless 15 configuration object setup function. More...
err_t | brushless15_init (brushless15_t *ctx, brushless15_cfg_t *cfg)
| Brushless 15 initialization function. More...
err_t | brushless15_default_cfg (brushless15_t *ctx)
| Brushless 15 default configuration function. More...
err_t | brushless15_set_duty_cycle (brushless15_t *ctx, float duty_cycle)
| Brushless 15 sets PWM duty cycle. More...
err_t | brushless15_pwm_stop (brushless15_t *ctx)
| Brushless 15 stop PWM module. More...
err_t | brushless15_pwm_start (brushless15_t *ctx)
| Brushless 15 start PWM module. More...
void | brushless15_enable_device (brushless15_t *ctx)
| Brushless 15 enable device function. More...
void | brushless15_disable_device (brushless15_t *ctx)
| Brushless 15 disable device function. More...
uint8_t | brushless15_get_int_pin (brushless15_t *ctx)
| Brushless 15 get int pin function. More...
void | brushless15_set_direction (brushless15_t *ctx, uint8_t direction)
| Brushless 15 set direction function. More...
void | brushless15_switch_direction (brushless15_t *ctx)
| Brushless 15 switch direction function. More...

## Detailed Description

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

## ◆ brushless15_cfg_setup()

void brushless15_cfg_setup | ( | brushless15_cfg_t * | cfg | ) |

Brushless 15 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters

  [out] | cfg | : Click configuration structure. See brushless15_cfg_t object definition for detailed explanation.

Returns
  Nothing.

Note
  The all used pins will be set to unconnected state.

## ◆ brushless15_default_cfg()

err_t brushless15_default_cfg | ( | brushless15_t * | ctx | ) |

Brushless 15 default configuration function.

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

Parameters

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

## ◆ brushless15_disable_device()

void brushless15_disable_device | ( | brushless15_t * | ctx | ) |

Brushless 15 disable device function.

This function disables the device by setting the EN pin to high logic state.

Parameters

  [in] | ctx | : Click context object. See brushless15_t object definition for detailed explanation.

Returns
  None.

Note
  None.

## ◆ brushless15_enable_device()

void brushless15_enable_device | ( | brushless15_t * | ctx | ) |

Brushless 15 enable device function.

This function enables the device by setting the EN pin to low logic state.

Parameters

  [in] | ctx | : Click context object. See brushless15_t object definition for detailed explanation.

Returns
  None.

Note
  None.

## ◆ brushless15_get_int_pin()

uint8_t brushless15_get_int_pin | ( | brushless15_t * | ctx | ) |

Brushless 15 get int pin function.

This function returns the INT pin logic state.

Parameters

  [in] | ctx | : Click context object. See brushless15_t object definition for detailed explanation.

Returns
  Pin logic state.

Note
  None.

## ◆ brushless15_init()

err_t brushless15_init | ( | brushless15_t * | ctx,
|  | brushless15_cfg_t * | cfg
| ) |  |

Brushless 15 initialization function.

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

Parameters

  [out] | ctx | : Click context object. See brushless15_t object definition for detailed explanation.
  [in] | cfg | : Click configuration structure. See brushless15_cfg_t object definition for detailed explanation.

Returns
  - `0` - Success,
  - `-1` - Error.
  See #err_t definition for detailed explanation.

Note
  None.

## ◆ brushless15_pwm_start()

err_t brushless15_pwm_start | ( | brushless15_t * | ctx | ) |

Brushless 15 start PWM module.

This function starts the PWM module output.

Parameters

  [in] | ctx | : Click context object. See brushless15_t object definition for detailed explanation.

Returns
  - `0` - Success,
  - `-1` - Error.
  See #err_t definition for detailed explanation.

Note
  None.

## ◆ brushless15_pwm_stop()

err_t brushless15_pwm_stop | ( | brushless15_t * | ctx | ) |

Brushless 15 stop PWM module.

This function stops the PWM module output.

Parameters

  [in] | ctx | : Click context object. See brushless15_t object definition for detailed explanation.

Returns
  - `0` - Success,
  - `-1` - Error.
  See #err_t definition for detailed explanation.

Note
  None.

## ◆ brushless15_set_direction()

void brushless15_set_direction | ( | brushless15_t * | ctx,
|  | uint8_t | direction
| ) |  |

Brushless 15 set direction function.

This function sets the motor direction.

Parameters

  [in] | ctx | : Click context object. See brushless15_t object definition for detailed explanation.
  [in] | direction | : `0` - Clockwise, `1` - Counter Clockwise.

Returns
  None.

Note
  None.

## ◆ brushless15_set_duty_cycle()

err_t brushless15_set_duty_cycle | ( | brushless15_t * | ctx,
|  | float | duty_cycle
| ) |  |

Brushless 15 sets PWM duty cycle.

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

Parameters

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

## ◆ brushless15_switch_direction()

void brushless15_switch_direction | ( | brushless15_t * | ctx | ) |

Brushless 15 switch direction function.

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

Parameters

  [in] | ctx | : Click context object. See brushless15_t object definition for detailed explanation.

Returns
  None.

Note
  None.