diff options
Diffstat (limited to 'include/motor.h')
-rw-r--r-- | include/motor.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/motor.h b/include/motor.h new file mode 100644 index 0000000..cf15088 --- /dev/null +++ b/include/motor.h @@ -0,0 +1,33 @@ +#ifndef MOTOR_H_ +#define MOTOR_H_ + +#include "ch.h" +#include "hal.h" +#include "vex.h" + +typedef enum { + /* 1 */ mClawThingy = kVexMotor_1, + /* 2 */ mLiftHighLeft, + /* 3 */ mLiftLowLeft, + /* 4 */ mLiftHighRight, + /* 5 */ mLiftLowRight, + /* 6 */ mDriveFrontLeft, + /* 7 */ mDriveBackLeft, + /* 8 */ mDriveBackRight, + /* 9 */ mDriveFrontRight, + /* 10 */ mPickupThingy, +} motor_port_t; + +constexpr const tVexImeChannels iLiftLowLeft = kImeChannel_1; +constexpr const tVexImeChannels iLiftHighLeft = kImeChannel_2; +constexpr const tVexImeChannels iLiftLowRight = kImeChannel_3; +constexpr const tVexImeChannels iLiftHighRight = kImeChannel_4; + +#define DIGI_CFG_DIGI_OUT(p) { kVexDigital_##p, kVexSensorDigitalOutput, kVexConfigOutput, 0 } +#define DIGI_CFG_DIGI_IN(p) { kVexDigital_##p, kVexSensorDigitalInput, kVexConfigInput, 0 } + +#define MOTOR_CFG_MOT(p, t, r) (tVexMotor)p, kVexMotor##t, kVexMotor##r +#define MOTOR_CFG_NOIME kVexSensorNone, 0 +#define MOTOR_CFG_IME(c) kVexSensorIME, c + +#endif // MOTOR_H_ |