Choco OS  V.0.16.9.0
Join to the chocolate world
(MEM-LLD) Memory Low Level Driver

Managing memory operations. More...

Data Structures

struct  oC_MEM_LLD_MemoryRegionConfig_t
 stores configuration of the memory region More...
 

Macros

#define oC_MEM_LLD_MEMORY_ALIGNMENT
 number of bytes in memory alignment More...
 
#define oC_MEM_LLD_STACK_ALIGNMENT
 number of bytes in alignment of the stack
 

Typedefs

typedef oC_UInt_t oC_MEM_LLD_Size_t
 type for storing size of memory
 
typedef void(* oC_MEM_LLD_Interrupt_t) (void)
 type for storing memory interrupt pointers More...
 

Enumerations

Functions

oC_ErrorCode_t oC_MEM_LLD_TurnOnDriver (void)
 initializes the driver to work More...
 
oC_ErrorCode_t oC_MEM_LLD_TurnOffDriver (void)
 release the driver More...
 
void * oC_MEM_LLD_GetRamStartAddress (void)
 returns start address of the RAM More...
 
void * oC_MEM_LLD_GetRamEndAddress (void)
 returns end address of the RAM More...
 
oC_MEM_LLD_Size_t oC_MEM_LLD_GetRamSize (void)
 returns size of the ram More...
 
void * oC_MEM_LLD_GetDmaRamStartAddress (void)
 returns start address of the DMA RAM More...
 
void * oC_MEM_LLD_GetDmaRamEndAddress (void)
 returns end address of the DMA RAM More...
 
oC_MEM_LLD_Size_t oC_MEM_LLD_GetDmaRamSize (void)
 returns size of the DMA ram More...
 
void * oC_MEM_LLD_GetFlashStartAddress (void)
 returns start address of the flash More...
 
void * oC_MEM_LLD_GetFlashEndAddress (void)
 returns end address of the flash More...
 
oC_MEM_LLD_Size_t oC_MEM_LLD_GetFlashSize (void)
 returns size of the flash section More...
 
void * oC_MEM_LLD_GetHeapStartAddress (void)
 returns start address of the heap More...
 
void * oC_MEM_LLD_GetHeapEndAddress (void)
 returns end address of the heap More...
 
oC_MEM_LLD_Size_t oC_MEM_LLD_GetHeapSize (void)
 returns size of the heap More...
 
void * oC_MEM_LLD_GetStackStartAddress (void)
 returns start address of the stack More...
 
void * oC_MEM_LLD_GetStackEndAddress (void)
 returns end address of the stack More...
 
oC_MEM_LLD_Size_t oC_MEM_LLD_GetStackSize (void)
 returns size of the stack More...
 
void * oC_MEM_LLD_GetDataStartAddress (void)
 returns start address of the data section More...
 
void * oC_MEM_LLD_GetDataEndAddress (void)
 returns end address of the data section More...
 
oC_MEM_LLD_Size_t oC_MEM_LLD_GetDataSize (void)
 returns size of the data section More...
 
void * oC_MEM_LLD_GetBssStartAddress (void)
 returns start address of the Bss section More...
 
void * oC_MEM_LLD_GetBssEndAddress (void)
 returns end address of the Bss section More...
 
oC_MEM_LLD_Size_t oC_MEM_LLD_GetBssSize (void)
 returns size of the Bss section More...
 
void * oC_MEM_LLD_GetUsedFlashStartAddress (void)
 returns start address of the used flash section More...
 
void * oC_MEM_LLD_GetUsedFlashEndAddress (void)
 returns used flash end address More...
 
oC_MEM_LLD_Size_t oC_MEM_LLD_GetUsedFlashSize (void)
 returns size of the used flash section More...
 
oC_MEM_LLD_Size_t oC_MEM_LLD_GetAlignmentSize (void)
 returns size of alignment More...
 
bool oC_MEM_LLD_IsRamAddress (const void *Address)
 checks if the pointer is in ram section More...
 
