dcmotor2 2.0.0.0
|
Functions | |
void | dcmotor2_cfg_setup (dcmotor2_cfg_t *cfg) |
Config Object Initialization function. | |
DCMOTOR2_RETVAL | dcmotor2_init (dcmotor2_t *ctx, dcmotor2_cfg_t *cfg) |
Initialization function. | |
void | dcmotor2_set_duty_cycle (dcmotor2_t *ctx, float duty_cycle) |
Generic sets PWM duty cycle. | |
void | dcmotor2_pwm_stop (dcmotor2_t *ctx) |
Stop PWM module. | |
void | dcmotor2_pwm_start (dcmotor2_t *ctx) |
Start PWM module. | |
void | dcmotor2_enable_motor (dcmotor2_t *ctx) |
Enable motor. | |
void | dcmotor2_disable_motor (dcmotor2_t *ctx) |
Disable motor. | |
void | dcmotor2_spin_clockwise (dcmotor2_t *ctx) |
Spin motor clockwise. | |
void | dcmotor2_spin_counter_clockwise (dcmotor2_t *ctx) |
Spin motor counter clockwise. | |
void | dcmotor2_pull_brake (dcmotor2_t *ctx) |
Pull motor brake. | |
void | dcmotor2_stop_motor (dcmotor2_t *ctx) |
Stop motor clockwise. | |
void dcmotor2_cfg_setup | ( | dcmotor2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void dcmotor2_disable_motor | ( | dcmotor2_t * | ctx | ) |
Disable motor.
ctx | Click object. |
@description This function sends a low digital output on the SLP pin and disables the motor.
void dcmotor2_enable_motor | ( | dcmotor2_t * | ctx | ) |
Enable motor.
ctx | Click object. |
@description This function sends a high digital output on the SLP pin and enables the motor.
DCMOTOR2_RETVAL dcmotor2_init | ( | dcmotor2_t * | ctx, |
dcmotor2_cfg_t * | cfg ) |
Initialization function.
dcmotor2 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void dcmotor2_pull_brake | ( | dcmotor2_t * | ctx | ) |
Pull motor brake.
ctx | Click object. |
@description This function sets the IN1/IN2 pins to 1/1 and forces the motor to break.
void dcmotor2_pwm_start | ( | dcmotor2_t * | ctx | ) |
Start PWM module.
ctx | Click object. |
@description This function starts PWM module.
void dcmotor2_pwm_stop | ( | dcmotor2_t * | ctx | ) |
Stop PWM module.
ctx | Click object. |
@description This function stops PWM module.
void dcmotor2_set_duty_cycle | ( | dcmotor2_t * | ctx, |
float | duty_cycle ) |
Generic sets PWM duty cycle.
ctx | Click object. |
duty_cycle | Duty cycle. |
@description This function sets the PWM duty cycle.
void dcmotor2_spin_clockwise | ( | dcmotor2_t * | ctx | ) |
Spin motor clockwise.
ctx | Click object. |
@description This function sets the IN1/IN2 pins to 1/0 and makes the motor spin clockwise.
void dcmotor2_spin_counter_clockwise | ( | dcmotor2_t * | ctx | ) |
Spin motor counter clockwise.
ctx | Click object. |
@description This function sets the IN1/IN2 pins to 0/1 and makes the motor spin counter clockwise.
void dcmotor2_stop_motor | ( | dcmotor2_t * | ctx | ) |
Stop motor clockwise.
ctx | Click object. |
@description This function sets the IN1/IN2 pins to 0/0 and stops the motor completely.