football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Committer:
andriym
Date:
Sat May 28 13:13:41 2016 +0000
Revision:
84:705de339f554
Parent:
83:79cb2ba44b66
Child:
87:a9870d513fcf
High power radio disabled for Nordic

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andriym 83:79cb2ba44b66 1 #ifndef CONFIGS_h
andriym 83:79cb2ba44b66 2 #define CONFIGS_h
andriym 78:43a6b54f0372 3 /////////////////////////////////// HARDWARE SELECTION ///////////////////////////////////
andriym 78:43a6b54f0372 4
andriym 78:43a6b54f0372 5 // Board select, if none selected - LPC1768 assumed
andriym 84:705de339f554 6 #define NORDIC // nRF51822 (highest priority)
andriym 78:43a6b54f0372 7 #define NUCLEO // Nucleo-F411RE (lesser priority)
andriym 78:43a6b54f0372 8
andriym 78:43a6b54f0372 9 // Frequency select
andriym 78:43a6b54f0372 10 //#define FREQUENCY RF69_433MHZ
andriym 84:705de339f554 11 //#define FREQUENCY RF69_868MHZ
andriym 84:705de339f554 12 #define FREQUENCY RF69_915MHZ
andriym 78:43a6b54f0372 13
andriym 84:705de339f554 14 #define _HIGH_POWER // High power radio
andriym 78:43a6b54f0372 15
andriym 78:43a6b54f0372 16 // Output select
andriym 84:705de339f554 17 #define NO_DISP // No display?
andriym 78:43a6b54f0372 18 #define NO_SERIAL // Send info over serial?
andriym 78:43a6b54f0372 19 #define TEXT_LCD // Text LCD display
andriym 78:43a6b54f0372 20 #define _I2C_DISP // I2C display (SPI assumed)
andriym 79:9db29f41dc9d 21 #define ENABLE_SOUND // Turns on sound in the beep() function
andriym 83:79cb2ba44b66 22 #define ENABLE_PIN
andriym 78:43a6b54f0372 23
andriym 78:43a6b54f0372 24 /////////////////////////////////// CONSTANTS ///////////////////////////////////
andriym 78:43a6b54f0372 25
andriym 78:43a6b54f0372 26 #define EVERY_NODE 255 // Abstract address we are sending the packets to (doesn't matter)
andriym 78:43a6b54f0372 27 #define NETWORKID 102 // The same on all nodes that talk to each other
andriym 78:43a6b54f0372 28
andriym 79:9db29f41dc9d 29 #define CYCLE_MS 2400
andriym 79:9db29f41dc9d 30 #define SEND_RATE_MS 400L // 0.33 s
andriym 79:9db29f41dc9d 31 //#define SEND_DESYNC 0.20 // 0.20 -> send rate +/-10%
andriym 79:9db29f41dc9d 32 #define MAX_RECORDS 6
andriym 78:43a6b54f0372 33 #define NAME_LEN 5
andriym 78:43a6b54f0372 34 #define SIGNALS_VALID_MS 4000
andriym 79:9db29f41dc9d 35 #define MAX_HISTORY_MS 60000 // 1 minute
andriym 78:43a6b54f0372 36
andriym 79:9db29f41dc9d 37 #define NOTE_A3 0.004545454
andriym 79:9db29f41dc9d 38 #define NOTE_A4 0.002272727
andriym 79:9db29f41dc9d 39 #define NOTE_A5 0.001136363
andriym 79:9db29f41dc9d 40
andriym 79:9db29f41dc9d 41 const uint8_t SPACE[] = {1, 50, 60, 100}; // 5, 10, 15, 20 meters
andriym 78:43a6b54f0372 42
andriym 78:43a6b54f0372 43 /////////////////////////////////// LOGIC ///////////////////////////////////
andriym 78:43a6b54f0372 44 #ifdef NORDIC
andriym 78:43a6b54f0372 45
andriym 78:43a6b54f0372 46 #ifndef NO_DISP
andriym 78:43a6b54f0372 47 #define NO_DISP // NORDIC --> no display (use Serial)
andriym 78:43a6b54f0372 48 #endif
andriym 78:43a6b54f0372 49
andriym 79:9db29f41dc9d 50 #define PRESSED 1
andriym 79:9db29f41dc9d 51 #define RELEASED 0
andriym 79:9db29f41dc9d 52
andriym 79:9db29f41dc9d 53 #else // NORDIC
andriym 79:9db29f41dc9d 54
andriym 79:9db29f41dc9d 55 #define PRESSED 0
andriym 79:9db29f41dc9d 56 #define RELEASED 1
andriym 79:9db29f41dc9d 57
andriym 79:9db29f41dc9d 58 #endif // NORDIC
andriym 79:9db29f41dc9d 59
andriym 79:9db29f41dc9d 60
andriym 79:9db29f41dc9d 61 /////////////////////// PINS ///////////////////////
andriym 79:9db29f41dc9d 62 #ifdef NORDIC
andriym 79:9db29f41dc9d 63
andriym 79:9db29f41dc9d 64 #define LED_SPACE5 P0_7
andriym 79:9db29f41dc9d 65 #define LED_SPACE10 P0_8
andriym 79:9db29f41dc9d 66 #define LED_SPACE15 P0_9
andriym 79:9db29f41dc9d 67 #define LED_SPACE20 P0_11
andriym 79:9db29f41dc9d 68 #define LED_TEAM_A P0_22
andriym 79:9db29f41dc9d 69 #define LED_TEAM_B P0_0
andriym 79:9db29f41dc9d 70 #define LED_BUZZER_ON P0_3
andriym 79:9db29f41dc9d 71
andriym 79:9db29f41dc9d 72 #define BUZZER P0_5
andriym 79:9db29f41dc9d 73 #define BUZZ_HIGH P0_4
andriym 79:9db29f41dc9d 74 #define BUZZ_MED P0_1
andriym 79:9db29f41dc9d 75 #define BUZZ_LOW P0_2
andriym 79:9db29f41dc9d 76
andriym 79:9db29f41dc9d 77 #define BUT_VOL_MORE P0_28
andriym 79:9db29f41dc9d 78 #define BUT_VOL_LESS P0_10
andriym 79:9db29f41dc9d 79 #define BUT_SPACE P0_21
andriym 79:9db29f41dc9d 80 #define BUT_TEAM P0_15
andriym 79:9db29f41dc9d 81
andriym 79:9db29f41dc9d 82 #define RFM_MOSI P0_19
andriym 79:9db29f41dc9d 83 #define RFM_MISO P0_18
andriym 79:9db29f41dc9d 84 #define RFM_SCK P0_17
andriym 79:9db29f41dc9d 85 #define RFM_SS P0_20
andriym 79:9db29f41dc9d 86 #define RFM_IRQ P0_12
andriym 83:79cb2ba44b66 87 #ifdef ENABLE_PIN
andriym 79:9db29f41dc9d 88 #define RFM_ISM_EN P0_16
andriym 83:79cb2ba44b66 89 #endif // ENABLE_PIN
andriym 79:9db29f41dc9d 90
andriym 79:9db29f41dc9d 91 #define CHARGE P0_6
andriym 79:9db29f41dc9d 92 #define V_MEAS
andriym 79:9db29f41dc9d 93 #define VBAT
andriym 79:9db29f41dc9d 94 #define PWR_BTN
andriym 79:9db29f41dc9d 95
andriym 79:9db29f41dc9d 96 #define ANALOG_IN CHARGE
andriym 79:9db29f41dc9d 97
andriym 79:9db29f41dc9d 98 #else
andriym 79:9db29f41dc9d 99 #ifdef NUCLEO
andriym 79:9db29f41dc9d 100
andriym 81:3cd7de5d01ef 101 #define LED_SPACE5 PC_3
andriym 83:79cb2ba44b66 102 #define LED_SPACE10 D1
andriym 79:9db29f41dc9d 103 #define LED_SPACE15 PA_14
andriym 79:9db29f41dc9d 104 #define LED_SPACE20 PA_15
andriym 79:9db29f41dc9d 105 #define LED_TEAM_A PC_11
andriym 81:3cd7de5d01ef 106 #define LED_TEAM_B PB_2
andriym 81:3cd7de5d01ef 107 #define LED_BUZZER_ON PD_2
andriym 79:9db29f41dc9d 108
andriym 79:9db29f41dc9d 109 #define BUZZER PB_8
andriym 79:9db29f41dc9d 110 #define BUZZ_HIGH
andriym 79:9db29f41dc9d 111 #define BUZZ_MED
andriym 79:9db29f41dc9d 112 #define BUZZ_LOW
andriym 79:9db29f41dc9d 113
andriym 81:3cd7de5d01ef 114 #define BUT_VOL_MORE PC_12
andriym 81:3cd7de5d01ef 115 #define BUT_VOL_LESS PC_10
andriym 81:3cd7de5d01ef 116 #define BUT_SPACE PH_1
andriym 79:9db29f41dc9d 117 #define BUT_TEAM USER_BUTTON
andriym 79:9db29f41dc9d 118
andriym 79:9db29f41dc9d 119 #define RFM_MOSI D11
andriym 79:9db29f41dc9d 120 #define RFM_MISO D12
andriym 79:9db29f41dc9d 121 #define RFM_SCK D13
andriym 79:9db29f41dc9d 122 #define RFM_SS D10
andriym 79:9db29f41dc9d 123 #define RFM_IRQ D9
andriym 83:79cb2ba44b66 124 #ifdef ENABLE_PIN
andriym 83:79cb2ba44b66 125 #define RFM_ISM_EN PA_13
andriym 83:79cb2ba44b66 126 #endif // ENABLE_PIN
andriym 79:9db29f41dc9d 127 #define CHARGE
andriym 79:9db29f41dc9d 128 #define V_MEAS
andriym 79:9db29f41dc9d 129 #define VBAT
andriym 79:9db29f41dc9d 130 #define PWR_BTN
andriym 79:9db29f41dc9d 131
andriym 79:9db29f41dc9d 132 #define ANALOG_IN A5
andriym 79:9db29f41dc9d 133
andriym 79:9db29f41dc9d 134
andriym 79:9db29f41dc9d 135 #else // it's LPC
andriym 79:9db29f41dc9d 136
andriym 79:9db29f41dc9d 137 #define LED_SPACE5
andriym 79:9db29f41dc9d 138 #define LED_SPACE10
andriym 79:9db29f41dc9d 139 #define LED_SPACE15
andriym 79:9db29f41dc9d 140 #define LED_SPACE20
andriym 79:9db29f41dc9d 141 #define LED_TEAM_A
andriym 79:9db29f41dc9d 142 #define LED_TEAM_B
andriym 79:9db29f41dc9d 143 #define LED_BUZZER_ON
andriym 79:9db29f41dc9d 144
andriym 79:9db29f41dc9d 145 #define BUZZER p21
andriym 79:9db29f41dc9d 146 #define BUZZ_HIGH
andriym 79:9db29f41dc9d 147 #define BUZZ_MED
andriym 79:9db29f41dc9d 148 #define BUZZ_LOW
andriym 79:9db29f41dc9d 149
andriym 79:9db29f41dc9d 150 #define BUT_VOL_MORE
andriym 79:9db29f41dc9d 151 #define BUT_VOL_LESS
andriym 79:9db29f41dc9d 152 #define BUT_SPACE
andriym 79:9db29f41dc9d 153 #define BUT_TEAM p5
andriym 79:9db29f41dc9d 154
andriym 79:9db29f41dc9d 155 #define RFM_MOSI p11
andriym 79:9db29f41dc9d 156 #define RFM_MISO p12
andriym 79:9db29f41dc9d 157 #define RFM_SCK p13
andriym 79:9db29f41dc9d 158 #define RFM_SS p10
andriym 79:9db29f41dc9d 159 #define RFM_IRQ p9
andriym 83:79cb2ba44b66 160 #ifdef ENABLE_PIN
andriym 79:9db29f41dc9d 161 #define RFM_ISM_EN
andriym 83:79cb2ba44b66 162 #endif // ENABLE_PIN
andriym 79:9db29f41dc9d 163
andriym 79:9db29f41dc9d 164 #define CHARGE
andriym 79:9db29f41dc9d 165 #define V_MEAS
andriym 79:9db29f41dc9d 166 #define VBAT
andriym 79:9db29f41dc9d 167 #define PWR_BTN
andriym 79:9db29f41dc9d 168
andriym 79:9db29f41dc9d 169 #define ANALOG_IN p15
andriym 79:9db29f41dc9d 170
andriym 79:9db29f41dc9d 171 #endif // NUCLEO
andriym 79:9db29f41dc9d 172 #endif // NORDIC
andriym 83:79cb2ba44b66 173
andriym 83:79cb2ba44b66 174
andriym 83:79cb2ba44b66 175 ////////////////////////////////////////////////////////////
andriym 83:79cb2ba44b66 176 #endif // CONFIGS_h