bool oC_MEM_LLD_IsFlashAddress (const void *Address)
 checks if the pointer is in flash section More...
 
bool oC_MEM_LLD_IsUsedFlashAddress (const void *Address)
 checks if the pointer is in used flash section More...
 
bool oC_MEM_LLD_IsHeapAddress (const void *Address)
 checks if the pointer is in heap section More...
 
bool oC_MEM_LLD_IsExternalAddress (const void *Address)
 checks if the pointer is in external section More...
 
bool oC_MEM_LLD_IsDmaRamAddress (const void *Address)
 checks if the pointer is in DMA RAM section More...
 
oC_ErrorCode_t oC_MEM_LLD_SetMemoryFaultInterrupt (oC_MEM_LLD_Interrupt_t Interrupt)
 sets interrupt handler for memory fault More...
 
oC_ErrorCode_t oC_MEM_LLD_SetBusFaultInterrupt (oC_MEM_LLD_Interrupt_t Interrupt)
 sets interrupt handler for bus fault More...
 
oC_ErrorCode_t oC_MEM_LLD_TurnOnMemoryFaultInterrupt (void)
 turns on memory fault interrupt More...
 
oC_ErrorCode_t oC_MEM_LLD_TurnOffMemoryFaultInterrupt (void)
 turns off memory fault interrupt More...
 
oC_ErrorCode_t oC_MEM_LLD_TurnOnBusFaultInterrupt (void)
 turns on bus fault interrupt More...
 
oC_ErrorCode_t oC_MEM_LLD_TurnOffBusFaultInterrupt (void)
 turns off bus fault interrupt More...
 
bool oC_MEM_LLD_IsMemoryFaultInterruptTurnedOn (void)
 checks if memory fault interrupt is turned on More...
 
bool oC_MEM_LLD_IsBusFaultInterruptTurnedOn (void)
 checks if bus fault interrupt is turned on More...
 
oC_ErrorCode_t oC_MEM_LLD_ConfigureMemoryRegion (oC_MEM_LLD_MemoryRegionConfig_t *Config)
 configures memory region More...
 
bool oC_MEM_LLD_SetMemoryAccessMode (oC_MEM_LLD_MemoryAccessMode_t Mode)
 Change current memory access mode. More...
 
oC_MEM_LLD_MemoryAccessMode_t oC_MEM_LLD_GetMemoryAccessMode (void)
 returns currently configured memory access mode More...
 

Detailed Description

The driver is for supporting operations based on a machine memory. It should be turned on before usage by function oC_MEM_LLD_TurnOnDriver, and it should be turned off by oC_MEM_LLD_TurnOffDriver when it is not needed anymore. The driver provide an interface for reading machine limits addresses, memory section sizes, and configuring interrupts that are memory related.
There are following kind of interrupts:
  • Memory fault interrupt - is an exception that occurs because of a memory protection related fault, including access violation and no match.
  • Bus fault interrupt - memory related fault, that occurs while bus transactions.
The driver allow to set interrupt handlers for these interrupts, but only once. When the handler is set, it is not possible to set it again until restart of the module. To set interrupt handler pointer use oC_MEM_LLD_SetMemoryFaultInterrupt and oC_MEM_LLD_SetBusFaultInterrupt functions. When the handlers are set, it is possible to turn on these interrupts using functions oC_MEM_LLD_TurnOnBusFaultInterrupt and oC_MEM_LLD_TurnOnMemoryFaultInterrupt. You can always check if interrupts are correctly configured and turned on, using oC_MEM_LLD_IsBusFaultInterruptTurnedOn and oC_MEM_LLD_IsMemoryFaultInterruptTurnedOn functions.

Example of usage:

