Files
@ b22a378398b3
Branch filter:
Location: seniordesign-firmware/master/master/config.h
b22a378398b3
6.1 KiB
text/plain
fixed configuration issues
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | /*
* Master Firmware: Configuration
*
* Wireless Observational Modular Aerial Network
*
* Ethan Zonca
* Matthew Kanning
* Kyle Ripperger
* Matthew Kroening
*
*/
#ifndef CONFIG_H_
#define CONFIG_H_
#include <avr/pgmspace.h>
// NOTE: Some settings may be overridden by SD card config.ini parameters
// --------------------------------------------------------------------------
// Hardware settings
// --------------------------------------------------------------------------
#define F_CPU 11059200
#define BOARDTEMP_ADDR 0x90
// --------------------------------------------------------------------------
// Module config (master.c)
// --------------------------------------------------------------------------
// Debug Output
//#define DEBUG_OUTPUT
// Blackout (turn off all but power LEDs)
#define BLACKOUT_ENABLE
#define BLACKOUT_TIMEOUT 1200000 // Blackout after 20 minutes (hopefully after fix and launch)
// Board heater setpoint
#define HEATER_THRESHOLD 5 // Regulate to 5 degrees Celsius
// Touchdown buzzer
#define BUZZER_RATE 7000
#define BUZZER_DURATION 1000
#define BUZZER_FAILSAFE_DURATION 9600000 // 160min
#define BUZZER_TRIGGER_MINDURATION 2700000 // 45min
#define BUZZER_TRIGGER_MAXALTITUDE 2000 // feet
// --------------------------------------------------------------------------
// Error Codes config (logger.c)
// --------------------------------------------------------------------------
// SD Card
#define ERROR_SLAVETIMEOUT 0
#define ERROR_SD_INIT 1
#define ERROR_SD_PARTITION 2
#define ERROR_SD_FILE 3
#define ERROR_CONFIGPARSE 4
#define ERROR_XBEETIMEOUT 5
#define ERROR_FATAL 6
#define ERROR_ATFAIL 7
#define ERROR_EXITAT 8
#define ERROR_INFOTEXT 9
#define ERROR_WATCHDOG 10
// !!! Please specify/update detailed messages for these error codes in logger.c
// --------------------------------------------------------------------------
// Slave Sensors config (slavesensors.c)
// --------------------------------------------------------------------------
// Slave data structure size
#define MAX_NUM_SLAVES 5 // Maximum number of nodes in the system
#define MAX_NUM_SENSORS 10 // Maximum number of unique types of sensors in the system
// Node identifier of log destination xbee
#define XBEE_LOGDEST_NAME "HAB-LOGGER"
// Rate to request data from slaves. Must be greater than AT delay * number slaves
#define DATAREQUEST_RATE 3000
// Timeouts
#define TIMEOUT_SLAVEREQUEST 500
#define TIMEOUT_NETWORKSCAN 7000
#define TIMEOUT_EXITAT 2000
#define TIMEOUT_XBEERESPONSE 2000
// Slave data request max retries (for retry upon corrupt data reception)
#define MAX_SLAVEREQUEST_RETRIES 2
// --------------------------------------------------------------------------
// Command Parser config (serparser.c)
// --------------------------------------------------------------------------
// Maximum payload size of command
#define MAX_PAYLOAD_LEN 16
// Circular serial buffer size. Must be at least MAX_CMD_LEN + 5
#define BUFFER_SIZE 128
// --------------------------------------------------------------------------
// GPS config (xxx.c)
// --------------------------------------------------------------------------
// NMEA circular buffer size. Must be large enough to hold all received sentences
#define NMEABUFFER_SIZE 150
// --------------------------------------------------------------------------
// USART config (serial.c)
// --------------------------------------------------------------------------
// Baud rates for XBEE and GPS serial ports
#define USART0_BAUDRATE 115200
#define USART1_BAUDRATE 115200
// --------------------------------------------------------------------------
// AX.25 config (ax25.c)
// --------------------------------------------------------------------------
// TX delay in milliseconds
#define TX_DELAY 200
// Maximum packet delay
#define MAX_PACKET_LEN 512 // bytes
// --------------------------------------------------------------------------
// APRS config (aprs.c)
// --------------------------------------------------------------------------
// Set your callsign and SSID here. Common values for the SSID are
// (from http://zlhams.wikidot.com/aprs-ssidguide):
//
// - Balloons: 11
// - Cars: 9
// - Home: 0
// - IGate: 5
#define S_CALLSIGN "KD8TDF"
#define S_CALLSIGN_ID 11
// Destination callsign: APRS (with SSID=0) is usually okay.
#define D_CALLSIGN "APRS"
#define D_CALLSIGN_ID 0
// Digipeating paths:
// (read more about digipeating paths here: http://wa8lmf.net/DigiPaths/ )
// The recommended digi path for a balloon is WIDE2-1 or pathless. The default
// is pathless. Uncomment the following two lines for WIDE2-1 path:
#define DIGI_PATH1 "WIDE2"
#define DIGI_PATH1_TTL 1
// Transmit the APRS sentence every X milliseconds
#define APRS_TRANSMIT_PERIOD 35000
// --------------------------------------------------------------------------
// Logger config (logger.c)
// --------------------------------------------------------------------------
// Log number EEPROM address (this number is incremented on boot, used for filenames)
#define LOGGER_ID_EEPROM_ADDR 0x10
// Watchdog save/restore of program timer
#define WATCHDOG_PROGTIMER_EEPROM_ADDR 0x20
// Written to the beginning of every log file
#define LOGGER_HEADERTEXT "HAB Master v1.2\n"
// Log to SD card every X milliseconds
#define LOGGER_RATE 1000
// LED cycle indicator speed
#define LEDCYCLE_RATE 100
// --------------------------------------------------------------------------
// Dynamic Configuration (iniparse.c) - You probably don't want to change this
// --------------------------------------------------------------------------
#include <stdbool.h>
typedef struct
{
bool blackout_enable;
uint32_t blackout_timeout;
int8_t heater_threshold;
uint32_t buzzer_failsafe_duration;
uint32_t buzzer_trigger_minduration;
uint32_t buzzer_trigger_maxaltitude;
uint32_t datarequest_rate;
char s_callsign[7];
uint8_t s_callsign_id;
uint32_t aprs_transmit_period;
} configuration;
configuration* sysconfig;
#endif /* CONFIG_H_ */
|