Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sat Jun 03 00:22:44 2017 +0000
Revision:
46:b156ef445742
Parent:
18:6a4db94011d3
Final code for internal battlebot competition.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /* mbed Microcontroller Library
sahilmgandhi 18:6a4db94011d3 2 *******************************************************************************
sahilmgandhi 18:6a4db94011d3 3 * Copyright (c) 2014, STMicroelectronics
sahilmgandhi 18:6a4db94011d3 4 * All rights reserved.
sahilmgandhi 18:6a4db94011d3 5 *
sahilmgandhi 18:6a4db94011d3 6 * Redistribution and use in source and binary forms, with or without
sahilmgandhi 18:6a4db94011d3 7 * modification, are permitted provided that the following conditions are met:
sahilmgandhi 18:6a4db94011d3 8 *
sahilmgandhi 18:6a4db94011d3 9 * 1. Redistributions of source code must retain the above copyright notice,
sahilmgandhi 18:6a4db94011d3 10 * this list of conditions and the following disclaimer.
sahilmgandhi 18:6a4db94011d3 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
sahilmgandhi 18:6a4db94011d3 12 * this list of conditions and the following disclaimer in the documentation
sahilmgandhi 18:6a4db94011d3 13 * and/or other materials provided with the distribution.
sahilmgandhi 18:6a4db94011d3 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
sahilmgandhi 18:6a4db94011d3 15 * may be used to endorse or promote products derived from this software
sahilmgandhi 18:6a4db94011d3 16 * without specific prior written permission.
sahilmgandhi 18:6a4db94011d3 17 *
sahilmgandhi 18:6a4db94011d3 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
sahilmgandhi 18:6a4db94011d3 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sahilmgandhi 18:6a4db94011d3 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
sahilmgandhi 18:6a4db94011d3 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
sahilmgandhi 18:6a4db94011d3 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sahilmgandhi 18:6a4db94011d3 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
sahilmgandhi 18:6a4db94011d3 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
sahilmgandhi 18:6a4db94011d3 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
sahilmgandhi 18:6a4db94011d3 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
sahilmgandhi 18:6a4db94011d3 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sahilmgandhi 18:6a4db94011d3 28 *******************************************************************************
sahilmgandhi 18:6a4db94011d3 29 */
sahilmgandhi 18:6a4db94011d3 30 #ifndef MBED_PINNAMES_H
sahilmgandhi 18:6a4db94011d3 31 #define MBED_PINNAMES_H
sahilmgandhi 18:6a4db94011d3 32
sahilmgandhi 18:6a4db94011d3 33 #include "cmsis.h"
sahilmgandhi 18:6a4db94011d3 34 #include "PinNamesTypes.h"
sahilmgandhi 18:6a4db94011d3 35
sahilmgandhi 18:6a4db94011d3 36 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 37 extern "C" {
sahilmgandhi 18:6a4db94011d3 38 #endif
sahilmgandhi 18:6a4db94011d3 39
sahilmgandhi 18:6a4db94011d3 40 typedef enum {
sahilmgandhi 18:6a4db94011d3 41 PA_0 = 0x00,
sahilmgandhi 18:6a4db94011d3 42 PA_1 = 0x01,
sahilmgandhi 18:6a4db94011d3 43 PA_2 = 0x02,
sahilmgandhi 18:6a4db94011d3 44 PA_3 = 0x03,
sahilmgandhi 18:6a4db94011d3 45 PA_4 = 0x04,
sahilmgandhi 18:6a4db94011d3 46 PA_5 = 0x05,
sahilmgandhi 18:6a4db94011d3 47 PA_6 = 0x06,
sahilmgandhi 18:6a4db94011d3 48 PA_7 = 0x07,
sahilmgandhi 18:6a4db94011d3 49 PA_8 = 0x08,
sahilmgandhi 18:6a4db94011d3 50 PA_9 = 0x09,
sahilmgandhi 18:6a4db94011d3 51 PA_10 = 0x0A,
sahilmgandhi 18:6a4db94011d3 52 PA_11 = 0x0B,
sahilmgandhi 18:6a4db94011d3 53 PA_12 = 0x0C,
sahilmgandhi 18:6a4db94011d3 54 PA_13 = 0x0D,
sahilmgandhi 18:6a4db94011d3 55 PA_14 = 0x0E,
sahilmgandhi 18:6a4db94011d3 56 PA_15 = 0x0F,
sahilmgandhi 18:6a4db94011d3 57
sahilmgandhi 18:6a4db94011d3 58 PB_0 = 0x10,
sahilmgandhi 18:6a4db94011d3 59 PB_1 = 0x11,
sahilmgandhi 18:6a4db94011d3 60 PB_2 = 0x12,
sahilmgandhi 18:6a4db94011d3 61 PB_3 = 0x13,
sahilmgandhi 18:6a4db94011d3 62 PB_4 = 0x14,
sahilmgandhi 18:6a4db94011d3 63 PB_5 = 0x15,
sahilmgandhi 18:6a4db94011d3 64 PB_6 = 0x16,
sahilmgandhi 18:6a4db94011d3 65 PB_7 = 0x17,
sahilmgandhi 18:6a4db94011d3 66 PB_8 = 0x18,
sahilmgandhi 18:6a4db94011d3 67 PB_9 = 0x19,
sahilmgandhi 18:6a4db94011d3 68 PB_10 = 0x1A,
sahilmgandhi 18:6a4db94011d3 69 PB_11 = 0x1B,
sahilmgandhi 18:6a4db94011d3 70 PB_12 = 0x1C,
sahilmgandhi 18:6a4db94011d3 71 PB_13 = 0x1D,
sahilmgandhi 18:6a4db94011d3 72 PB_14 = 0x1E,
sahilmgandhi 18:6a4db94011d3 73 PB_15 = 0x1F,
sahilmgandhi 18:6a4db94011d3 74
sahilmgandhi 18:6a4db94011d3 75 PC_0 = 0x20,
sahilmgandhi 18:6a4db94011d3 76 PC_1 = 0x21,
sahilmgandhi 18:6a4db94011d3 77 PC_2 = 0x22,
sahilmgandhi 18:6a4db94011d3 78 PC_3 = 0x23,
sahilmgandhi 18:6a4db94011d3 79 PC_4 = 0x24,
sahilmgandhi 18:6a4db94011d3 80 PC_5 = 0x25,
sahilmgandhi 18:6a4db94011d3 81 PC_6 = 0x26,
sahilmgandhi 18:6a4db94011d3 82 PC_7 = 0x27,
sahilmgandhi 18:6a4db94011d3 83 PC_8 = 0x28,
sahilmgandhi 18:6a4db94011d3 84 PC_9 = 0x29,
sahilmgandhi 18:6a4db94011d3 85 PC_10 = 0x2A,
sahilmgandhi 18:6a4db94011d3 86 PC_11 = 0x2B,
sahilmgandhi 18:6a4db94011d3 87 PC_12 = 0x2C,
sahilmgandhi 18:6a4db94011d3 88 PC_13 = 0x2D,
sahilmgandhi 18:6a4db94011d3 89 PC_14 = 0x2E,
sahilmgandhi 18:6a4db94011d3 90 PC_15 = 0x2F,
sahilmgandhi 18:6a4db94011d3 91
sahilmgandhi 18:6a4db94011d3 92 PD_2 = 0x32,
sahilmgandhi 18:6a4db94011d3 93
sahilmgandhi 18:6a4db94011d3 94 PH_0 = 0x70,
sahilmgandhi 18:6a4db94011d3 95 PH_1 = 0x71,
sahilmgandhi 18:6a4db94011d3 96
sahilmgandhi 18:6a4db94011d3 97 // ADC internal channels
sahilmgandhi 18:6a4db94011d3 98 ADC_TEMP = 0xF0,
sahilmgandhi 18:6a4db94011d3 99 ADC_VREF = 0xF1,
sahilmgandhi 18:6a4db94011d3 100 ADC_VBAT = 0xF2,
sahilmgandhi 18:6a4db94011d3 101
sahilmgandhi 18:6a4db94011d3 102 // Generic signals namings
sahilmgandhi 18:6a4db94011d3 103 LED1 = PA_9,
sahilmgandhi 18:6a4db94011d3 104 LED2 = PA_9,
sahilmgandhi 18:6a4db94011d3 105 LED3 = PA_9,
sahilmgandhi 18:6a4db94011d3 106 LED4 = PA_9,
sahilmgandhi 18:6a4db94011d3 107 SERIAL_TX = PA_9,
sahilmgandhi 18:6a4db94011d3 108 SERIAL_RX = PA_10,
sahilmgandhi 18:6a4db94011d3 109 I2C_SCL = PA_8,
sahilmgandhi 18:6a4db94011d3 110 I2C_SDA = PC_9,
sahilmgandhi 18:6a4db94011d3 111 SPI_MOSI = PC_12,
sahilmgandhi 18:6a4db94011d3 112 SPI_MISO = PC_11,
sahilmgandhi 18:6a4db94011d3 113 SPI_SCK = PC_10,
sahilmgandhi 18:6a4db94011d3 114 SPI_CS = PC_13,
sahilmgandhi 18:6a4db94011d3 115 PWM0 = PA_8,
sahilmgandhi 18:6a4db94011d3 116 PWM1 = PC_9,
sahilmgandhi 18:6a4db94011d3 117
sahilmgandhi 18:6a4db94011d3 118 // Not connected
sahilmgandhi 18:6a4db94011d3 119 NC = (int)0xFFFFFFFF
sahilmgandhi 18:6a4db94011d3 120 } PinName;
sahilmgandhi 18:6a4db94011d3 121
sahilmgandhi 18:6a4db94011d3 122 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 123 }
sahilmgandhi 18:6a4db94011d3 124 #endif
sahilmgandhi 18:6a4db94011d3 125
sahilmgandhi 18:6a4db94011d3 126 #endif