Code for TÜ mbed mainboard
Dependencies: USBDevice mbed motor
pins.h
00001 #ifndef PINS_H_ 00002 #define PINS_H_ 00003 #include "mbed.h" 00004 #include "definitions.h" 00005 00006 00007 PwmOut MOTOR0_PWM(P2_3); 00008 DigitalOut MOTOR0_DIR1(P0_21); 00009 DigitalOut MOTOR0_DIR2(P0_20); 00010 DigitalIn MOTOR0_FAULT(P0_22); 00011 InterruptIn MOTOR0_ENCA(P0_19); 00012 InterruptIn MOTOR0_ENCB(P0_18); 00013 00014 //Testing pins 00015 //PwmOut MOTOR0_PWM(p26); 00016 //DigitalOut MOTOR0_DIR1(p20); 00017 //DigitalOut MOTOR0_DIR2(p19); 00018 //DigitalIn MOTOR0_FAULT(p18); 00019 //InterruptIn MOTOR0_ENCA(p17); 00020 //InterruptIn MOTOR0_ENCB(p16); 00021 00022 PwmOut MOTOR1_PWM(P2_2); 00023 DigitalOut MOTOR1_DIR1(P0_15); 00024 DigitalOut MOTOR1_DIR2(P0_16); 00025 DigitalIn MOTOR1_FAULT(P0_17); 00026 InterruptIn MOTOR1_ENCA(P2_7); 00027 InterruptIn MOTOR1_ENCB(P2_6); 00028 // Testing pins 00029 //InterruptIn MOTOR1_ENCA(p21); 00030 //InterruptIn MOTOR1_ENCB(p22); 00031 00032 PwmOut MOTOR2_PWM(P2_1); 00033 DigitalOut MOTOR2_DIR1(P0_24); 00034 DigitalOut MOTOR2_DIR2(P0_25); 00035 DigitalIn MOTOR2_FAULT(P0_23); 00036 InterruptIn MOTOR2_ENCA(P0_26); 00037 InterruptIn MOTOR2_ENCB(P0_9); 00038 00039 PwmOut MOTOR3_PWM(P2_0); 00040 DigitalOut MOTOR3_DIR1(P0_7); 00041 DigitalOut MOTOR3_DIR2(P0_6); 00042 DigitalIn MOTOR3_FAULT(P0_8); 00043 InterruptIn MOTOR3_ENCA(P0_5); 00044 InterruptIn MOTOR3_ENCB(P0_4); 00045 00046 PwmOut* MotorPwm[] = { 00047 &MOTOR0_PWM, 00048 &MOTOR1_PWM, 00049 &MOTOR2_PWM, 00050 #if NUMBER_OF_MOTORS == 4 00051 &MOTOR3_PWM 00052 #endif 00053 }; 00054 00055 DigitalOut* MotorDir1[] = { 00056 &MOTOR0_DIR1, 00057 &MOTOR1_DIR1, 00058 &MOTOR2_DIR1, 00059 #if NUMBER_OF_MOTORS == 4 00060 &MOTOR3_DIR1 00061 #endif 00062 }; 00063 00064 DigitalOut* MotorDir2[] = { 00065 &MOTOR0_DIR2, 00066 &MOTOR1_DIR2, 00067 &MOTOR2_DIR2, 00068 #if NUMBER_OF_MOTORS == 4 00069 &MOTOR3_DIR2 00070 #endif 00071 }; 00072 00073 DigitalIn* MotorFault[] = { 00074 &MOTOR0_FAULT, 00075 &MOTOR1_FAULT, 00076 &MOTOR2_FAULT, 00077 #if NUMBER_OF_MOTORS == 4 00078 &MOTOR3_FAULT 00079 #endif 00080 }; 00081 00082 InterruptIn* MotorEncA[] = { 00083 &MOTOR0_ENCA, 00084 &MOTOR1_ENCA, 00085 &MOTOR2_ENCA, 00086 #if NUMBER_OF_MOTORS == 4 00087 &MOTOR3_ENCA 00088 #endif 00089 }; 00090 00091 InterruptIn* MotorEncB[] = { 00092 &MOTOR0_ENCB, 00093 &MOTOR1_ENCB, 00094 &MOTOR2_ENCB, 00095 #if NUMBER_OF_MOTORS == 4 00096 &MOTOR3_ENCB 00097 #endif 00098 }; 00099 00100 00101 #endif
Generated on Sun Jul 17 2022 04:37:01 by
1.7.2