SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

Committer:
hazheng
Date:
Wed Apr 19 14:54:14 2017 +0000
Revision:
91:7b1910ca3ad6
Parent:
79:bdbac82c979b
More documentations.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hazheng 91:7b1910ca3ad6 1 /**
hazheng 91:7b1910ca3ad6 2 * @file PinAssignment.h
hazheng 91:7b1910ca3ad6 3 * @brief The header file for pin assignments. All of the assignment to the pins MUST happen here, so that we can make sure that there is no one single pin assigned to two (or more) functions.
hazheng 91:7b1910ca3ad6 4 * @author Jordan Brack <jabrack@mix.wvu.edu>, Haofan Zheng <hazheng@mix.wvu.edu>
hazheng 91:7b1910ca3ad6 5 *
hazheng 91:7b1910ca3ad6 6 */
Bobymicjohn 8:92f6baeea027 7 #pragma once
Bobymicjohn 8:92f6baeea027 8 #ifndef PIN_ASSIGNMENT_H
Bobymicjohn 8:92f6baeea027 9 #define PIN_ASSIGNMENT_H
Bobymicjohn 8:92f6baeea027 10
hazheng 29:f87d8790f57d 11
hazheng 28:271fc8445e89 12
Bobymicjohn 8:92f6baeea027 13 //LED Manager Class
hazheng 13:7dcb1642ef99 14 #define PIN_LMC_LED_RED LED_RED
hazheng 13:7dcb1642ef99 15 #define PIN_LMC_LED_GREEN LED_GREEN
hazheng 91:7b1910ca3ad6 16 //#define PIN_LMC_LED_BLUE LED_BLUE //DO NOT use blue LED, otherwise, the SPI port will not work!
Bobymicjohn 8:92f6baeea027 17
Bobymicjohn 8:92f6baeea027 18 //Motor Class
hazheng 91:7b1910ca3ad6 19 #define PIN_MC_DIR_R PTD4 /*!< @brief Motor driver direction, right. */
hazheng 91:7b1910ca3ad6 20 #define PIN_MC_SPEED_R PTA12 /*!< @brief Motor driver speed (power) level, right. */
hazheng 44:15de535c4005 21
hazheng 91:7b1910ca3ad6 22 #define PIN_MC_DIR_L PTA4 /*!< @brief Motor driver direction, left. */
hazheng 91:7b1910ca3ad6 23 #define PIN_MC_SPEED_L PTA5 /*!< @brief Motor driver speed (power) level, left. */
Bobymicjohn 8:92f6baeea027 24
Bobymicjohn 10:fedb5786a109 25 //Servo
hazheng 91:7b1910ca3ad6 26 #define PIN_SC_SERVO PTB3 /*!< @brief Servo, turn signal */
Bobymicjohn 8:92f6baeea027 27
hazheng 91:7b1910ca3ad6 28 /*
Bobymicjohn 8:92f6baeea027 29 //Camera Class
hazheng 91:7b1910ca3ad6 30 #define PIN_CC_PCLOCK PTA17
hazheng 25:6f63053cee81 31 #define PIN_CC_HREF PTD6
hazheng 26:5814404856e2 32 #define PIN_CC_VSYNC PTD7
hazheng 91:7b1910ca3ad6 33
hazheng 27:c68f711e5b67 34 #define PIN_CC_D_0 PTB8
hazheng 27:c68f711e5b67 35 #define PIN_CC_D_1 PTB9
hazheng 27:c68f711e5b67 36 #define PIN_CC_D_2 PTB10
hazheng 27:c68f711e5b67 37 #define PIN_CC_D_3 PTB11
hazheng 27:c68f711e5b67 38 #define PIN_CC_D_4 PTE2
hazheng 27:c68f711e5b67 39 #define PIN_CC_D_5 PTE3
hazheng 27:c68f711e5b67 40 #define PIN_CC_D_6 PTE4
hazheng 27:c68f711e5b67 41 #define PIN_CC_D_7 PTE5
hazheng 57:0d8a155d511d 42 */
hazheng 59:b709711bc566 43 //OVxxxx RegBuf Class
hazheng 91:7b1910ca3ad6 44 #define PIN_ORB_SDA PTE0 /*!< @brief SCCB control to the camera, SDA line. */
hazheng 91:7b1910ca3ad6 45 #define PIN_ORB_SCL PTE1 /*!< @brief SCCB control to the camera, SCL line. */
Bobymicjohn 8:92f6baeea027 46
Bobymicjohn 15:eb6a274b3dfb 47 //Wheel Encoder Class
hazheng 91:7b1910ca3ad6 48 #define PIN_WE_RL PTD5 /*!< @brief Wheel encoder, rear left, interrupt in. */
hazheng 91:7b1910ca3ad6 49 #define PIN_WE_RR PTA13 /*!< @brief Wheel encoder, rear right, interrupt in. */
hazheng 29:f87d8790f57d 50
hazheng 29:f87d8790f57d 51 //ArduCam Class
hazheng 91:7b1910ca3ad6 52 #define PIN_ACC_CS PTC12 /*!< @brief ArduCam Mini, chip select pin. */
Bobymicjohn 8:92f6baeea027 53
hazheng 41:7b21c5e3599e 54 //ArduUTFT Class
hazheng 91:7b1910ca3ad6 55 #define PIN_AUC_CS PTC13 /*!< @brief ArduCam shield V2, chip select. */
hazheng 79:bdbac82c979b 56
hazheng 79:bdbac82c979b 57 //ArduTouch Class
hazheng 91:7b1910ca3ad6 58 #define PIN_ATC_TOUCH_CS PTC16 /*!< @brief ArduCam shield V2 touch screen, chip select. */
hazheng 91:7b1910ca3ad6 59 #define PIN_ATC_TOUCH_IRQ PTA16 /*!< @brief ArduCam shield V2 touch screen, interrupt in. */
hazheng 79:bdbac82c979b 60
hazheng 79:bdbac82c979b 61 //ArduSD Class (Not exsit yet)
hazheng 91:7b1910ca3ad6 62 #define PIN_AUC_SD_CS PTC17 /*!< @brief ArduCam shield V2 SD reader, chip select. */
hazheng 40:be98219930e4 63
hazheng 59:b709711bc566 64 //IMU Manager Class
hazheng 91:7b1910ca3ad6 65 #define PIN_IMC_SDA PTC9 /*!< @brief I2C connection to the IMU, SDA line. */
hazheng 91:7b1910ca3ad6 66 #define PIN_IMC_SCL PTC8 /*!< @brief I2C connection to the IMU, SCL line. */
hazheng 62:bc5caf59fe39 67 //#define PIN_IMC_SDA PTE25
hazheng 62:bc5caf59fe39 68 //#define PIN_IMC_SCL PTE24
hazheng 59:b709711bc566 69
hazheng 91:7b1910ca3ad6 70 #define PIN_IMC_ACCL_SA0 PTB8 /*!< @brief IMU accelerometer slave address select 0. */
hazheng 91:7b1910ca3ad6 71 #define PIN_IMC_ACCL_SA1 PTB9 /*!< @brief IMU accelerometer slave address select 1. */
hazheng 59:b709711bc566 72
hazheng 28:271fc8445e89 73 //////////////////////////////////////
hazheng 28:271fc8445e89 74 //Global Ports
hazheng 91:7b1910ca3ad6 75 #define PIN_SPI_MOSI PTD2 /*!< @brief MOSI pin for the SPI port. */
hazheng 91:7b1910ca3ad6 76 #define PIN_SPI_MISO PTD3 /*!< @brief MISO pin for the SPI port. */
hazheng 91:7b1910ca3ad6 77 #define PIN_SPI_SCK PTD1 /*!< @brief SCK pin for the SPI port. */
hazheng 28:271fc8445e89 78
hazheng 29:f87d8790f57d 79
hazheng 28:271fc8445e89 80
Bobymicjohn 8:92f6baeea027 81 #endif