RS41ng/src/config.c

121 wiersze
3.9 KiB
C
Czysty Zwykły widok Historia

/**
* The tracker firmware will transmit each of the message templates defined here in rotation, one by one,
* starting again from the beginning once the last message for a particular mode is transmitted.
*
* Supported variable references in templates:
*
* $cs - Call sign
* $loc4 - Locator (4 chars)
* $loc6 - Locator (6 chars)
* $loc8 - Locator (8 chars)
* $loc12 - Locator (12 chars)
* $bv - Battery voltage in millivolts (up to 4 chars)
* $te - External temperature in C (up to 3 chars)
* $ti - Internal temperature in C (up to 3 chars)
* $hu - Humidity percentage (up to 3 chars)
* $pr - Atmospheric pressure in millibars (up to 4 chars)
* $tow - GPS time of week in milliseconds
* $hh - Current hour (2 chars)
* $mm - Current minute (2 chars)
* $ss - Current second (2 chars)
* $sv - GPS satellites visible (up to 2 chars)
* $lat - Latitude in degrees * 1000 (up to 6 chars)
* $lon - Longitude in degrees * 1000 (up to 6 chars)
* $alt - Altitude in meters (up to 5 chars)
* $gs - Ground speed in km/h (up to 3 chars)
* $cl - Climb in m/s (up to 2 chars)
* $he - Heading in degrees (up to 3 chars)
* $pc - Pulse counter value (wraps to zero at 65535, 16-bit unsigned value)
* $ri - Radiation intensity in µR/h (up to 5 chars)
Graw DFM-17 radiosonde support (#61) * Initial plumbing for DFM17 (#54) * Implementing Si4063 radio chip support for DFM17 sonde. Work in progress. * Add an error to indicate that the code does not work yet * Removed copyrighted docs from documentation and provided links instead (#55) * Fix SPI bus initialization for DFM17. Trying to make Si4063 SPI communication work (in progress). Fix LED bit polarity. * Set DFM17 clocks correctly to 24 MHz * Still trying to fix Si4063 SPI communication, no luck * Add clearing of SPI overrun status flag to make Si4063 comm work properly in DFM17. Not sure about the reason this is required. * Fix bug when setting Si4063 frequency. Remove unnecessary GPS debug and delays. Add Si4063 debug printout. Find a suitable frequency offset multiplier to achieve 270 Hz tone spacing for Horus 4FSK. * Add some known good Si4063 configuration values. Implement direct GPIO-based modulation for Si4063 that allows support for CW now. * DFM-17 APRS work (#60) * Modify for APRS on DFM17 * Clean up Si4063 APRS work and make APRS deviation configurable * Add documentation for DFM-17 * Add a note about the DFM-17 connector * More work on docs and config for DFM-17 * Docs * Mor work on config * Fix RS41 URL * Added info about high-altitude balloon flights * Fix typo * More code cleanup * Update authors * Improve DFM-17 docs * Added a timepulse routine for DFM17 and also a millis() routine. Working toward clock calibration. * More refinements to the HCI calibration * Cleaned up clock calibration code and integrated into the main radio loop. Also added APRS telemetry for calibration. * Added logic to (hopefully) avoid over-calibration if there is an errant timepulse. * Clean up DFM-17 clock calibration implementation and make RS41 compile properly * Adjust README * Add notes about DFM-17 clock calibration * Fix typo * Add DFM-17 note about clock calibration to the top of the README * Text style * Working on README * Working on README * Move datasheet links to main README * Markdown styling * Improve config file structure * Remove unnecessary comments --------- Co-authored-by: Mike Hojnowski <kd2eat@gmail.com>
2023-10-15 09:38:05 +00:00
* $ct - Clock calibration trim value (0-31, only for DFM-17)
* $cc - Clock calibration change count (only for DFM-17)
*
* Allowed message lengths:
*
* APRS comment - Free text up to 127 chars
* FT8 - Free text up to 13 chars (Type 0.0 free text message, Type 0.5 telemetry message)
* JT65 - Free text up to 13 chars (Plaintext Type 6 message)
* JT9 - Free text up to 13 chars (Plaintext Type 6 message)
* JT4 - Free text up to 13 chars (Plaintext Type 6 message)
* FSQ - Call sign up to 20 chars, free text up to 130 chars
* WSPR - Call sign up to 6 chars, locator 4 chars, output power in dBm
*/
#include <stdlib.h>
#include "config.h"
bool leds_enabled = LEDS_ENABLE;
bool bmp280_enabled = SENSOR_BMP280_ENABLE;
bool radsens_enabled = SENSOR_RADSENS_ENABLE;
bool si5351_enabled = RADIO_SI5351_ENABLE;
bool gps_nmea_output_enabled = GPS_NMEA_OUTPUT_VIA_SERIAL_PORT_ENABLE;
bool pulse_counter_enabled = PULSE_COUNTER_ENABLE;
volatile bool system_initialized = false;
2021-08-12 21:42:50 +00:00
/**
* CW mode messages.
* Maximum length: 64 characters.
*/
char *cw_message_templates[] = {
Graw DFM-17 radiosonde support (#61) * Initial plumbing for DFM17 (#54) * Implementing Si4063 radio chip support for DFM17 sonde. Work in progress. * Add an error to indicate that the code does not work yet * Removed copyrighted docs from documentation and provided links instead (#55) * Fix SPI bus initialization for DFM17. Trying to make Si4063 SPI communication work (in progress). Fix LED bit polarity. * Set DFM17 clocks correctly to 24 MHz * Still trying to fix Si4063 SPI communication, no luck * Add clearing of SPI overrun status flag to make Si4063 comm work properly in DFM17. Not sure about the reason this is required. * Fix bug when setting Si4063 frequency. Remove unnecessary GPS debug and delays. Add Si4063 debug printout. Find a suitable frequency offset multiplier to achieve 270 Hz tone spacing for Horus 4FSK. * Add some known good Si4063 configuration values. Implement direct GPIO-based modulation for Si4063 that allows support for CW now. * DFM-17 APRS work (#60) * Modify for APRS on DFM17 * Clean up Si4063 APRS work and make APRS deviation configurable * Add documentation for DFM-17 * Add a note about the DFM-17 connector * More work on docs and config for DFM-17 * Docs * Mor work on config * Fix RS41 URL * Added info about high-altitude balloon flights * Fix typo * More code cleanup * Update authors * Improve DFM-17 docs * Added a timepulse routine for DFM17 and also a millis() routine. Working toward clock calibration. * More refinements to the HCI calibration * Cleaned up clock calibration code and integrated into the main radio loop. Also added APRS telemetry for calibration. * Added logic to (hopefully) avoid over-calibration if there is an errant timepulse. * Clean up DFM-17 clock calibration implementation and make RS41 compile properly * Adjust README * Add notes about DFM-17 clock calibration * Fix typo * Add DFM-17 note about clock calibration to the top of the README * Text style * Working on README * Working on README * Move datasheet links to main README * Markdown styling * Improve config file structure * Remove unnecessary comments --------- Co-authored-by: Mike Hojnowski <kd2eat@gmail.com>
2023-10-15 09:38:05 +00:00
"$cs",
// "$cs $loc6 $altm $gs km/h $tiC",
// "$cs $loc6",
// "$alt m",
// "$gs km/h $ti C",
NULL
};
/**
* "Pip" mode messages. Transmitted as CW, because a single "pip" can be represented as the 'E' character.
* Maximum length: 64 characters.
*/
char *pip_message_templates[] = {
"E", // An 'E' character in CW represents a single "pip".
2021-08-12 21:42:50 +00:00
NULL
};
/**
* APRS mode comment messages.
* Maximum length: depends on the packet contents, but keeping this under 100 characters is usually safe.
* Note that many hardware APRS receivers show a limited number of APRS comment characters, such as 43 or 67 chars.
*/
char *aprs_comment_templates[] = {
// " B$bu $teC $hu% $prmb $hh:$mm:$ss @ $tow ms - " APRS_COMMENT,
// " B$bu $teC $hu% $prmb - " APRS_COMMENT,
// " B$bu $loc12 $hh:$mm:$ss - " APRS_COMMENT,
// " $loc12 - " APRS_COMMENT,
// " $teC $hu% $prmb PC $pc RI $ri uR/h - " APRS_COMMENT,
Graw DFM-17 radiosonde support (#61) * Initial plumbing for DFM17 (#54) * Implementing Si4063 radio chip support for DFM17 sonde. Work in progress. * Add an error to indicate that the code does not work yet * Removed copyrighted docs from documentation and provided links instead (#55) * Fix SPI bus initialization for DFM17. Trying to make Si4063 SPI communication work (in progress). Fix LED bit polarity. * Set DFM17 clocks correctly to 24 MHz * Still trying to fix Si4063 SPI communication, no luck * Add clearing of SPI overrun status flag to make Si4063 comm work properly in DFM17. Not sure about the reason this is required. * Fix bug when setting Si4063 frequency. Remove unnecessary GPS debug and delays. Add Si4063 debug printout. Find a suitable frequency offset multiplier to achieve 270 Hz tone spacing for Horus 4FSK. * Add some known good Si4063 configuration values. Implement direct GPIO-based modulation for Si4063 that allows support for CW now. * DFM-17 APRS work (#60) * Modify for APRS on DFM17 * Clean up Si4063 APRS work and make APRS deviation configurable * Add documentation for DFM-17 * Add a note about the DFM-17 connector * More work on docs and config for DFM-17 * Docs * Mor work on config * Fix RS41 URL * Added info about high-altitude balloon flights * Fix typo * More code cleanup * Update authors * Improve DFM-17 docs * Added a timepulse routine for DFM17 and also a millis() routine. Working toward clock calibration. * More refinements to the HCI calibration * Cleaned up clock calibration code and integrated into the main radio loop. Also added APRS telemetry for calibration. * Added logic to (hopefully) avoid over-calibration if there is an errant timepulse. * Clean up DFM-17 clock calibration implementation and make RS41 compile properly * Adjust README * Add notes about DFM-17 clock calibration * Fix typo * Add DFM-17 note about clock calibration to the top of the README * Text style * Working on README * Working on README * Move datasheet links to main README * Markdown styling * Improve config file structure * Remove unnecessary comments --------- Co-authored-by: Mike Hojnowski <kd2eat@gmail.com>
2023-10-15 09:38:05 +00:00
" " APRS_COMMENT,
NULL
};
char *cats_comment_templates[] = {
CATS_COMMENT,
NULL
};
/**
* FSQ mode comment message templates.
* Maximum length: 130 characters.
*/
char *fsq_comment_templates[] = {
// "TEST $loc6 $altm $tiC",
2021-08-12 21:42:50 +00:00
// " $lat $lon, $alt m, $cl m/s, $gs km/h, $he deg - " FSQ_COMMENT,
// " $loc12, $teC $hu% $prmb $hh:$mm:$ss @ $tow ms - " FSQ_COMMENT,
NULL
};
/**
* FTx/JTxx mode message templates.
* Maximum length: 13 characters allowed by the protocols.
*/
char *ftjt_message_templates[] = {
2021-08-12 21:42:50 +00:00
// "$cs $loc4",
// "$loc12",
// "$altm $cl",
// "$bvmV $tiC",
// "$hu% $prmb",
NULL
};