My LoRaWAN Signal Mapping MSc summer project. This is a copy of the actual repository with personal information removed.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LoRaWAN-Signal-Mapping/iot/main/storage.h

52 lines
1.4 KiB

#pragma once
#include <SPI.h>
#include <SdFat.h>
#include "gps.h"
/**
* Initialise the microSD card storage subsystem.
*/
// void store_init();
/**
* Store a measurement on the microSD card.
* @param id The unique random id of the reading.
* @param location The GPS location information.
*/
void store_reading(uint32_t id, GPSLocation location);
/**
* Write a debug message to the debug log.
* @param buffer The message to write.
* @param size The length of the message.
*/
void store_debug(char* buffer, int size);
/**
* 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);
/**
* The same as store_eeprom_uint32_save, but for floats
* @param offset The offset to save the value to.
* @param value The value to save
*/
void store_eeprom_float_save(uint8_t offset, float value);
/**
* The same as store_eeprom_uint32_retrieve, but for floats
* @param offset The offset to retrieve from
* @return The retreived value
*/
float store_eeprom_float_retrieve(uint8_t offset);
// void store_end();