dcmotor9 2.0.0.0
Functions

Functions

void dcmotor9_cfg_setup (dcmotor9_cfg_t *cfg)
 Configuration Object Init Setup function. More...
 
err_t dcmotor9_init (dcmotor9_t *ctx, dcmotor9_cfg_t *cfg)
 Initialization function. More...
 
void dcmotor9_set_duty_cycle (dcmotor9_t *ctx, float duty_cycle)
 Generic sets PWM duty cycle. More...
 
void dcmotor9_pwm_stop (dcmotor9_t *ctx)
 Stop PWM module. More...
 
void dcmotor9_pwm_start (dcmotor9_t *ctx)
 Start PWM module. More...
 
void dcmotor9_enable (dcmotor9_t *ctx)
 Enable the engine function. More...
 
void dcmotor9_standby (dcmotor9_t *ctx)
 Disable the engine function. More...
 
void dcmotor9_counter_clockwise (dcmotor9_t *ctx)
 Set the counter clockwise direction of rotation function. More...
 
void dcmotor9_clockwise (dcmotor9_t *ctx)
 Set the clockwise direction of rotation function. More...
 
void dcmotor9_short_brake (dcmotor9_t *ctx)
 Brake the engine function. More...
 
void dcmotor9_stop (dcmotor9_t *ctx)
 Stop the engine function. More...
 
err_t dcmotor9_read_an_value (dcmotor9_t *ctx, uint16_t *data_out)
 AN Value Read function. More...
 
err_t dcmotor9_read_an_voltage (dcmotor9_t *ctx, float *data_out)
 AN Voltage Read function. More...
 

Detailed Description

Function Documentation

◆ dcmotor9_cfg_setup()

void dcmotor9_cfg_setup ( dcmotor9_cfg_t cfg)

Configuration Object Init Setup function.

Parameters
[out]cfgClick configuration structure.

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

Note
All used pins will be set to unconnected state.

◆ dcmotor9_clockwise()

void dcmotor9_clockwise ( dcmotor9_t ctx)

Set the clockwise direction of rotation function.

Parameters
ctxClick object.

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

◆ dcmotor9_counter_clockwise()

void dcmotor9_counter_clockwise ( dcmotor9_t ctx)

Set the counter clockwise direction of rotation function.

Parameters
ctxClick object.

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

◆ dcmotor9_enable()

void dcmotor9_enable ( dcmotor9_t ctx)

Enable the engine function.

Parameters
ctxClick object.

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

◆ dcmotor9_init()

err_t dcmotor9_init ( dcmotor9_t ctx,
dcmotor9_cfg_t cfg 
)

Initialization function.

Parameters
[out]ctxClick object.
[in]cfgClick configuration structure.
Returns
See #err_t definition type of data. 0 - Ok, (-1) - Error.

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

◆ dcmotor9_pwm_start()

void dcmotor9_pwm_start ( dcmotor9_t ctx)

Start PWM module.

Parameters
ctxClick object.

@description This function starts PWM module.

◆ dcmotor9_pwm_stop()

void dcmotor9_pwm_stop ( dcmotor9_t ctx)

Stop PWM module.

Parameters
ctxClick object.

@description This function stops PWM module.

◆ dcmotor9_read_an_value()

err_t dcmotor9_read_an_value ( dcmotor9_t ctx,
uint16_t *  data_out 
)

AN Value Read function.

Parameters
[in]ctxClick object.
[out]data_outAN value.
Returns
See #err_t definition type of data. 0 - Ok, (-1) - Error.

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

◆ dcmotor9_read_an_voltage()

err_t dcmotor9_read_an_voltage ( dcmotor9_t ctx,
float *  data_out 
)

AN Voltage Read function.

Parameters
[in]ctxClick object.
[out]data_outAN voltage [V].
Returns
See #err_t definition type of data. 0 - Ok, (-1) - Error.

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

◆ dcmotor9_set_duty_cycle()

void dcmotor9_set_duty_cycle ( dcmotor9_t ctx,
float  duty_cycle 
)

Generic sets PWM duty cycle.

Parameters
ctxClick object.
duty_cycleDuty cycle.

@description This function sets the PWM duty cycle.

◆ dcmotor9_short_brake()

void dcmotor9_short_brake ( dcmotor9_t ctx)

Brake the engine function.

Parameters
ctxClick object.

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

◆ dcmotor9_standby()

void dcmotor9_standby ( dcmotor9_t ctx)

Disable the engine function.

Parameters
ctxClick object.

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

◆ dcmotor9_stop()

void dcmotor9_stop ( dcmotor9_t ctx)

Stop the engine function.

Parameters
ctxClick object.

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