static void MemoryFaultInterrupt(void)
{
// This occurs, when there was some fault in memory protection
}
void main(void)
{
}
Using MEM-LLD module, you can get physical addresses of machine memory sections, such as flash, ram, used flash, data, stack, etc. You can also read size of these sections. It is not required to turn on the module to use these functions. Sometimes it is needed to keep memory alignment. The function oC_MEM_LLD_GetAlignmentSize and macro oC_MEM_LLD_MEMORY_ALIGNMENT returns number of bytes, that the memory is aligned in the machine.
See also
oC_MEM_LLD_GetFlashStartAddress, oC_MEM_LLD_GetFlashEndAddress, oC_MEM_LLD_GetRamStartAddress, oC_MEM_LLD_GetRamEndAddress, oC_MEM_LLD_GetRamSize, oC_MEM_LLD_GetFlashSize, oC_MEM_LLD_GetHeapStartAddress, oC_MEM_LLD_GetHeapEndAddress, oC_MEM_LLD_GetHeapSize

Macro Definition Documentation

#define oC_MEM_LLD_MEMORY_ALIGNMENT

The macro returns number of bytes that the memory is aligned.

Definition at line 97 of file oc_mem_lld.h.

Typedef Documentation

typedef void(* oC_MEM_LLD_Interrupt_t) (void)

The type stores pointers for interrupt function handlers.

Definition at line 167 of file oc_mem_lld.h.

Enumeration Type Documentation

The type is for storing memory access more (if it is privileged or not)

Enumerator
oC_MEM_LLD_MemoryAccessMode_User 

Memory controller is configured to allow for memory access only for regions that can be accessible by a user.

oC_MEM_LLD_MemoryAccessMode_Privileged 

Memory controller is configured to allow for memory access for regions that can be accessible by a privileged tasks.

Definition at line 134 of file oc_mem_lld.h.

Function Documentation

oC_ErrorCode_t oC_MEM_LLD_ConfigureMemoryRegion ( oC_MEM_LLD_MemoryRegionConfig_t Config)

The function configures memory region.

Parameters
ConfigPointer to the configuration
Returns
code of error or #oC_ErrorCode_None if success
See also
oC_MEM_LLD_MemoryRegionConfig_t
Note
stm32f4 notes:
stm32f7 notes:

Definition at line 609 of file oc_mem_lld.c.

oC_MEM_LLD_Size_t oC_MEM_LLD_GetAlignmentSize ( void  )

The function returns number of bytes, that the machine align the memory.

Returns
size of alignment
Note
stm32f4 notes: it is not read from the linkage script. Works also when the module is turned off.
stm32f7 notes: it is not read from the linkage script. Works also when the module is turned off.
lm4f notes: it is not read from the linkage script. Works also when the module is turned off.

Definition at line 389 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetBssEndAddress ( void  )

The function returns address of the data section. This sections stores all ram data that was not dynamically allocated.

Returns
end address of the data section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 334 of file oc_mem_lld.c.

oC_MEM_LLD_Size_t oC_MEM_LLD_GetBssSize ( void  )

The function returns size in bytes of the section in RAM that stores all data, that was not dynamically allocated in the machine.

Returns
size of the data section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 345 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetBssStartAddress ( void  )

The function returns address of the data section. This sections stores all ram data that was not dynamically allocated.

Returns
start address of the data section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 323 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetDataEndAddress ( void  )

The function returns address of the data section. This sections stores all ram data that was not dynamically allocated.

Returns
end address of the data section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 301 of file oc_mem_lld.c.

oC_MEM_LLD_Size_t oC_MEM_LLD_GetDataSize ( void  )

The function returns size in bytes of the section in RAM that stores all data, that was not dynamically allocated in the machine.

Returns
size of the data section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 312 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetDataStartAddress ( void  )

The function returns address of the data section. This sections stores all ram data that was not dynamically allocated.

Returns
start address of the data section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 290 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetDmaRamEndAddress ( void  )

The function is for reading the end address of the machine RAM. Note, that it is not reserved memory, and any try to write at this address may cause memory or hard fault.

Returns
address to end of the RAM section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 169 of file oc_mem_lld.c.

oC_MEM_LLD_Size_t oC_MEM_LLD_GetDmaRamSize ( void  )

