Version 1
Dependencies: mbed-os-retarget-segger-rtt SPI_MX25R
source/main.h@2:1f796b4529df, 2020-08-12 (annotated)
- Committer:
- d4rth_j0k3r
- Date:
- Wed Aug 12 09:43:52 2020 +0000
- Revision:
- 2:1f796b4529df
- Parent:
- 1:1fbbef4e4497
- Child:
- 3:3e570f67f243
BackUp
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
d4rth_j0k3r | 0:11abb8d64f62 | 1 | /* Pneumoscope Version 1.0 |
d4rth_j0k3r | 0:11abb8d64f62 | 2 | Main.h |
d4rth_j0k3r | 0:11abb8d64f62 | 3 | Florian CHAYS |
d4rth_j0k3r | 0:11abb8d64f62 | 4 | */ |
d4rth_j0k3r | 0:11abb8d64f62 | 5 | |
d4rth_j0k3r | 0:11abb8d64f62 | 6 | // ==== PROTOTYPES ==== |
d4rth_j0k3r | 0:11abb8d64f62 | 7 | void reset_leds(); |
d4rth_j0k3r | 0:11abb8d64f62 | 8 | void clear_memory(); |
d4rth_j0k3r | 0:11abb8d64f62 | 9 | void read_range(int max_data); |
d4rth_j0k3r | 0:11abb8d64f62 | 10 | |
d4rth_j0k3r | 0:11abb8d64f62 | 11 | void init(); |
d4rth_j0k3r | 0:11abb8d64f62 | 12 | void bluetooth(); |
d4rth_j0k3r | 0:11abb8d64f62 | 13 | void test_flash_1(); |
d4rth_j0k3r | 0:11abb8d64f62 | 14 | void test_flash_2(); |
d4rth_j0k3r | 0:11abb8d64f62 | 15 | void test_ADC(); |
d4rth_j0k3r | 0:11abb8d64f62 | 16 | |
d4rth_j0k3r | 0:11abb8d64f62 | 17 | bool error_check(int index, unsigned char data_in, unsigned char data_out); |
d4rth_j0k3r | 0:11abb8d64f62 | 18 | |
d4rth_j0k3r | 0:11abb8d64f62 | 19 | |
d4rth_j0k3r | 0:11abb8d64f62 | 20 | // ==== GLOBAL VARIABLES ==== |
d4rth_j0k3r | 0:11abb8d64f62 | 21 | bool nr_error[3]; |
d4rth_j0k3r | 0:11abb8d64f62 | 22 | int MAX_DATA; |
d4rth_j0k3r | 0:11abb8d64f62 | 23 | |
d4rth_j0k3r | 0:11abb8d64f62 | 24 | enum States |
d4rth_j0k3r | 0:11abb8d64f62 | 25 | { |
d4rth_j0k3r | 0:11abb8d64f62 | 26 | ST_INIT, |
d4rth_j0k3r | 0:11abb8d64f62 | 27 | ST_P1, |
d4rth_j0k3r | 0:11abb8d64f62 | 28 | ST_P2, |
d4rth_j0k3r | 0:11abb8d64f62 | 29 | ST_P3, |
d4rth_j0k3r | 0:11abb8d64f62 | 30 | ST_END |
d4rth_j0k3r | 0:11abb8d64f62 | 31 | }; |
d4rth_j0k3r | 0:11abb8d64f62 | 32 | States MS_State; |
d4rth_j0k3r | 0:11abb8d64f62 | 33 | |
d4rth_j0k3r | 0:11abb8d64f62 | 34 | // ==== INPUT / OUTPUT ==== |
d4rth_j0k3r | 0:11abb8d64f62 | 35 | // Digital Outputs |
d4rth_j0k3r | 2:1f796b4529df | 36 | //DigitalOut myled(LED_1); |
d4rth_j0k3r | 2:1f796b4529df | 37 | DigitalOut myled(P0_13); |
d4rth_j0k3r | 0:11abb8d64f62 | 38 | |
d4rth_j0k3r | 0:11abb8d64f62 | 39 | // Digital Inputs |
d4rth_j0k3r | 2:1f796b4529df | 40 | DigitalIn button(P0_12); |
d4rth_j0k3r | 2:1f796b4529df | 41 | //DigitalIn button(BUTTON_2); |
d4rth_j0k3r | 0:11abb8d64f62 | 42 | |
d4rth_j0k3r | 0:11abb8d64f62 | 43 | // Analogs Inputs |
d4rth_j0k3r | 0:11abb8d64f62 | 44 | AnalogIn Mic_Amb(P0_2); |
d4rth_j0k3r | 0:11abb8d64f62 | 45 | AnalogIn Mic_Pat(P0_3); |
d4rth_j0k3r | 0:11abb8d64f62 | 46 | AnalogIn Temp_1(P0_4); |
d4rth_j0k3r | 0:11abb8d64f62 | 47 | AnalogIn Temp_2(P0_5); |
d4rth_j0k3r | 0:11abb8d64f62 | 48 | |
d4rth_j0k3r | 0:11abb8d64f62 | 49 | // SPI_MX25R(PinName mosi, PinName miso, PinName sclk, PinName cs) ; |
d4rth_j0k3r | 0:11abb8d64f62 | 50 | SPI_MX25R spi_mem(QSPI_FLASH1_IO0, QSPI_FLASH1_IO1, QSPI_FLASH1_SCK, QSPI_FLASH1_CSN); |
d4rth_j0k3r | 0:11abb8d64f62 | 51 | DigitalIn Flash_nReset(QSPI_FLASH1_IO3); |
d4rth_j0k3r | 1:1fbbef4e4497 | 52 | DigitalIn Flash_WP(QSPI_FLASH1_IO2); |