a
Dependencies: Sensor2 MAX31855-1 libmDot-1
board_config.h@1:2d0abfac692b, 2018-01-04 (annotated)
- Committer:
- jortronm2
- Date:
- Thu Jan 04 03:44:09 2018 +0000
- Revision:
- 1:2d0abfac692b
- Parent:
- 0:1441b10e38a6
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jortronm2 | 0:1441b10e38a6 | 1 | #ifndef BOARD_CONFIG_H |
jortronm2 | 0:1441b10e38a6 | 2 | #define BOARD_CONFIG_H |
jortronm2 | 0:1441b10e38a6 | 3 | |
jortronm2 | 0:1441b10e38a6 | 4 | |
jortronm2 | 0:1441b10e38a6 | 5 | #include "mbed.h" |
jortronm2 | 0:1441b10e38a6 | 6 | |
jortronm2 | 0:1441b10e38a6 | 7 | |
jortronm2 | 0:1441b10e38a6 | 8 | /* PIN ALLOCATIONS ************************************************************/ |
jortronm2 | 0:1441b10e38a6 | 9 | |
jortronm2 | 0:1441b10e38a6 | 10 | |
jortronm2 | 0:1441b10e38a6 | 11 | #define PIN_OUTPUT_LED_EXTERNAL PA_0 |
jortronm2 | 0:1441b10e38a6 | 12 | #define PIN_OUTPUT_SENSOR_2_SIGNAL PA_1 |
jortronm2 | 0:1441b10e38a6 | 13 | #define PIN_OUTPUT_ESP_UART_TX PA_2 |
jortronm2 | 0:1441b10e38a6 | 14 | #define PIN_OUTPUT_ESP_UART_RX PA_3 |
jortronm2 | 0:1441b10e38a6 | 15 | #define PIN_OUTPUT_SENSOR_1_SIGNAL PA_4 |
jortronm2 | 0:1441b10e38a6 | 16 | #define PIN_OUTPUT_MAX_SPI_SCK PA_5 |
jortronm2 | 0:1441b10e38a6 | 17 | #define PIN_OUTPUT_MAX_SPI_MISO PA_6 |
jortronm2 | 0:1441b10e38a6 | 18 | #define PIN_OUTPUT_MAX_SPI_MOSI PA_7 |
jortronm2 | 0:1441b10e38a6 | 19 | #define PIN_OUTPUT_ESP_POWER PA_7 |
jortronm2 | 0:1441b10e38a6 | 20 | #define PIN_OUTPUT_ADS_I2C_SCL PA_8 |
jortronm2 | 0:1441b10e38a6 | 21 | #define PIN_OUTPUT_DEBUG_UART_TX PA_9 |
jortronm2 | 0:1441b10e38a6 | 22 | #define PIN_OUTPUT_DEBUG_UART_RX PA_10 |
jortronm2 | 0:1441b10e38a6 | 23 | #define PIN_OUTPUT_SENSOR_POWER PA_11 |
jortronm2 | 0:1441b10e38a6 | 24 | //#define PA_13 // JTAG |
jortronm2 | 0:1441b10e38a6 | 25 | //#define PA_14 // JTAG |
jortronm2 | 0:1441b10e38a6 | 26 | |
jortronm2 | 0:1441b10e38a6 | 27 | #define PIN_OUTPUT_MAX_SPI_CS PB_0 |
jortronm2 | 0:1441b10e38a6 | 28 | #define PIN_OUTPUT_LED_INTERNAL PB_1 |
jortronm2 | 0:1441b10e38a6 | 29 | //#define PB_3 // JTAG |
jortronm2 | 0:1441b10e38a6 | 30 | //#define PB_4 // JTAG |
jortronm2 | 0:1441b10e38a6 | 31 | |
jortronm2 | 0:1441b10e38a6 | 32 | #define PIN_OUTPUT_SENSOR_3_SIGNAL PC_1 |
jortronm2 | 0:1441b10e38a6 | 33 | #define PIN_OUTPUT_ADS_I2C_SDA PC_9 |
jortronm2 | 0:1441b10e38a6 | 34 | #define PIN_INPUT_BUTTON PC_13 |
jortronm2 | 0:1441b10e38a6 | 35 | |
jortronm2 | 0:1441b10e38a6 | 36 | |
jortronm2 | 0:1441b10e38a6 | 37 | /* DEBUG SERIAL SETTINGS *****************************************************/ |
jortronm2 | 0:1441b10e38a6 | 38 | |
jortronm2 | 0:1441b10e38a6 | 39 | |
jortronm2 | 0:1441b10e38a6 | 40 | extern Serial debug_serial; |
jortronm2 | 0:1441b10e38a6 | 41 | #define DEBUG_UART_BAUD 115200 |
jortronm2 | 0:1441b10e38a6 | 42 | // Uncomment "#define DEBUG_SERIAL_ENABLED" to enable debug printing external to the logging system. |
jortronm2 | 0:1441b10e38a6 | 43 | #define DEBUG_SERIAL_ENABLED |
jortronm2 | 0:1441b10e38a6 | 44 | #ifdef DEBUG_SERIAL_ENABLED |
jortronm2 | 0:1441b10e38a6 | 45 | #define DEBUG_PRINTF(...) debug_serial.printf(__VA_ARGS__) |
jortronm2 | 0:1441b10e38a6 | 46 | #else |
jortronm2 | 0:1441b10e38a6 | 47 | #define DEBUG_PRINTF(...) |
jortronm2 | 0:1441b10e38a6 | 48 | #endif |
jortronm2 | 0:1441b10e38a6 | 49 | |
jortronm2 | 0:1441b10e38a6 | 50 | |
jortronm2 | 0:1441b10e38a6 | 51 | /* RADIO SETTINGS *************************************************************/ |
jortronm2 | 0:1441b10e38a6 | 52 | |
jortronm2 | 0:1441b10e38a6 | 53 | |
jortronm2 | 0:1441b10e38a6 | 54 | // Channel plan options: |
jortronm2 | 0:1441b10e38a6 | 55 | // CP_US915 |
jortronm2 | 0:1441b10e38a6 | 56 | // CP_AU915 |
jortronm2 | 0:1441b10e38a6 | 57 | // CP_EU868 |
jortronm2 | 0:1441b10e38a6 | 58 | // CP_KR920 |
jortronm2 | 0:1441b10e38a6 | 59 | // CP_AS923 |
jortronm2 | 0:1441b10e38a6 | 60 | // CP_AS923_JAPAN |
jortronm2 | 0:1441b10e38a6 | 61 | // CP_IN865 |
jortronm2 | 0:1441b10e38a6 | 62 | #define RADIO_CHANNEL_PLAN CP_AU915 |
jortronm2 | 0:1441b10e38a6 | 63 | |
jortronm2 | 0:1441b10e38a6 | 64 | |
jortronm2 | 0:1441b10e38a6 | 65 | /* SENSOR READING SETTINGS ****************************************************/ |
jortronm2 | 0:1441b10e38a6 | 66 | |
jortronm2 | 0:1441b10e38a6 | 67 | |
jortronm2 | 0:1441b10e38a6 | 68 | // Scaling factors to turn raw sensor data into proper readings. |
jortronm2 | 0:1441b10e38a6 | 69 | #define BATTERY_VOLTAGE_SCALE (1193.2f) |
jortronm2 | 0:1441b10e38a6 | 70 | #define TEMPERATURE_READING_SCALE (4) |
jortronm2 | 0:1441b10e38a6 | 71 | |
jortronm2 | 0:1441b10e38a6 | 72 | |
jortronm2 | 0:1441b10e38a6 | 73 | /* IMPORTANT DATA STRUCTURES **************************************************/ |
jortronm2 | 0:1441b10e38a6 | 74 | |
jortronm2 | 0:1441b10e38a6 | 75 | |
jortronm2 | 0:1441b10e38a6 | 76 | // This structure contains the raw sensor data. |
jortronm2 | 0:1441b10e38a6 | 77 | struct sensor_data_raw { |
jortronm2 | 0:1441b10e38a6 | 78 | uint16_t reading_number; |
jortronm2 | 0:1441b10e38a6 | 79 | uint16_t voltage_battery; |
jortronm2 | 0:1441b10e38a6 | 80 | uint16_t voltage_wire[9]; |
jortronm2 | 0:1441b10e38a6 | 81 | int16_t temperature; |
jortronm2 | 0:1441b10e38a6 | 82 | }; |
jortronm2 | 0:1441b10e38a6 | 83 | |
jortronm2 | 0:1441b10e38a6 | 84 | // This structure contains the actual scaled readings. |
jortronm2 | 0:1441b10e38a6 | 85 | struct sensor_data { |
jortronm2 | 0:1441b10e38a6 | 86 | uint16_t reading_number; |
jortronm2 | 0:1441b10e38a6 | 87 | float voltage_battery; |
jortronm2 | 0:1441b10e38a6 | 88 | uint16_t voltage_wire[9]; |
jortronm2 | 0:1441b10e38a6 | 89 | float temperature; |
jortronm2 | 0:1441b10e38a6 | 90 | float rssi; |
jortronm2 | 0:1441b10e38a6 | 91 | }; |
jortronm2 | 0:1441b10e38a6 | 92 | |
jortronm2 | 0:1441b10e38a6 | 93 | |
jortronm2 | 0:1441b10e38a6 | 94 | #endif // BOARD_CONFIG_H |