The function returns size in bytes of the DMA RAM memory. Note, that it is size of the all RAM - both used, and not.

Returns
size of the RAM in bytes
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 180 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetDmaRamStartAddress ( void  )

The function is for reading the start address of the machine DMA RAM. Note, that it is not reserved memory, and any try to write at this address may cause memory or hard fault.

Returns
address to start of the RAM section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 158 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetFlashEndAddress ( void  )

The function returns finish point address of the flash in the machine. Note, that it is end of the all flash - used and not.

Returns
end address of the flash
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 202 of file oc_mem_lld.c.

oC_MEM_LLD_Size_t oC_MEM_LLD_GetFlashSize ( void  )

The function returns size of the all flash of machine (both used and not).

Returns
size of the flash in bytes
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 213 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetFlashStartAddress ( void  )

The function returns begin point address of the flash in the machine. Note, that it is start of the all flash - used and not.

Returns
start address of the flash
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 191 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetHeapEndAddress ( void  )

The function returns end address of the heap section in the machine.

Returns
end address of the heap
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 235 of file oc_mem_lld.c.

oC_MEM_LLD_Size_t oC_MEM_LLD_GetHeapSize ( void  )

The function returns size of the heap section memory, that is in bytes.

Returns
size of the heap
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 246 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetHeapStartAddress ( void  )

The function returns start address of the heap section in the machine.

Returns
start heap address
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 224 of file oc_mem_lld.c.

oC_MEM_LLD_MemoryAccessMode_t oC_MEM_LLD_GetMemoryAccessMode ( void  )
Returns
currently set memory access mode
Note
stm32f4 notes:
stm32f7 notes:

Definition at line 665 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetRamEndAddress ( void  )

The function is for reading the end address of the machine RAM. Note, that it is not reserved memory, and any try to write at this address may cause memory or hard fault.

Returns
address to end of the RAM section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 136 of file oc_mem_lld.c.

oC_MEM_LLD_Size_t oC_MEM_LLD_GetRamSize ( void  )

The function returns size in bytes of the RAM memory. Note, that it is size of the all RAM - both used, and not.

Returns
size of the RAM in bytes
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 147 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetRamStartAddress ( void  )

The function is for reading the start address of the machine RAM. Note, that it is not reserved memory, and any try to write at this address may cause memory or hard fault.

Returns
address to start of the RAM section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 125 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetStackEndAddress ( void  )

The function returns end address of the stack.

Returns
end address of the stack
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 268 of file oc_mem_lld.c.

oC_MEM_LLD_Size_t oC_MEM_LLD_GetStackSize ( void  )

The function returns size in bytes of the stack memory section.

Returns
size of the stack
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 279 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetStackStartAddress ( void  )

The function returns start address of the stack.

Returns
the start address of the stack
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 257 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetUsedFlashEndAddress ( void  )

The function returns end address of the section in the flash that is stored used flash.

Returns
end address of the used flash section
Note
stm32f4 notes:redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes:redefinition from the machine module. Works also when the module is turned off.
lm4f notes:redefinition from the machine module. Works also when the module is turned off.

Definition at line 367 of file oc_mem_lld.c.

oC_MEM_LLD_Size_t oC_MEM_LLD_GetUsedFlashSize ( void  )

The function is for reading from linkage size of the section in the flash, that is used by system.

Returns
size of the used flash section
Note
stm32f4 notes:redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes:redefinition from the machine module. Works also when the module is turned off.
lm4f notes:redefinition from the machine module. Works also when the module is turned off.

Definition at line 378 of file oc_mem_lld.c.

void * oC_MEM_LLD_GetUsedFlashStartAddress ( void  )

The function returns start address of the section in the flash where is stored program code.

Returns
start address of the used flash section
Note
stm32f4 notes: redefinition from the machine module. Works also when the module is turned off.
stm32f7 notes: redefinition from the machine module. Works also when the module is turned off.
lm4f notes: redefinition from the machine module. Works also when the module is turned off.

