2019-06-12 19:18:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <SPI.h>
|
2019-06-27 14:58:01 +00:00
|
|
|
#include <SdFat.h>
|
2019-06-12 19:18:37 +00:00
|
|
|
|
2019-06-28 12:57:39 +00:00
|
|
|
#include "gps.h"
|
2019-06-12 19:18:37 +00:00
|
|
|
|
2019-07-02 11:58:55 +00:00
|
|
|
/**
|
|
|
|
* Initialise the microSD card storage subsystem.
|
|
|
|
*/
|
2019-07-09 12:12:32 +00:00
|
|
|
// void store_init();
|
2019-07-02 11:58:55 +00:00
|
|
|
/**
|
|
|
|
* Store a measurement on the microSD card.
|
|
|
|
* @param id The unique random id of the reading.
|
|
|
|
* @param location The GPS location information.
|
|
|
|
*/
|
2019-06-26 14:46:07 +00:00
|
|
|
void store_reading(uint32_t id, GPSLocation location);
|
2019-07-02 11:58:55 +00:00
|
|
|
/**
|
|
|
|
* Write a debug message to the debug log.
|
|
|
|
* @param buffer The message to write.
|
|
|
|
* @param size The length of the message.
|
|
|
|
*/
|
2019-06-20 12:56:08 +00:00
|
|
|
void store_debug(char* buffer, int size);
|
|
|
|
|
2019-07-02 11:58:55 +00:00
|
|
|
/**
|
|
|
|
* Store a 32-bit unsigned integer to EEPROM.
|
|
|
|
* @param offset The offset in the EEPROM unit to write the value to.
|
|
|
|
* @param value The value to write.
|
|
|
|
*/
|
|
|
|
void store_eeprom_uint32_save(uint8_t offset, uint32_t value);
|
|
|
|
/**
|
|
|
|
* Retrieve a 32-bit unsigned integer from EEPROM.
|
|
|
|
* @param offset The offset to retreive it from.
|
|
|
|
* @return The value retrieved from EEPROM.
|
|
|
|
*/
|
|
|
|
uint32_t store_eeprom_uint32_retrieve(uint8_t offset);
|
|
|
|
|
|
|
|
|
2019-06-27 16:26:22 +00:00
|
|
|
// void store_end();
|