dc_motor.h File Reference
DC motor driver (interface). More...
#include "hw_dc_motor.h"
#include <algo/pid_control.h>
#include <drv/pwm.h>
#include <drv/timer.h>
#include <drv/adc.h>
#include <cfg/macros.h>
#include "appconfig.h"
Go to the source code of this file.
Data Structures | |
| struct | DCMotorConfig |
| DC motor configuration stucture. More... | |
| struct | DCMotor |
| Context structure for DC motor. More... | |
Defines | |
| #define | DC_MOTOR_ACTIVE BV(0) |
| Define status bit for DC motor device. | |
| #define | DC_MOTOR_DIR BV(1) |
| Spin direction of DC motor. | |
Typedefs | |
| typedef uint16_t | dc_speed_t |
| Type for DC motor. | |
Functions | |
| void | dc_motor_setDir (int index, bool dir) |
| Set spin direction of DC motor. | |
| void | dc_motor_enable (int index, bool state) |
| Enable or disable dc motor. | |
| void | dc_motor_setSpeed (int index, dc_speed_t speed) |
| Set DC motor speed. | |
| void | dc_motor_setup (int index, DCMotorConfig *cfg) |
| Apply a confinguration to select DC motor. | |
| void | dc_motor_init (void) |
| Init DC motor. | |
Detailed Description
DC motor driver (interface).
- Version:
- Id
- dc_motor.h 1244 2008-05-02 11:51:48Z asterix
Definition in file dc_motor.h.
Define Documentation
| #define DC_MOTOR_ACTIVE BV(0) |
Define status bit for DC motor device.
DC motor enable or disable flag.
Definition at line 58 of file dc_motor.h.
Function Documentation
| void dc_motor_setDir | ( | int | index, | |
| bool | dir | |||
| ) |
Set spin direction of DC motor.
index number of DC motor dir direction of DC motor
Definition at line 191 of file dc_motor.c.
