Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
definitions.cpp
- Committer:
- as96
- Date:
- 2023-06-21
- Revision:
- 36:5c61710813b3
- Parent:
- 35:2f476d981896
File content as of revision 36:5c61710813b3:
#include <mbed.h>
#include "definitions.h"
// COMMS DEFINITIONS
Serial pc(USBTX, USBRX);
// INTERRUPTS
InterruptIn rtc_output(PF_11, PullUp);
InterruptIn autoStopTrigger(PD_2, PullDown);        //interrupt on lineside equipment detection
InterruptIn hallSensor(PG_3);              // For Hall Sensor Tachometer
// PIN DEFINITIONS
// INNOVATION/ COLLISION DETECTION
//AnalogIn irSensor_1(PF_6);
//AnalogIn irSensor_2(PF_7);
//AnalogIn irSensor_3(PC_2);
//RTC individual inputs//
DigitalIn rtc_1(PG_4, PullUp);
DigitalIn rtc_2(PG_6, PullUp);
DigitalIn rtc_3(PG_7, PullUp);
DigitalIn rtc_4(PG_5, PullUp);
DigitalIn rtc_5(PD_10, PullUp);
DigitalIn rtc_6(PG_8, PullUp);
DigitalIn rtc_7(PE_0, PullUp);
DigitalIn rtc_override(PG_14, PullUp);
// RTC Outputs
DigitalOut rtc_Trigger(PD_14);
// Output LEDs
//DigitalOut led_rtcOutput();    // No need as RTC has led output
//DigitalOut led_emergencyBrake(PE_11);
DigitalOut led_parkMode(PF_10);
//Motor outputs               // ENSURE YOU USE DAC PINS - BOTH MOTORS SHARE PINS
AnalogOut motorAccelerator(PA_5);
AnalogOut motorBrake(PA_4);
////motor 1 settings
DigitalOut keySwitchM1(PF_1);
DigitalOut directionFwd(PF_0);
DigitalOut directionRev(PD_1);
//DigitalOut directionM1(PA_3); // FORWARD AND REVERSE NEED TO BE SEPARATE
DigitalOut footswitchM1(PD_4);
DigitalOut seatM1(PD_5);
DigitalOut inchFwdM1(PD_6);
DigitalOut speedLimit2M1(PD_7);
DigitalOut speedLimit3M1(PE_3);
DigitalIn superCapPreCharge(PB_11);    // Supercaps are pre-charged
DigitalIn superCapVoltage(PB_2);  // Supercaps are Full
//Contactors as digital outputs
DigitalOut contactBatt(PE_8);        // C-BAT
DigitalOut contactCompressor(PG_10);   // C-COM
DigitalOut contactCapCharge(PG_11);   // C-CHA
//DigitalOut contactMtr1(PE_0); // DRIVEN BY MOTOR CONTROLLER
//DigitalOut contactMtr2(PG_8);
//mechanical braking and other air components.
DigitalOut backBrake(PD_3); //brake pins updated wire 90 back brake
DigitalOut frontBrake(PC_0); // brake pins updated  wire 91 front brake
DigitalOut whistle(PG_15);
DigitalIn pressureSwitch1(PC_13, PullUp);
DigitalIn pressureSwitch2(PC_1, PullUp);
DigitalIn pressureSwitch3(PC_15, PullUp);
//DigitalIn brakePressure(PH_0);      // NOT INSTALLED
DigitalIn mainlinePressure(PH_1, PullUp);
//Energy Storage;
AnalogIn vref_powercab(PA_0);
AnalogIn vref_supercap(PF_5);
AnalogIn vout_powercab(PB_1);
AnalogIn vout_supercap(PF_3);
///Lights
DigitalOut frontLight(PB_14);
DigitalOut backLight(PB_15);