Francesco Pistone
/
FORIGO_Modula_V6_R2_DE_2019
new
Embed:
(wiki syntax)
Show/hide line numbers
iodefinition.hpp
00001 00002 Watchdog wd; 00003 00004 #if defined(speedMaster) 00005 InterruptIn tractorSpeedRead(PB_1); // define interrupt pin for tractor speed calculation MASTER MODE 00006 DigitalOut quinconceOut(PA_5); // sincro per quinconcio out 00007 DigitalOut speedClock(PA_6); // define out for speed clock repeater 00008 InterruptIn DcEncoder(PB_2); // define input for reading speed of seed wheel with fixed 25 hole 00009 #else 00010 InterruptIn tractorSpeedRead(PB_6); // define interrupt pin for tractor speed calculation SLAVE MODE 00011 InterruptIn quinconceIn(PA_9); 00012 DigitalIn quinconceOut(PA_5,PullUp); // sincro per quinconcio out 00013 InterruptIn DcEncoder(PB_2); // define input for reading speed of seed wheel with fixed 25 hole 00014 DigitalOut speedClock(PA_6); // define out for speed clock repeater 00015 #endif 00016 00017 DigitalIn TBzeroPinInputRev(PB_11); // define input of reading zero position of distributor wheel 00018 DigitalIn seedWheelZeroPinInputRev(PB_12); // define input of reading zero position of seeding wheel 00019 DigitalIn seedLevel(PB_1); // define input for reading seed level on tank 00020 InterruptIn seedCheck(PA_7); // define input for reading seed passage to picks 00021 DigitalIn buttonUser(PC_13); // pulsante su scheda 00022 00023 00024 InterruptIn pwmCheck(PB_13); 00025 PwmOut SDmotorPWM(PB_13); // define frequency command for seeding whell motor driver 00026 DigitalOut SDmotorInB(PB_14); // sd motor half bridge direction selector 00027 DigitalOut SDmotorInA(PB_15); // SD motor half bridge direction selector 00028 DigitalIn enDiag_A(PB_5); // SD motor fault condition input A 00029 DigitalIn enDiag_B(PB_4); // SD motor fault condition input A 00030 AnalogIn SDcurrent(PA_4); // SD power current feedback 00031 00032 DigitalOut TBmotor_M1(PC_8); // TB motor step division M1 00033 DigitalOut TBmotor_M2(PC_6); // TB motor step division M2 00034 DigitalOut TBmotor_M3(PC_5); // TB motor step division M3 00035 DigitalOut TBmotorRst(PC_4); // TB motor driver reset 00036 DigitalOut TBmotorStepOut(PB_3); // TB motor step command 00037 DigitalOut TBmotorDirecti(PA_10); // TB motor direction command 00038 00039 00040 #if defined(speedMaster) 00041 DigitalOut led(LED1); // ATTENZIONE: LED1 E' SU PA5 / D13 00042 #else 00043 DigitalOut led(PC_7); // ATTENZIONE: LED1 E' SU PA5 / D13 00044 #endif 00045 00046 //DigitalIn zeroRequestIn(PB_6); // define input of zero request for slave module 00047 //DigitalIn runRequestIn(PB_9); // define input of run request for slave module 00048 00049 #if defined(canbusActive) 00050 CAN can1(PA_11,PA_12,100000); // CAN BUS channel for communication with other slave and master consolle 00051 int checkState=0; 00052 #endif 00053 CANMessage txMsg; 00054 CANMessage rxMsg; 00055 00056 #if defined(pcSerial) 00057 Serial pc(USBTX, USBRX,256000); // serial channel for PC communication 00058 #else 00059 #if defined(speedTime) 00060 Serial pc(USBTX, USBRX,256000); // serial channel for PC communication 00061 #endif 00062 #endif 00063
Generated on Wed Jul 13 2022 15:20:30 by 1.7.2