From 4d3215d765f12f90715a1d818be3a4d7fd2cd736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noah=20Piqu=C3=A9?= Date: Wed, 24 Nov 2021 08:07:52 +0100 Subject: [PATCH] UserFlash Module add --- Core/Application/INIT_Initialization.c | 2 + Core/Drivers/PECO_PeltierController.c | 2 +- Core/Drivers/USFL_UserFlash.c | 145 +++++++++++++++++++++++++ Core/Drivers/USFL_UserFlash.h | 95 ++++++++++++++++ 4 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 Core/Drivers/USFL_UserFlash.c create mode 100644 Core/Drivers/USFL_UserFlash.h diff --git a/Core/Application/INIT_Initialization.c b/Core/Application/INIT_Initialization.c index 2089ce9..69f6dd4 100644 --- a/Core/Application/INIT_Initialization.c +++ b/Core/Application/INIT_Initialization.c @@ -46,6 +46,8 @@ // Drivers //#include "../Drivers/IRQH_IntRequestHandler.h" //#include "../Drivers/MRAM_MRam.h" + + #include "../Drivers/USFL_UserFlash.h" #include "../Drivers/ANPI_AnalogPortsIn.h" #include "../Drivers/ANPO_AnalogPortsOut.h" diff --git a/Core/Drivers/PECO_PeltierController.c b/Core/Drivers/PECO_PeltierController.c index 8b6b6b4..eaf9cb4 100644 --- a/Core/Drivers/PECO_PeltierController.c +++ b/Core/Drivers/PECO_PeltierController.c @@ -7,7 +7,7 @@ //------------------------------------------------------------------------------------------------- // // Project: Peltier Controller V2 -// Author: Noah Piqu� (noah.pique@psi.ch) +// Author: Noah Piqué (noah.pique@psi.ch) // //------------------------------------------------------------------------------------------------- // diff --git a/Core/Drivers/USFL_UserFlash.c b/Core/Drivers/USFL_UserFlash.c new file mode 100644 index 0000000..a68c6b8 --- /dev/null +++ b/Core/Drivers/USFL_UserFlash.c @@ -0,0 +1,145 @@ +//================================================================================================= +// +// Company: Paul Scherrer Institut +// 5232 Villigen PSI +// Switzerland +// +//------------------------------------------------------------------------------------------------- +// +// Project: Peltier Controller V2 +// Author: Noah Piqué (noah.pique@psi.ch) +// +//------------------------------------------------------------------------------------------------- +// +// Module: User Flash +// Filename: USFL_UserFlash.c +// Date: Handled by Subversion (version control system) +// Revision: Handled by Subversion (version control system) +// History: Handled by Subversion (version control system) +// +//------------------------------------------------------------------------------------------------- +// +// Description: This source file contains all functions dealing with internal flash for User Settings +// +// DATA (rwx) : ORIGIN = 0x801F800, LENGTH = 2K +// +///* Sections */ +//SECTIONS +//{ +// /* NOLOAD is required for not ereasing this block */ +// .user_data (NOLOAD) : +// { +// . = ALIGN(4); +// *(.user_data) +// . = ALIGN(4); +// } > DATA*/ +// +//================================================================================================= + + + +//================================================================================================= +// Section: INCLUDES +// Description: List of required include files. +//================================================================================================= + +#include "../PDEF_ProjectDefinitions.h" +#include "USFL_UserFlash.h" + +// Toolbox +#include "../Toolbox/UTIL_Utility.h" + +// include STM32 drivers +#include "stm32l4xx_hal.h" + +#include "cmsis_os2.h" + +//================================================================================================= +// Section: DEFINITIONS +// Description: Definition of local constants (visible by this module only). +//================================================================================================= + + + +//================================================================================================= +// Section: MACROS +// Description: Definition of local macros (visible by this module only). +//================================================================================================= + + + +//================================================================================================= +// Section: ENUMERATIONS +// Description: Definition of local enumerations (visible by this module only). +//================================================================================================= + + + +//================================================================================================= +// Section: STRUCTURES +// Description: Definition of local Structures (visible by this module only). +//================================================================================================= + + + + +//================================================================================================= +// Section: LOCAL VARIABLES +// Description: Definition of local variables (visible by this module only). +//================================================================================================= + + + +//================================================================================================= +// Section: LOCAL CONSTANTS +// Description: Definition of local constants (visible by this module only). +//================================================================================================= + +__attribute__((__section__(".user_data"))) const uint8_t userConfig[8]; + +//================================================================================================= +// Section: LOCAL FUNCTIONS (PROTOTYPES) +// Description: Definition of local functions (visible by this module only). +//================================================================================================= + + + +//================================================================================================= +// Section: EXTERNAL FUNCTIONS +// Description: Definition of external (global) functions. +//================================================================================================= + + + +//================================================================================================= +// Section: EXTERNAL VARIABLES +// Description: Definition of external (global) variables. +//================================================================================================= + + + +//================================================================================================= +// Section: GLOBAL FUNCTIONS +// Description: Definition (implementation) of global functions. +//================================================================================================= + +//------------------------------------------------------------------------------------------------- +// Function: TMPL_boInitializeModule +// Description: Initializes the module. Function must be called once immediately after power-up. +// Parameters: None +// Returns: Boolean TRUE if successful +//------------------------------------------------------------------------------------------------- + +BOOL USFL_boInitializeModule( VOID ) +{ + + + return( FALSE ); +} + + + +//================================================================================================= +// Section: LOCAL FUNCTIONS +// Descriptionn: Definition (implementation) of local functions. +//================================================================================================= diff --git a/Core/Drivers/USFL_UserFlash.h b/Core/Drivers/USFL_UserFlash.h new file mode 100644 index 0000000..f89cba0 --- /dev/null +++ b/Core/Drivers/USFL_UserFlash.h @@ -0,0 +1,95 @@ +//================================================================================================= +// +// Company: Paul Scherrer Institut +// 5232 Villigen PSI +// Switzerland +// +//------------------------------------------------------------------------------------------------- +// +// Project: Peltier Controller V2 +// Author: Noah Piqué (noah.pique@psi.ch) +// +//------------------------------------------------------------------------------------------------- +// +// Module: User Flash +// Filename: USFL_UserFlash.h +// Date: Handled by Subversion (version control system) +// Revision: Handled by Subversion (version control system) +// History: Handled by Subversion (version control system) +// +//------------------------------------------------------------------------------------------------- + +#ifndef USFL_USERFLASH_H +#define USFL_USERFLASH_H + +#ifdef __cplusplus +extern "C" { +#endif + + + +//================================================================================================= +// Section: INCLUDES +// Description: List of required include files (visible by all modules). +//================================================================================================= + +#include "../SDEF_StandardDefinitions.h" + + + +//================================================================================================= +// Section: DEFINITIONS +// Description: Definition of global constants (visible by all modules). +//================================================================================================= + + + +//================================================================================================= +// Section: MACROS +// Description: Definition of global macros (visible by all modules). +//================================================================================================= + + + +//================================================================================================= +// Section: ENUMERATIONS +// Description: Definition of global enumerations (visible by all modules). +//================================================================================================= + + + + + +//================================================================================================= +// Section: STRUCTURES +// Description: Definition of global Structures (visible by all modules). +//================================================================================================= + + + +//================================================================================================= +// Section: GLOBAL VARIABLES +// Description: Definition of global variables (visible by all modules). +//================================================================================================= + + + +//================================================================================================= +// Section: GLOBAL CONSTANTS +// Description: Definition of global constants (visible by all modules). +//================================================================================================= + + + +//================================================================================================= +// Section: GLOBAL FUNCTIONS (PROTOTYPES) +// Description: Definition of global functions (visible by all modules). +//================================================================================================= + +BOOL USFL_boInitializeModule( VOID ); + +#ifdef __cplusplus +} +#endif + +#endif