football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Committer:
andriym
Date:
Wed May 25 17:23:00 2016 +0000
Revision:
81:3cd7de5d01ef
Parent:
79:9db29f41dc9d
Child:
82:1e552cc1a615
Volume control.

Who changed what in which revision?

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