faefa

Dependencies:   mbed CANMsg

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers iodefinition.hpp Source File

iodefinition.hpp

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