Choco OS
V.0.16.9.0
Join to the chocolate world
|
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... | |
Example of usage:
#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 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.
The type is for storing memory access more (if it is privileged or not)
Definition at line 134 of file oc_mem_lld.h.
oC_ErrorCode_t oC_MEM_LLD_ConfigureMemoryRegion | ( | oC_MEM_LLD_MemoryRegionConfig_t * | Config | ) |
The function configures memory region.
Config | Pointer to the configuration |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
Definition at line 224 of file oc_mem_lld.c.
oC_MEM_LLD_MemoryAccessMode_t oC_MEM_LLD_GetMemoryAccessMode | ( | void | ) |
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.
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.
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.
Definition at line 125 of file oc_mem_lld.c.
void * oC_MEM_LLD_GetStackEndAddress | ( | void | ) |
The function returns end address of the stack.
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.
Definition at line 279 of file oc_mem_lld.c.
void * oC_MEM_LLD_GetStackStartAddress | ( | void | ) |
The function returns start address of the stack.
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.
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.
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.
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.
Definition at line 596 of file oc_mem_lld.c.
bool oC_MEM_LLD_IsDmaRamAddress | ( | const void * | Address | ) |
Address | address to check |
Definition at line 422 of file oc_mem_lld.c.
bool oC_MEM_LLD_IsExternalAddress | ( | const void * | Address | ) |
Address | address to check |
Definition at line 411 of file oc_mem_lld.c.
bool oC_MEM_LLD_IsFlashAddress | ( | const void * | Address | ) |
Address | address to check |
Definition at line 433 of file oc_mem_lld.c.
bool oC_MEM_LLD_IsHeapAddress | ( | const void * | Address | ) |
Address | address to check |
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.
Definition at line 583 of file oc_mem_lld.c.
bool oC_MEM_LLD_IsRamAddress | ( | const void * | Address | ) |
Address | address to check |
Definition at line 400 of file oc_mem_lld.c.
bool oC_MEM_LLD_IsUsedFlashAddress | ( | const void * | Address | ) |
Address | address to check Change |
Definition at line 444 of file oc_mem_lld.c.
oC_ErrorCode_t oC_MEM_LLD_SetBusFaultInterrupt | ( | oC_MEM_LLD_Interrupt_t | Interrupt | ) |
Interrupt | The function to call, when the interrupt occurs |
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.
Mode | User or Privileged access mode, for more see oC_MEM_LLD_MemoryAccessMode_t |
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.
Interrupt | The function to call, when the interrupt occurs |
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
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.
oC_ErrorCode_None
if there is no error. Moreover it return oC_ErrorCode_ModuleNotStartedYet
when the module was not turned on.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
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.
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.
oC_ErrorCode_None
if there is no error. Moreover it return oC_ErrorCode_ModuleIsTurnedOn
when the module was turned on before.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.
Definition at line 529 of file oc_mem_lld.c.