dcmotor5  2.0.0.0
Functions

Functions

void dcmotor5_cfg_setup (dcmotor5_cfg_t *cfg)
 Config Object Initialization function. More...
 
DCMOTOR5_RETVAL dcmotor5_init (dcmotor5_t *ctx, dcmotor5_cfg_t *cfg)
 Initialization function. More...
 
void dcmotor5_set_duty_cycle (dcmotor5_t *ctx, float duty_cycle)
 Generic sets PWM duty cycle. More...
 
void dcmotor5_pwm_stop (dcmotor5_t *ctx)
 Stop PWM module. More...
 
void dcmotor5_pwm_start (dcmotor5_t *ctx)
 Start PWM module. More...
 
void dcmotor5_enable (dcmotor5_t *ctx)
 Enable the engine function. More...
 
void dcmotor5_standby (dcmotor5_t *ctx)
 Disable the engine function. More...
 
void dcmotor5_counter_clockwise (dcmotor5_t *ctx)
 Set the direction of rotation in the counter clockwise direction function. More...
 
void dcmotor5_clockwise (dcmotor5_t *ctx)
 Set the direction of rotation in the clockwise direction function. More...
 
void dcmotor5_short_brake (dcmotor5_t *ctx)
 Brake the engine function. More...
 
void dcmotor5_stop (dcmotor5_t *ctx)
 Stop the engine function. More...
 
uint8_t dcmotor5_get_fault_conditions (dcmotor5_t *ctx)
 Get fault conditions state function. More...
 
uint8_t dcmotor5_get_sense_comparator (dcmotor5_t *ctx)
 Get sense comparator state function. More...
 

Detailed Description

Function Documentation

◆ dcmotor5_cfg_setup()

void dcmotor5_cfg_setup ( dcmotor5_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ dcmotor5_clockwise()

void dcmotor5_clockwise ( dcmotor5_t ctx)

Set the direction of rotation in the clockwise direction function.

Parameters
ctxClick object.

@description 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.

◆ dcmotor5_counter_clockwise()

void dcmotor5_counter_clockwise ( dcmotor5_t ctx)

Set the direction of rotation in the counter clockwise direction function.

Parameters
ctxClick object.

@description 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.

◆ dcmotor5_enable()

void dcmotor5_enable ( dcmotor5_t ctx)

Enable the engine function.

Parameters
ctxClick object.

@description Function enables the engine by setting SLEEP ( RST ) pin on DC Motor 5 Click board.

◆ dcmotor5_get_fault_conditions()

uint8_t dcmotor5_get_fault_conditions ( dcmotor5_t ctx)

Get fault conditions state function.

Parameters
ctxClick object.
Returns
fault conditions state:
  • 0 : ok condition;
  • 1 : ERROR;

@description Function returns fault condition state, state of CS pin on DC Motor 5 Click board.

◆ dcmotor5_get_sense_comparator()

uint8_t dcmotor5_get_sense_comparator ( dcmotor5_t ctx)

Get sense comparator state function.

Parameters
ctxClick object.
Returns
fault conditions state:
  • 0 : drive current hits the current chopping threshold;
  • 1 : ERROR;

@desription Function returns sense comparator state, state of AN pin on DC Motor 5 Click board.

◆ dcmotor5_init()

DCMOTOR5_RETVAL dcmotor5_init ( dcmotor5_t ctx,
dcmotor5_cfg_t cfg 
)

Initialization function.

Parameters
dcmotor5Click object.
cfgClick configuration structure.

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

◆ dcmotor5_pwm_start()

void dcmotor5_pwm_start ( dcmotor5_t ctx)

Start PWM module.

Parameters
ctxClick object.

@description This function starts PWM module.

◆ dcmotor5_pwm_stop()

void dcmotor5_pwm_stop ( dcmotor5_t ctx)

Stop PWM module.

Parameters
ctxClick object.

@description This function stops PWM module.

◆ dcmotor5_set_duty_cycle()

void dcmotor5_set_duty_cycle ( dcmotor5_t ctx,
float  duty_cycle 
)

Generic sets PWM duty cycle.

Parameters
ctxClick object.
duty_cycleDuty cycle.

@description This function sets the PWM duty cycle.

◆ dcmotor5_short_brake()

void dcmotor5_short_brake ( dcmotor5_t ctx)

Brake the engine function.

Parameters
ctxClick object.

@description Function brakes the engine by setting IN1 ( PWM ) and IN2 ( INT ) pins on DC Motor 5 Click board.

◆ dcmotor5_standby()

void dcmotor5_standby ( dcmotor5_t ctx)

Disable the engine function.

Parameters
ctxClick object.

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

◆ dcmotor5_stop()

void dcmotor5_stop ( dcmotor5_t ctx)

Stop the engine function.

Parameters
ctxClick object.

@description Function stops the engine by clearing IN1 ( PWM ) and IN2 ( INT ) pins on DC Motor 5 Click board.