dcmotor9 2.0.0.0
DC Motor 9 Click Driver

API for configuring and manipulating DC Motor 9 Click driver. More...

Topics

 DC Motor 9 PWM Settings
 Settings for configuration of DC Motor 9 Click driver.
 
 DC Motor 9 MikroBUS Map
 MikroBUS pin mapping of DC Motor 9 Click driver.
 

Functions

void dcmotor9_cfg_setup (dcmotor9_cfg_t *cfg)
 DC Motor 9 configuration object setup function.
 
err_t dcmotor9_init (dcmotor9_t *ctx, dcmotor9_cfg_t *cfg)
 DC Motor 9 initialization function.
 
err_t dcmotor9_default_cfg (dcmotor9_t *ctx)
 DC Motor 9 default configuration function.
 
err_t dcmotor9_set_duty_cycle (dcmotor9_t *ctx, float duty_cycle)
 DC Motor 9 sets PWM duty cycle.
 
err_t dcmotor9_pwm_stop (dcmotor9_t *ctx)
 DC Motor 9 stop PWM module.
 
err_t dcmotor9_pwm_start (dcmotor9_t *ctx)
 DC Motor 9 start PWM module.
 
void dcmotor9_enable (dcmotor9_t *ctx)
 DC Motor 9 Enable the engine function.
 
void dcmotor9_standby (dcmotor9_t *ctx)
 DC Motor 9 Disable the engine function.
 
void dcmotor9_counter_clockwise (dcmotor9_t *ctx)
 DC Motor 9 Set the counter clockwise direction of rotation function.
 
void dcmotor9_clockwise (dcmotor9_t *ctx)
 DC Motor 9 Set the clockwise direction of rotation function.
 
void dcmotor9_short_brake (dcmotor9_t *ctx)
 DC Motor 9 Brake the engine function.
 
void dcmotor9_stop (dcmotor9_t *ctx)
 DC Motor 9 Stop the engine function.
 
err_t dcmotor9_read_an_value (dcmotor9_t *ctx, uint16_t *data_out)
 DC Motor 9 AN Value Read function.
 
err_t dcmotor9_read_an_voltage (dcmotor9_t *ctx, float *data_out)
 DC Motor 9 AN Voltage Read function.
 

Detailed Description

API for configuring and manipulating DC Motor 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

◆ dcmotor9_cfg_setup()

void dcmotor9_cfg_setup ( dcmotor9_cfg_t * cfg)

DC Motor 9 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ dcmotor9_clockwise()

void dcmotor9_clockwise ( dcmotor9_t * ctx)

DC Motor 9 Set the clockwise direction of rotation function.

Function sets the clockwise direction of rotation by setting IN1 ( CS ) pin and claering IN2 ( PWM ) pin on DC Motor 9 Click board.

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

◆ dcmotor9_counter_clockwise()

void dcmotor9_counter_clockwise ( dcmotor9_t * ctx)

DC Motor 9 Set the counter clockwise direction of rotation function.

Function sets the counter clockwise direction of rotation by clearing IN1 ( CS ) pin and seting IN2 ( PWM ) pin on DC Motor 9 Click board.

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

◆ dcmotor9_default_cfg()

err_t dcmotor9_default_cfg ( dcmotor9_t * ctx)

DC Motor 9 default configuration function.

This function executes a default configuration of DC Motor 9 click board.

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

◆ dcmotor9_enable()

void dcmotor9_enable ( dcmotor9_t * ctx)

DC Motor 9 Enable the engine function.

Function enables the engine by setting SHDN ( RST ) pin on DC Motor 9 Click board.

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

◆ dcmotor9_init()

err_t dcmotor9_init ( dcmotor9_t * ctx,
dcmotor9_cfg_t * cfg )

DC Motor 9 initialization function.

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

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

◆ dcmotor9_pwm_start()

err_t dcmotor9_pwm_start ( dcmotor9_t * ctx)

DC Motor 9 start PWM module.

This function starts the PWM module output.

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

◆ dcmotor9_pwm_stop()

err_t dcmotor9_pwm_stop ( dcmotor9_t * ctx)

DC Motor 9 stop PWM module.

This function stops the PWM module output.

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

◆ dcmotor9_read_an_value()

err_t dcmotor9_read_an_value ( dcmotor9_t * ctx,
uint16_t * data_out )

DC Motor 9 AN Value Read function.

This function reads results of AD conversion on the AN pin.

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

◆ dcmotor9_read_an_voltage()

err_t dcmotor9_read_an_voltage ( dcmotor9_t * ctx,
float * data_out )

DC Motor 9 AN Voltage Read function.

This function reads results of AD conversion on the AN pin and calculates these results to voltage.

Parameters
[in]ctx: Click context object.
[out]data_out: AN Voltage[V]. See dcmotor9_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ dcmotor9_set_duty_cycle()

err_t dcmotor9_set_duty_cycle ( dcmotor9_t * ctx,
float duty_cycle )

DC Motor 9 sets PWM duty cycle.

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

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

◆ dcmotor9_short_brake()

void dcmotor9_short_brake ( dcmotor9_t * ctx)

DC Motor 9 Brake the engine function.

Function brakes the engine by setting IN1 ( CS ) and IN2 ( PWM ) pins on DC Motor 9 Click board.

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

◆ dcmotor9_standby()

void dcmotor9_standby ( dcmotor9_t * ctx)

DC Motor 9 Disable the engine function.

TFunction disables the engine by clearing SHDN ( RST ) pin on DC Motor 9 Click board.

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

◆ dcmotor9_stop()

void dcmotor9_stop ( dcmotor9_t * ctx)

DC Motor 9 Stop the engine function.

Function stops the engine by clearing IN1 ( CS ) and IN2 ( PWM ) pins on DC Motor 9 Click board.

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