dcmotor5 2.0.0.0
DC Motor 5 Click Driver

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

Topics

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

Functions

void dcmotor5_cfg_setup (dcmotor5_cfg_t *cfg)
 DC Motor 5 configuration object setup function.
 
err_t dcmotor5_init (dcmotor5_t *ctx, dcmotor5_cfg_t *cfg)
 DC Motor 5 initialization function.
 
void dcmotor5_default_cfg (dcmotor5_t *ctx)
 DC Motor 5 default configuration function.
 
void dcmotor5_set_duty_cycle (dcmotor5_t *ctx, float duty_cycle)
 DC Motor 5 sets PWM duty cycle.
 
void dcmotor5_pwm_stop (dcmotor5_t *ctx)
 DC Motor 5 stop PWM module.
 
void dcmotor5_pwm_start (dcmotor5_t *ctx)
 DC Motor 5 start PWM module.
 
void dcmotor5_enable (dcmotor5_t *ctx)
 DC Motor 5 start PWM module.
 
void dcmotor5_standby (dcmotor5_t *ctx)
 DC Motor 5 Disable the engine function.
 
void dcmotor5_counter_clockwise (dcmotor5_t *ctx)
 DC Motor 5 Set the direction of rotation in the counter clockwise direction function.
 
void dcmotor5_clockwise (dcmotor5_t *ctx)
 DC Motor 5 Set the direction of rotation in the clockwise direction function.
 
void dcmotor5_short_brake (dcmotor5_t *ctx)
 DC Motor 5 brake the engine function.
 
void dcmotor5_stop (dcmotor5_t *ctx)
 DC Motor 5 stop the engine function.
 
uint8_t dcmotor5_get_fault_conditions (dcmotor5_t *ctx)
 DC Motor 5 get fault conditions state function.
 
uint8_t dcmotor5_get_sense_comparator (dcmotor5_t *ctx)
 DC Motor 5 get sense comparator.
 

Detailed Description

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

◆ dcmotor5_cfg_setup()

void dcmotor5_cfg_setup ( dcmotor5_cfg_t * cfg)

DC Motor 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ dcmotor5_clockwise()

void dcmotor5_clockwise ( dcmotor5_t * ctx)

DC Motor 5 Set the direction of rotation in the clockwise direction function.

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

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

◆ dcmotor5_counter_clockwise()

void dcmotor5_counter_clockwise ( dcmotor5_t * ctx)

DC Motor 5 Set the direction of rotation in the counter clockwise direction function.

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

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

◆ dcmotor5_default_cfg()

void dcmotor5_default_cfg ( dcmotor5_t * ctx)

DC Motor 5 default configuration function.

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

Parameters
[in]ctx: Click context object. See dcmotor5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ dcmotor5_enable()

void dcmotor5_enable ( dcmotor5_t * ctx)

DC Motor 5 start PWM module.

This function starts the PWM module output.

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

◆ dcmotor5_get_fault_conditions()

uint8_t dcmotor5_get_fault_conditions ( dcmotor5_t * ctx)

DC Motor 5 get fault conditions state function.

This function starts the PWM module output.

Parameters
[in]ctx: Click context object. See dcmotor5_t object definition for detailed explanation.
Returns
State of the FAULT pin

◆ dcmotor5_get_sense_comparator()

uint8_t dcmotor5_get_sense_comparator ( dcmotor5_t * ctx)

DC Motor 5 get sense comparator.

This function returns sense comparator state, state of AN pin on DC Motor 5 Click board.

Parameters
[in]ctx: Click context object. See dcmotor5_t object definition for detailed explanation.
Returns
State of the SNSO pin.

◆ dcmotor5_init()

err_t dcmotor5_init ( dcmotor5_t * ctx,
dcmotor5_cfg_t * cfg )

DC Motor 5 initialization function.

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

Parameters
[out]ctx: Click context object. See dcmotor5_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See dcmotor5_cfg_t object definition for detailed explanation.
Returns
Nothing.

◆ dcmotor5_pwm_start()

void dcmotor5_pwm_start ( dcmotor5_t * ctx)

DC Motor 5 start PWM module.

This function starts the PWM module output.

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

◆ dcmotor5_pwm_stop()

void dcmotor5_pwm_stop ( dcmotor5_t * ctx)

DC Motor 5 stop PWM module.

This function stops the PWM module output.

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

◆ dcmotor5_set_duty_cycle()

void dcmotor5_set_duty_cycle ( dcmotor5_t * ctx,
float duty_cycle )

DC Motor 5 sets PWM duty cycle.

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

Parameters
[in]ctx: Click context object. See dcmotor5_t object definition for detailed explanation.
[in]duty_cycle: PWM duty cycle.
Returns
Nothing.

◆ dcmotor5_short_brake()

void dcmotor5_short_brake ( dcmotor5_t * ctx)

DC Motor 5 brake the engine function.

This function starts the PWM module output.

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

◆ dcmotor5_standby()

void dcmotor5_standby ( dcmotor5_t * ctx)

DC Motor 5 Disable the engine function.

Function disables the engine by clearing SLEEP ( RST ) pin on DC Motor 5 Click board.

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

◆ dcmotor5_stop()

void dcmotor5_stop ( dcmotor5_t * ctx)

DC Motor 5 stop the engine function.

This function starts the PWM module output.

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