Shared firmware code for the UST xDOS family of dosimeters (SPACEDOS, AIRDOS, LABDOS, …) running on ATmega1284P with the Arduino core (MightyCore).
The library is meant to hold everything the device firmwares would otherwise copy from each other:
| part | status |
|---|---|
| UART → I2C configuration bridge and config mode — lets dosview read and write the device EEPROM and RTC over the data serial line, see docs/CONFIG_BRIDGE.md | done |
| EEPROM configuration record — reading over I2C, CRC check (the same CRC as dosview), format version handling, age of the RTC sync record | done |
Header of the xDOS data format v2.1 ($DATAFORMAT, $DOS, $ADC, $CALIB, $CHAN, …, $ERROR) from the EEPROM record |
done |
| Unix time from a calendar RTC | done |
The EEPROM record layout itself is not defined here but in xDOS-versions.
Add both repositories as sibling submodules and let PlatformIO link them:
git submodule add ../xDOS-lib lib/xDOS-lib
git submodule add ../xDOS-versions lib/xDOS-versionslib_deps =
symlink://lib/xDOS-lib
symlink://lib/xDOS-versions#include <xdos.h>
#include <xdos_header.h> // writeHeader(), LineSink
#include <arduino/xdos_eeprom_io.h> // readRecord(), readSerialNumber()writeHeader() emits the header line by line into a LineSink the firmware
implements (write to the SD card, a serial port, a String, …); the firmware
adds its own lines such as $RTCCHK and $TIME after it.
The library does not declare xDOS-versions as a dependency — the firmware project provides it, so both always come from the commits pinned by the firmware.
tools/xdos_bridge.py (needs pyserial) switches a device into config mode
and runs bridge commands, e.g. reading the EEPROM serial number at 0x5B:
tools/xdos_bridge.py /dev/ttyACM0 I2CWR,5B,0800,10Pure logic is tested on the PC. xDOS-versions has to be checked out next to
this repository (../xDOS-versions):
pio test -e native
python3 -m unittest discover -s toolsGPL-3.0, see LICENSE.