37 #define _________________________________________LOCAL_VARIABLES_SECTION____________________________________________________________________ 41 static bool BusFaultInterruptEnabledFlag =
false;
42 static bool MemoryFaultInterruptEnabledFlag =
false;
44 #undef _________________________________________LOCAL_VARIABLES_SECTION____________________________________________________________________ 51 #define _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________ 65 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
70 BusFaultInterruptHandler =
NULL;
71 MemoryFaultInterruptHandler =
NULL;
72 BusFaultInterruptEnabledFlag =
false;
73 MemoryFaultInterruptEnabledFlag =
false;
78 errorCode = oC_ErrorCode_None;
82 errorCode = oC_ErrorCode_ModuleIsTurnedOn;
94 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
100 MemoryFaultInterruptEnabledFlag =
false;
101 BusFaultInterruptEnabledFlag =
false;
104 oC_AssignErrorCodeIfFalse(&errorCode ,
oC_MCS_DisableInterrupt(BusFault_IRQn) , oC_ErrorCode_CannotTurnOffInterruptInMachineModule) &&
105 oC_AssignErrorCodeIfFalse(&errorCode ,
oC_MCS_DisableInterrupt(MemoryManagement_IRQn) , oC_ErrorCode_CannotTurnOffInterruptInMachineModule)
108 errorCode = oC_ErrorCode_None;
114 errorCode = oC_ErrorCode_ModuleNotStartedYet;
391 return oC_MCS_MEMORY_ALIGNMENT;
402 return oC_LSF_IsRamAddress(Address) || oC_LSF_IsExternalAddress(Address) || oC_LSF_IsDmaAddress(Address );
413 return oC_LSF_IsExternalAddress(Address);
424 return oC_LSF_IsDmaAddress(Address);
435 return oC_LSF_IsRomAddress(Address);
468 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
474 oC_AssignErrorCodeIfFalse( &errorCode , MemoryFaultInterruptHandler ==
NULL , oC_ErrorCode_InterruptHandlerAlreadySet)
479 MemoryFaultInterruptHandler = Interrupt;
480 errorCode = oC_ErrorCode_None;
485 errorCode = oC_ErrorCode_WrongAddress;
500 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
506 oC_AssignErrorCodeIfFalse( &errorCode , BusFaultInterruptHandler ==
NULL , oC_ErrorCode_InterruptHandlerAlreadySet)
511 BusFaultInterruptHandler = Interrupt;
512 errorCode = oC_ErrorCode_None;
517 errorCode = oC_ErrorCode_WrongAddress;
531 return oC_ErrorCode_None;
542 return oC_ErrorCode_None;
553 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
557 oC_AssignErrorCodeIfFalse( &errorCode , BusFaultInterruptHandler !=
NULL , oC_ErrorCode_InterruptHandlerNotSet)
560 errorCode = oC_ErrorCode_None;
574 return oC_ErrorCode_None;
585 bool interruptTurnedOn =
true;
587 return interruptTurnedOn;
598 bool interruptTurnedOn =
true;
600 return interruptTurnedOn;
611 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
616 ErrorCondition( oC_LSF_IsCorrectAddress(Config) , oC_ErrorCode_WrongAddress)
635 && ErrorCondition( oC_LSF_IsRamAddress(Config) || oC_LSF_IsExternalAddress(Config) , oC_ErrorCode_OutputAddressNotInRAM )
640 errorCode = oC_ErrorCode_None;
670 #undef _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________ 678 #define _________________________________________INTERRUPTS_SECTION_________________________________________________________________________ 687 if(BusFaultInterruptHandler && BusFaultInterruptEnabledFlag)
689 BusFaultInterruptHandler();
700 if(MemoryFaultInterruptHandler && MemoryFaultInterruptEnabledFlag)
702 MemoryFaultInterruptHandler();
706 #undef _________________________________________INTERRUPTS_SECTION_________________________________________________________________________ #define oC_InterruptHandler(BASE_NAME, TYPE_NAME)
Define handler for interrupt.
static void * oC_LSF_GetHeapStart(void)
returns heap start address
static void * oC_LSF_GetDmaStart(void)
returns start address of DMA section
void * oC_MEM_LLD_GetFlashEndAddress(void)
returns end address of the flash
bool oC_MEM_LLD_SetMemoryAccessMode(oC_MEM_LLD_MemoryAccessMode_t Mode)
Change current memory access mode.
bool oC_MEM_LLD_IsMemoryFaultInterruptTurnedOn(void)
checks if memory fault interrupt is turned on
void * oC_MEM_LLD_GetStackEndAddress(void)
returns end address of the stack
bool oC_MEM_LLD_IsUsedFlashAddress(const void *Address)
checks if the pointer is in used flash section
bool Cacheable
True if the region should be cacheable - If you set a region to be cacheable: When you load from that...
static void * oC_LSF_GetRamEnd(void)
returns ram end address
oC_ErrorCode_t oC_MEM_LLD_TurnOffBusFaultInterrupt(void)
turns off bus fault interrupt
oC_MEM_LLD_Size_t oC_MEM_LLD_GetDataSize(void)
returns size of the data section
void * oC_MEM_LLD_GetDataEndAddress(void)
returns end address of the data section
oC_ErrorCode_t oC_MEM_LLD_SetBusFaultInterrupt(oC_MEM_LLD_Interrupt_t Interrupt)
sets interrupt handler for bus fault
oC_MemorySize_t Size
Size of the region.
bool oC_MCS_SetMemoryAccessMode(oC_MCS_MemoryAccessMode_t Mode)
sets the memory access mode
void * oC_MEM_LLD_GetFlashStartAddress(void)
returns start address of the flash
oC_ErrorCode_t oC_MEM_LLD_TurnOffDriver(void)
release the driver
stores configuration of the memory region
bool oC_MEM_LLD_IsExternalAddress(const void *Address)
checks if the pointer is in external section
void * oC_MEM_LLD_GetDmaRamStartAddress(void)
returns start address of the DMA RAM
static oC_UInt_t oC_LSF_GetDmaSize(void)
returns size of the section in linkage
const void * BaseAddress
Base address of the region - this must point to the start of the region.
static void * oC_LSF_GetRomEnd(void)
returns rom end address
The file with interface for LSF module.
static void * oC_LSF_GetTextStart(void)
returns text start address
oC_ErrorCode_t oC_MEM_LLD_ConfigureMemoryRegion(oC_MEM_LLD_MemoryRegionConfig_t *Config)
configures memory region
bool oC_MEM_LLD_IsFlashAddress(const void *Address)
checks if the pointer is in flash section
static oC_UInt_t oC_LSF_GetRomSize(void)
returns size of the section in linkage
oC_ErrorCode_t oC_MEM_LLD_TurnOnBusFaultInterrupt(void)
turns on bus fault interrupt
The file with LLD interface for the MEM driver.
void * oC_MEM_LLD_GetUsedFlashEndAddress(void)
returns used flash end address
const void * BaseAddress
Base address of the region - this must point to the start of the region.
oC_ErrorCode_t oC_MEM_LLD_TurnOnDriver(void)
initializes the driver to work
void * oC_MEM_LLD_GetHeapEndAddress(void)
returns end address of the heap
bool oC_MEM_LLD_IsBusFaultInterruptTurnedOn(void)
checks if bus fault interrupt is turned on
void * oC_MEM_LLD_GetBssEndAddress(void)
returns end address of the Bss section
oC_MEM_LLD_Size_t oC_MEM_LLD_GetUsedFlashSize(void)
returns size of the used flash section
static void * oC_LSF_GetTextEnd(void)
returns text end address
oC_MEM_LLD_Size_t oC_MEM_LLD_GetDmaRamSize(void)
returns size of the DMA ram
static void * oC_LSF_GetRamStart(void)
returns ram start address
uint32_t RegionNumber
Number of the region to configure.
oC_Access_t UserAccess
Definition of access for user space.
oC_ErrorCode_t oC_MCS_ConfigureMemoryRegion(const oC_MCS_MemoryRegionConfig_t *Config)
configures memory region
bool Cachable
True if the region should be cacheable - If you set a region to be cacheable: When you load from that...
static void * oC_LSF_GetBssStart(void)
returns bss start address
The file with interface for the module library.
oC_Access_t PrivilegedAccess
Definition of access for privileged space (portable or core)
bool Bufforable
True if the region should be bufforable - Bufferable means whether a write to the address can be buff...
static oC_UInt_t oC_LSF_GetDataSize(void)
returns size of the section in linkage
static void * oC_LSF_GetDmaEnd(void)
returns end address of DMA section
static void * oC_LSF_GetDataStart(void)
returns data start address
bool oC_MEM_LLD_IsHeapAddress(const void *Address)
checks if the pointer is in heap section
oC_Access_t UserAccess
Definition of access for user space.
static void * oC_LSF_GetStackEnd(void)
returns stack end address
oC_MemorySize_t Size
Size of the region.
uint32_t RegionNumber
(optional) Number of the region to configure.
static oC_UInt_t oC_LSF_GetTextSize(void)
returns size of the section in linkage
oC_MEM_LLD_MemoryAccessMode_t
stores access memory mode
oC_MEM_LLD_Size_t oC_MEM_LLD_GetRamSize(void)
returns size of the ram
oC_MEM_LLD_Size_t oC_MEM_LLD_GetHeapSize(void)
returns size of the heap
static void oC_Module_TurnOn(oC_Module_t Module)
sets module as turned on
oC_MEM_LLD_Size_t oC_MEM_LLD_GetFlashSize(void)
returns size of the flash section
void * oC_MEM_LLD_GetRamEndAddress(void)
returns end address of the RAM
void * oC_MEM_LLD_GetUsedFlashStartAddress(void)
returns start address of the used flash section
static void oC_MCS_EnterCriticalSection(void)
Enters to critical section.
oC_UInt_t oC_MEM_LLD_Size_t
type for storing size of memory
void * oC_MEM_LLD_GetBssStartAddress(void)
returns start address of the Bss section
void * oC_MEM_LLD_GetHeapStartAddress(void)
returns start address of the heap
bool Bufforable
True if the region should be bufforable - Bufferable means whether a write to the address can be buff...
configuration structure for the memory region
oC_Access_t PrivilegedAccess
Definition of access for privileged space (portable or core)
The file with interface interrupt module.
bool FindFreeRegion
If true, the RegionNumber field is ignored and filled with the new value after configuration.
void * oC_MEM_LLD_GetStackStartAddress(void)
returns start address of the stack
bool oC_MCS_ReadFreeRegionNumber(uint32_t *outFreeRegionNumber)
reads number of a free region
oC_MEM_LLD_MemoryAccessMode_t oC_MEM_LLD_GetMemoryAccessMode(void)
returns currently configured memory access mode
static oC_UInt_t oC_LSF_GetBssSize(void)
returns size of the section in linkage
static bool oC_Module_TurnOffVerification(oC_ErrorCode_t *outErrorCode, oC_Module_t Module)
verify if module is turned off
static bool oC_MCS_ExitCriticalSection(void)
Exits from critical section.
oC_ErrorCode_t oC_MEM_LLD_SetMemoryFaultInterrupt(oC_MEM_LLD_Interrupt_t Interrupt)
sets interrupt handler for memory fault
static bool oC_Module_TurnOnVerification(oC_ErrorCode_t *outErrorCode, oC_Module_t Module)
verify if module is turned on
oC_MEM_LLD_Size_t oC_MEM_LLD_GetBssSize(void)
returns size of the Bss section
bool oC_MEM_LLD_IsDmaRamAddress(const void *Address)
checks if the pointer is in DMA RAM section
oC_MEM_LLD_Size_t oC_MEM_LLD_GetAlignmentSize(void)
returns size of alignment
oC_ErrorCode_t oC_MEM_LLD_TurnOffMemoryFaultInterrupt(void)
turns off memory fault interrupt
oC_ErrorCode_t oC_MEM_LLD_TurnOnMemoryFaultInterrupt(void)
turns on memory fault interrupt
void(* oC_MEM_LLD_Interrupt_t)(void)
type for storing memory interrupt pointers
void * oC_MEM_LLD_GetRamStartAddress(void)
returns start address of the RAM
void * oC_MEM_LLD_GetDmaRamEndAddress(void)
returns end address of the DMA RAM
oC_Power_t Power
Power state for the region (enabled or disabled)
oC_MCS_MemoryAccessMode_t oC_MCS_GetMemoryAccessMode(void)
reads memory access mode
bool Shareable
For a shareable memory region that is implemented, the memory system provides data synchronization be...
oC_MEM_LLD_Size_t oC_MEM_LLD_GetStackSize(void)
returns size of the stack
static void * oC_LSF_GetDataEnd(void)
returns data end address
oC_Power_t Power
Power state for the region (enabled or disabled)
static void * oC_LSF_GetRomStart(void)
returns rom start address
static void * oC_LSF_GetBssEnd(void)
returns bss end address
static void * oC_LSF_GetStackStart(void)
returns stack start address
static void * oC_LSF_GetHeapEnd(void)
returns heap end address
static oC_UInt_t oC_LSF_GetStackSize(void)
returns size of the section in linkage
bool oC_MCS_DisableInterrupt(IRQn_Type InterruptNumber)
disables interrupt with specified number
static oC_UInt_t oC_LSF_GetHeapSize(void)
returns size of the section in linkage
static oC_UInt_t oC_LSF_GetRamSize(void)
returns size of the section in linkage
bool AlignSize
True if the MCS should find the size nearest to the value given as the Size field.
bool oC_MEM_LLD_IsRamAddress(const void *Address)
checks if the pointer is in ram section
#define NULL
pointer to a zero
void * oC_MEM_LLD_GetDataStartAddress(void)
returns start address of the data section
static void oC_Module_TurnOff(oC_Module_t Module)
sets module as turned off