Definition at line 356 of file oc_mem_lld.c.

bool oC_MEM_LLD_IsBusFaultInterruptTurnedOn ( void  )

The function checks if the bus fault interrupt is turned on. If this function returns true, it means, that the interrupt handler is set, internal mask is set, and the physical interrupt in the machine is also turned on. Note, that the module must not be enabled to call this function.

Returns
bool - true if the interrupt is configured and turned on
Note
stm32f4 notes:
stm32f7 notes:
lm4f notes:

Definition at line 596 of file oc_mem_lld.c.

bool oC_MEM_LLD_IsDmaRamAddress ( const void *  Address)
Parameters
Addressaddress to check
Returns
true if address is in the DMA RAM section
Note
stm32f4 notes: works also when the module is turned off
stm32f7 notes: works also when the module is turned off

Definition at line 422 of file oc_mem_lld.c.

bool oC_MEM_LLD_IsExternalAddress ( const void *  Address)
Parameters
Addressaddress to check
Returns
true if address is in the external section
Note
stm32f4 notes: works also when the module is turned off
stm32f7 notes: works also when the module is turned off
lm4f notes: works also when the module is turned off

Definition at line 411 of file oc_mem_lld.c.

bool oC_MEM_LLD_IsFlashAddress ( const void *  Address)
Parameters
Addressaddress to check
Returns
true if address is in the flash
Note
stm32f4 notes: works also when the module is turned off
stm32f7 notes: works also when the module is turned off
lm4f notes: works also when the module is turned off

Definition at line 433 of file oc_mem_lld.c.

bool oC_MEM_LLD_IsHeapAddress ( const void *  Address)
Parameters
Addressaddress to check
Returns
true if address is in the heap section
Note
stm32f4 notes: works also when the module is turned off
stm32f7 notes: works also when the module is turned off
lm4f notes: works also when the module is turned off

Definition at line 455 of file oc_mem_lld.c.

bool oC_MEM_LLD_IsMemoryFaultInterruptTurnedOn ( void  )

The function checks if the memory fault interrupt is turned on. If this function returns true, it means, that the interrupt handler is set, internal mask is set, and the physical interrupt in the machine is also turned on. Note, that the module must not be enabled to call this function.

Returns
bool - true if the interrupt is configured and turned on
Note
stm32f4 notes:
stm32f7 notes:
lm4f notes:

Definition at line 583 of file oc_mem_lld.c.

bool oC_MEM_LLD_IsRamAddress ( const void *  Address)
Parameters
Addressaddress to check
Returns
true if address is in the ram
Note
stm32f4 notes: works also when the module is turned off
stm32f7 notes: works also when the module is turned off
lm4f notes: works also when the module is turned off

Definition at line 400 of file oc_mem_lld.c.

bool oC_MEM_LLD_IsUsedFlashAddress ( const void *  Address)
Parameters
Addressaddress to check Change
Returns
true if address is in the used flash
Note
stm32f4 notes: works also when the module is turned off
stm32f7 notes: works also when the module is turned off
lm4f notes: works also when the module is turned off

Definition at line 444 of file oc_mem_lld.c.

oC_ErrorCode_t oC_MEM_LLD_SetBusFaultInterrupt ( oC_MEM_LLD_Interrupt_t  Interrupt)
Parameters
InterruptThe function to call, when the interrupt occurs
Returns
code of error or #oC_ErrorCode_None if success
Note
stm32f4 notes: address must be in RAM or text, and interrupt handler is not already set.
stm32f7 notes: address must be in RAM or text, and interrupt handler is not already set.
lm4f notes: address must be in RAM or text, and interrupt handler is not already set.

Definition at line 498 of file oc_mem_lld.c.

bool oC_MEM_LLD_SetMemoryAccessMode ( oC_MEM_LLD_MemoryAccessMode_t  Mode)

The function is for changing currently used memory access mode.

