dcmotor9 2.0.0.0
|
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. | |
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.
void dcmotor9_cfg_setup | ( | dcmotor9_cfg_t * | cfg | ) |
DC Motor 9 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dcmotor9_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See dcmotor9_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See dcmotor9_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See dcmotor9_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See dcmotor9_cfg_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error.err_t dcmotor9_pwm_start | ( | dcmotor9_t * | ctx | ) |
DC Motor 9 start PWM module.
This function starts the PWM module output.
[in] | ctx | : Click context object. See dcmotor9_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dcmotor9_pwm_stop | ( | dcmotor9_t * | ctx | ) |
DC Motor 9 stop PWM module.
This function stops the PWM module output.
[in] | ctx | : Click context object. See dcmotor9_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. |
[out] | data_out | : AN value. See dcmotor9_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. |
[out] | data_out | : AN Voltage[V]. See dcmotor9_t object definition for detailed explanation. |
0
- Success, -1
- Error.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 ] ).
[in] | ctx | : Click context object. See dcmotor9_t object definition for detailed explanation. |
[in] | duty_cycle | : PWM duty cycle. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See dcmotor9_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See dcmotor9_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See dcmotor9_cfg_t object definition for detailed explanation. |