diff --git a/firmware/app/utils/mem_mng.c b/firmware/app/utils/mem_mng.c new file mode 100644 index 00000000..bdda43d7 --- /dev/null +++ b/firmware/app/utils/mem_mng.c @@ -0,0 +1,63 @@ +/* + * mem_mng.c + * + * Copyright The OBDH 2.0 Contributors. + * + * This file is part of OBDH 2.0. + * + * OBDH 2.0 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OBDH 2.0 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with OBDH 2.0. If not, see . + * + */ + +/** + * \brief Memory management routines implementation. + * + * \author Gabriel Mariano Marcelino + * + * \version 0.10.9 + * + * \date 2024/02/24 + * + * \addtogroup mem_mng + * \{ + */ + +#include "mem_mng.h" + +int mem_mng_check_fram(void) +{ + return -1; +} + +int mem_mng_init_fram(void) +{ + return -1; +} + +int mem_mng_reset_fram(void) +{ + return -1; +} + +int mem_mng_save_obdh_data_to_fram(obdh_data_t data, sys_time_t ts) +{ + return -1; +} + +int mem_mng_load_obdh_data_from_fram(obdh_data_t *data, sys_time_t *ts) +{ + return -1; +} + +/** \} End of mem_mng group */ diff --git a/firmware/app/utils/mem_mng.h b/firmware/app/utils/mem_mng.h new file mode 100644 index 00000000..ed159adf --- /dev/null +++ b/firmware/app/utils/mem_mng.h @@ -0,0 +1,89 @@ +/* + * mem_mng.h + * + * Copyright The OBDH 2.0 Contributors. + * + * This file is part of OBDH 2.0. + * + * OBDH 2.0 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OBDH 2.0 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with OBDH 2.0. If not, see . + * + */ + +/** + * \brief Memory management routines. + * + * \author Gabriel Mariano Marcelino + * + * \version 0.10.9 + * + * \date 2024/02/24 + * + * \defgroup mem_mng Memory Management + * \ingroup app + * \{ + */ + +#ifndef MEM_MNG_H_ +#define MEM_MNG_H_ + +#include + +#include + +/** + * \brief Checks if the FRAM memory is initialized or not. + * + * \return The status/error code. + */ +int mem_mng_check_fram(void); + +/** + * \brief Initializes the FRAM memory. + * + * \return The status/error code. + */ +int mem_mng_init_fram(void); + +/** + * \brief Resets the FRAM memory. + * + * \return The status/error code. + */ +int mem_mng_reset_fram(void); + +/** + * \brief Saves the OBDH data to the FRAM memory. + * + * \param[in] data is the OBDH data structure with the data to be saved. + * + * \param[in] ts is the timestamp of the given data. + * + * \return The status/error code. + */ +int mem_mng_save_obdh_data_to_fram(obdh_data_t data, sys_time_t ts); + +/** + * \brief Loads the last saved OBDH data from the FRAM memory. + * + * \param[in] data is a pointer to store the read data. + * + * \param[in] ts is a pointer to store the read timestamp of the data. + * + * \return The status/error code. + */ +int mem_mng_load_obdh_data_from_fram(obdh_data_t *data, sys_time_t *ts); + +#endif /* MEM_MNG_H_ */ + +/** \} End of mem_mng group */