Parameters
ModeUser or Privileged access mode, for more see oC_MEM_LLD_MemoryAccessMode_t
Returns
true if success
Note
stm32f4 notes:
stm32f7 notes:

Definition at line 654 of file oc_mem_lld.c.

oC_ErrorCode_t oC_MEM_LLD_SetMemoryFaultInterrupt ( oC_MEM_LLD_Interrupt_t  Interrupt)

The function is for setting an interrupt, that occurs, when some of memory section, that is protected is trying was accessed. The module must be already turned on, before call of this function.

Parameters
InterruptThe function to call, when the interrupt occurs
Returns
code of error or #oC_ErrorCode_None if success
Note
stm32f4 notes: address must be in RAM or text, and interrupt handler is not already set.
stm32f7 notes: address must be in RAM or text, and interrupt handler is not already set.
lm4f notes: address must be in RAM or text, and interrupt handler is not already set.

Definition at line 466 of file oc_mem_lld.c.

oC_ErrorCode_t oC_MEM_LLD_TurnOffBusFaultInterrupt ( void  )

The function is turning off bus fault interrupt. It should work also when the module is turned off

Returns
code of error or #oC_ErrorCode_None if success
Note
stm32f4 notes: works also when the module is turned off
stm32f7 notes: works also when the module is turned off
lm4f notes: works also when the module is turned off

Definition at line 572 of file oc_mem_lld.c.

oC_ErrorCode_t oC_MEM_LLD_TurnOffDriver ( void  )

The function is for releasing resources needed for the driver. The main driver should call it every time, when it is turned off. This function should restore default states in all resources, that are handled and was initialized by the driver. It must not protect by itself again turning off the driver when it is not turned on.

Returns
code of error, or oC_ErrorCode_None if there is no error. Moreover it return oC_ErrorCode_ModuleNotStartedYet when the module was not turned on.
Note
stm32f4 notes: turns off interrupts
stm32f7 notes: turns off interrupts
lm4f notes: turns off interrupts

Definition at line 92 of file oc_mem_lld.c.

oC_ErrorCode_t oC_MEM_LLD_TurnOffMemoryFaultInterrupt ( void  )

The function is turning off memory fault interrupt. It should work also when the module is turned off

Returns
code of error or #oC_ErrorCode_None if success
Note
stm32f4 notes: works also when the module is turned off
stm32f7 notes: works also when the module is turned off
lm4f notes: works also when the module is turned off

Definition at line 540 of file oc_mem_lld.c.

oC_ErrorCode_t oC_MEM_LLD_TurnOnBusFaultInterrupt ( void  )

The function is turning on bus fault interrupt. It is important, that this should not be called when the driver is turned on.

Returns
code of error or #oC_ErrorCode_None if success
Note
stm32f4 notes:
stm32f7 notes:
lm4f notes:

Definition at line 551 of file oc_mem_lld.c.

oC_ErrorCode_t oC_MEM_LLD_TurnOnDriver ( void  )

The function is for initializing the low level driver. It will be called every time when the driver will turned on.

Returns
code of error, or oC_ErrorCode_None if there is no error. Moreover it return oC_ErrorCode_ModuleIsTurnedOn when the module was turned on before.
Note
stm32f4 notes: initializes faults interrupts, and interrupts handlers pointers.
stm32f7 notes: initializes faults interrupts, and interrupts handlers pointers.
lm4f notes: initializes faults interrupts, and interrupts handlers pointers.

Definition at line 63 of file oc_mem_lld.c.

oC_ErrorCode_t oC_MEM_LLD_TurnOnMemoryFaultInterrupt ( void  )

The function is turning on memory fault interrupt. It is important, that this should not be called when the driver is turned on.

Note
The interrupt handler must be set before call of this function!
See also
oC_MEM_LLD_SetMemoryFaultInterrupt
Returns
code of error or #oC_ErrorCode_None if success
Note
stm32f4 notes:
stm32f7 notes:
lm4f notes:

Definition at line 529 of file oc_mem_lld.c.