Choco OS  V.0.16.9.0
Join to the chocolate world
oc_mem_lld.c
1 
27 #include <oc_mem_lld.h>
28 #include <oc_interrupts.h>
29 #include <oc_lsf.h>
30 #include <oc_module.h>
31 #include <oc_mcs.h>
32 
38 #define _________________________________________LOCAL_VARIABLES_SECTION____________________________________________________________________
39 
40 static oC_MEM_LLD_Interrupt_t BusFaultInterruptHandler = NULL;
41 static oC_MEM_LLD_Interrupt_t MemoryFaultInterruptHandler = NULL;
42 static bool BusFaultInterruptEnabledFlag = false;
43 static bool MemoryFaultInterruptEnabledFlag = false;
44 
45 //static bool ModuleEnabledFlag = false;
46 
47 #undef _________________________________________LOCAL_VARIABLES_SECTION____________________________________________________________________
48 
54 #define _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________
55 
58 
59 
60 //==========================================================================================================================================
65 //==========================================================================================================================================
66 oC_ErrorCode_t oC_MEM_LLD_TurnOnDriver( void )
67 {
68  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
69 
70  if(oC_Module_TurnOffVerification(&errorCode , oC_Module_MEM_LLD))
71  {
73  BusFaultInterruptHandler = NULL;
74  MemoryFaultInterruptHandler = NULL;
75  BusFaultInterruptEnabledFlag = false;
76  MemoryFaultInterruptEnabledFlag = false;
77 
78  oC_Module_TurnOn(oC_Module_MEM_LLD);
80 
81  errorCode = oC_ErrorCode_None;
82  }
83  else
84  {
85  errorCode = oC_ErrorCode_ModuleIsTurnedOn;
86  }
87  return errorCode;
88 }
89 //==========================================================================================================================================
94 //==========================================================================================================================================
95 oC_ErrorCode_t oC_MEM_LLD_TurnOffDriver( void )
96 {
97  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
98 
99  if(oC_Module_TurnOnVerification(&errorCode , oC_Module_MEM_LLD))
100  {
102  oC_Module_TurnOff(oC_Module_MEM_LLD);
103  MemoryFaultInterruptEnabledFlag = false;
104  BusFaultInterruptEnabledFlag = false;
105 
106  if(
107  oC_AssignErrorCodeIfFalse(&errorCode , oC_MCS_DisableInterrupt(BusFault_IRQn) , oC_ErrorCode_CannotTurnOffInterruptInMachineModule) &&
108  oC_AssignErrorCodeIfFalse(&errorCode , oC_MCS_DisableInterrupt(MemoryManagement_IRQn) , oC_ErrorCode_CannotTurnOffInterruptInMachineModule)
109  )
110  {
111  errorCode = oC_ErrorCode_None;
112  }
114  }
115  else
116  {
117  errorCode = oC_ErrorCode_ModuleNotStartedYet;
118  }
119 
120  return errorCode;
121 }
122 //==========================================================================================================================================
127 //==========================================================================================================================================
128 void * oC_MEM_LLD_GetRamStartAddress( void )
129 {
130  return oC_LSF_GetRamStart();
131 }
132 
133 //==========================================================================================================================================
138 //==========================================================================================================================================
139 void * oC_MEM_LLD_GetRamEndAddress( void )
140 {
141  return oC_LSF_GetRamEnd();
142 }
143 
144 //==========================================================================================================================================
149 //==========================================================================================================================================
151 {
152  return oC_LSF_GetRamSize();
153 }
154 
155 //==========================================================================================================================================
160 //==========================================================================================================================================
161 void * oC_MEM_LLD_GetFlashStartAddress( void )
162 {
163  return oC_LSF_GetRomStart();
164 }
165 
166 //==========================================================================================================================================
171 //==========================================================================================================================================
172 void * oC_MEM_LLD_GetFlashEndAddress( void )
173 {
174  return oC_LSF_GetRomEnd();
175 }
176 
177 //==========================================================================================================================================
182 //==========================================================================================================================================
184 {
185  return oC_LSF_GetRomSize();
186 }
187 
188 //==========================================================================================================================================
193 //==========================================================================================================================================
194 void * oC_MEM_LLD_GetHeapStartAddress( void )
195 {
196  return oC_LSF_GetHeapStart();
197 }
198 
199 //==========================================================================================================================================
204 //==========================================================================================================================================
205 void * oC_MEM_LLD_GetHeapEndAddress( void )
206 {
207  return oC_LSF_GetHeapEnd();
208 }
209 
210 //==========================================================================================================================================
215 //==========================================================================================================================================
217 {
218  return oC_LSF_GetHeapSize();
219 }
220 
221 //==========================================================================================================================================
226 //==========================================================================================================================================
227 void * oC_MEM_LLD_GetStackStartAddress( void )
228 {
229  return oC_LSF_GetStackStart();
230 }
231 
232 //==========================================================================================================================================
237 //==========================================================================================================================================
238 void * oC_MEM_LLD_GetStackEndAddress( void )
239 {
240  return oC_LSF_GetStackEnd();
241 }
242 
243 //==========================================================================================================================================
248 //==========================================================================================================================================
250 {
251  return oC_LSF_GetStackSize();
252 }
253 
254 //==========================================================================================================================================
259 //==========================================================================================================================================
260 void * oC_MEM_LLD_GetDataStartAddress( void )
261 {
262  return oC_LSF_GetDataStart();
263 }
264 
265 //==========================================================================================================================================
270 //==========================================================================================================================================
271 void * oC_MEM_LLD_GetDataEndAddress( void )
272 {
273  return oC_LSF_GetDataEnd();
274 }
275 
276 //==========================================================================================================================================
281 //==========================================================================================================================================
283 {
284  return oC_LSF_GetDataSize();
285 }
286 
287 //==========================================================================================================================================
292 //==========================================================================================================================================
293 void * oC_MEM_LLD_GetBssStartAddress( void )
294 {
295  return oC_LSF_GetBssStart();
296 }
297 
298 //==========================================================================================================================================
303 //==========================================================================================================================================
304 void * oC_MEM_LLD_GetBssEndAddress( void )
305 {
306  return oC_LSF_GetBssEnd();
307 }
308 
309 //==========================================================================================================================================
314 //==========================================================================================================================================
316 {
317  return oC_LSF_GetBssSize();
318 }
319 
320 //==========================================================================================================================================
325 //==========================================================================================================================================
327 {
328  return oC_LSF_GetDmaStart();
329 }
330 
331 //==========================================================================================================================================
336 //==========================================================================================================================================
337 void * oC_MEM_LLD_GetDmaRamEndAddress( void )
338 {
339  return oC_LSF_GetDmaEnd();
340 }
341 
342 //==========================================================================================================================================
347 //==========================================================================================================================================
349 {
350  return oC_LSF_GetDmaSize();
351 }
352 
353 //==========================================================================================================================================
358 //==========================================================================================================================================
360 {
361  return oC_LSF_GetTextStart();
362 }
363 
364 //==========================================================================================================================================
369 //==========================================================================================================================================
371 {
372  return oC_LSF_GetTextEnd();
373 }
374 
375 //==========================================================================================================================================
380 //==========================================================================================================================================
382 {
383  return oC_LSF_GetTextSize();
384 }
385 
386 //==========================================================================================================================================
391 //==========================================================================================================================================
393 {
394  return oC_MCS_MEMORY_ALIGNMENT;
395 }
396 
397 //==========================================================================================================================================
402 //==========================================================================================================================================
403 bool oC_MEM_LLD_IsRamAddress( const void * Address )
404 {
405  return oC_LSF_IsRamAddress(Address);
406 }
407 
408 //==========================================================================================================================================
413 //==========================================================================================================================================
414 bool oC_MEM_LLD_IsExternalAddress( const void * Address )
415 {
416  return oC_LSF_IsExternalAddress(Address);
417 }
418 
419 //==========================================================================================================================================
424 //==========================================================================================================================================
425 bool oC_MEM_LLD_IsFlashAddress( const void * Address )
426 {
427  return oC_LSF_IsRomAddress(Address);
428 }
429 
430 //==========================================================================================================================================
435 //==========================================================================================================================================
436 bool oC_MEM_LLD_IsUsedFlashAddress( const void * Address )
437 {
438  return (Address > oC_LSF_GetTextStart()) && (Address < oC_LSF_GetTextEnd());
439 }
440 
441 //==========================================================================================================================================
446 //==========================================================================================================================================
447 bool oC_MEM_LLD_IsHeapAddress( const void * Address )
448 {
449  return (Address >= oC_LSF_GetHeapStart()) && (Address < oC_LSF_GetHeapEnd());
450 }
451 
452 //==========================================================================================================================================
457 //==========================================================================================================================================
458 bool oC_MEM_LLD_IsDmaRamAddress( const void * Address )
459 {
460  return oC_LSF_IsDmaAddress(Address);
461 }
462 
463 //==========================================================================================================================================
468 //==========================================================================================================================================
470 {
471  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
472 
473  if( oC_MEM_LLD_IsRamAddress(Interrupt) || oC_MEM_LLD_IsUsedFlashAddress(Interrupt))
474  {
475  if(
476  oC_Module_TurnOnVerification( &errorCode , oC_Module_MEM_LLD) &&
477  oC_AssignErrorCodeIfFalse( &errorCode , MemoryFaultInterruptHandler == NULL , oC_ErrorCode_InterruptHandlerAlreadySet)
478  )
479  {
480  /* Must not turn off interrupts, because there is no possible to turn it on, when
481  * the handler is not set. */
482  MemoryFaultInterruptHandler = Interrupt;
483  errorCode = oC_ErrorCode_None;
484  }
485  }
486  else
487  {
488  errorCode = oC_ErrorCode_WrongAddress;
489  }
490 
491 
492  return errorCode;
493 }
494 
495 //==========================================================================================================================================
500 //==========================================================================================================================================
502 {
503  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
504 
505  if( oC_MEM_LLD_IsRamAddress(Interrupt) || oC_MEM_LLD_IsUsedFlashAddress(Interrupt))
506  {
507  if(
508  oC_Module_TurnOnVerification( &errorCode , oC_Module_MEM_LLD) &&
509  oC_AssignErrorCodeIfFalse( &errorCode , BusFaultInterruptHandler == NULL , oC_ErrorCode_InterruptHandlerAlreadySet)
510  )
511  {
512  /* Must not turn off interrupts, because there is no possible to turn it on, when
513  * the handler is not set. */
514  BusFaultInterruptHandler = Interrupt;
515  errorCode = oC_ErrorCode_None;
516  }
517  }
518  else
519  {
520  errorCode = oC_ErrorCode_WrongAddress;
521  }
522 
523  return errorCode;
524 }
525 
526 //==========================================================================================================================================
531 //==========================================================================================================================================
532 oC_ErrorCode_t oC_MEM_LLD_TurnOnMemoryFaultInterrupt( void )
533 {
534  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
535 
536  if(
537  oC_Module_TurnOnVerification( &errorCode , oC_Module_MEM_LLD) &&
538  oC_AssignErrorCodeIfFalse(&errorCode , MemoryFaultInterruptHandler != NULL , oC_ErrorCode_InterruptHandlerNotSet)
539  )
540  {
541  if( oC_MCS_EnableInterrupt( MemoryManagement_IRQn ) )
542  {
543  errorCode = oC_ErrorCode_None;
544  }
545  else
546  {
547  errorCode = oC_ErrorCode_CannotTurnOnInterruptInMachineModule;
548  }
549  }
550 
551  return errorCode;
552 }
553 
554 //==========================================================================================================================================
559 //==========================================================================================================================================
560 oC_ErrorCode_t oC_MEM_LLD_TurnOffMemoryFaultInterrupt( void )
561 {
562  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
563 
564  if( oC_MCS_DisableInterrupt( MemoryManagement_IRQn ) )
565  {
566  errorCode = oC_ErrorCode_None;
567  }
568  else
569  {
570  errorCode = oC_ErrorCode_CannotTurnOnInterruptInMachineModule;
571  }
572 
573  return errorCode;
574 }
575 //==========================================================================================================================================
580 //==========================================================================================================================================
581 oC_ErrorCode_t oC_MEM_LLD_TurnOnBusFaultInterrupt( void )
582 {
583  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
584 
585  if(
586  oC_Module_TurnOnVerification( &errorCode , oC_Module_MEM_LLD) &&
587  oC_AssignErrorCodeIfFalse(&errorCode , BusFaultInterruptHandler != NULL , oC_ErrorCode_InterruptHandlerNotSet)
588  )
589  {
590  if( oC_MCS_EnableInterrupt( BusFault_IRQn ) )
591  {
592  errorCode = oC_ErrorCode_None;
593  }
594  else
595  {
596  errorCode = oC_ErrorCode_CannotTurnOnInterruptInMachineModule;
597  }
598  }
599 
600  return errorCode;
601 }
602 
603 //==========================================================================================================================================
608 //==========================================================================================================================================
609 oC_ErrorCode_t oC_MEM_LLD_TurnOffBusFaultInterrupt( void )
610 {
611  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
612 
613  if( oC_MCS_DisableInterrupt( BusFault_IRQn ) )
614  {
615  errorCode = oC_ErrorCode_None;
616  }
617  else
618  {
619  errorCode = oC_ErrorCode_CannotTurnOnInterruptInMachineModule;
620  }
621 
622  return errorCode;
623 }
624 
625 //==========================================================================================================================================
630 //==========================================================================================================================================
632 {
633  bool interruptTurnedOn = false;
634 
635  if( MemoryFaultInterruptEnabledFlag )
636  {
637  interruptTurnedOn = oC_MCS_IsInterruptEnabled( MemoryManagement_IRQn );
638  }
639 
640  return interruptTurnedOn;
641 }
642 
643 //==========================================================================================================================================
648 //==========================================================================================================================================
650 {
651  bool interruptTurnedOn = false;
652 
653  if( BusFaultInterruptEnabledFlag )
654  {
655  interruptTurnedOn = oC_MCS_IsInterruptEnabled( BusFault_IRQn );
656  }
657 
658  return interruptTurnedOn;
659 }
660 
661 //==========================================================================================================================================
666 //==========================================================================================================================================
668 {
669  oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
670  oC_MCS_MemoryRegionConfig_t mcsConfig;
671 
672  if(
673  oC_Module_TurnOnVerification( &errorCode , oC_Module_MEM_LLD) &&
674  ErrorCondition( oC_LSF_IsCorrectAddress(Config) , oC_ErrorCode_WrongAddress)
675  )
676  {
677  mcsConfig.AlignSize = false;
678  mcsConfig.BaseAddress = Config->BaseAddress;
679  mcsConfig.Bufforable = Config->Bufforable;
680  mcsConfig.Cacheable = Config->Cachable;
681  mcsConfig.Power = Config->Power;
682  mcsConfig.PrivilegedAccess = Config->PrivilegedAccess;
683  mcsConfig.UserAccess = Config->UserAccess;
684  mcsConfig.RegionNumber = Config->RegionNumber;
685  mcsConfig.Shareable = false;
686  mcsConfig.Size = Config->Size;
687 
688  if(Config->FindFreeRegion == false || ErrorCondition(oC_MCS_ReadFreeRegionNumber(&mcsConfig.RegionNumber) , oC_ErrorCode_NoChannelAvailable))
689  {
690  if(oC_AssignErrorCode(&errorCode , oC_MCS_ConfigureMemoryRegion(&mcsConfig)))
691  {
692  if( Config->FindFreeRegion == true
693  && ErrorCondition( oC_LSF_IsRamAddress(Config) || oC_LSF_IsExternalAddress(Config) , oC_ErrorCode_OutputAddressNotInRAM )
694  )
695  {
696  Config->RegionNumber = mcsConfig.RegionNumber;
697  }
698  errorCode = oC_ErrorCode_None;
699  }
700  }
701  }
702 
703  return errorCode;
704 }
705 
706 //==========================================================================================================================================
711 //==========================================================================================================================================
713 {
714  return oC_MCS_SetMemoryAccessMode(Mode);
715 }
716 
717 //==========================================================================================================================================
722 //==========================================================================================================================================
724 {
726 }
727 
728 #undef _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________
729 
736 #define _________________________________________INTERRUPTS_SECTION_________________________________________________________________________
737 
738 //==========================================================================================================================================
742 //==========================================================================================================================================
743 oC_InterruptHandler(SYSTEM_INT, BusFault)
744 {
745  if(BusFaultInterruptHandler && BusFaultInterruptEnabledFlag)
746  {
747  BusFaultInterruptHandler();
748  }
749 }
750 
751 //==========================================================================================================================================
755 //==========================================================================================================================================
756 oC_InterruptHandler(SYSTEM_INT, MemoryManagement)
757 {
758  if(MemoryFaultInterruptHandler && MemoryFaultInterruptEnabledFlag)
759  {
760  MemoryFaultInterruptHandler();
761  }
762 }
763 
764 #undef _________________________________________INTERRUPTS_SECTION_________________________________________________________________________
#define oC_InterruptHandler(BASE_NAME, TYPE_NAME)
Define handler for interrupt.
static void * oC_LSF_GetHeapStart(void)
returns heap start address
Definition: oc_lsf.h:326
static void * oC_LSF_GetDmaStart(void)
returns start address of DMA section
Definition: oc_lsf.h:539
void * oC_MEM_LLD_GetFlashEndAddress(void)
returns end address of the flash
Definition: oc_mem_lld.c:202
bool oC_MEM_LLD_SetMemoryAccessMode(oC_MEM_LLD_MemoryAccessMode_t Mode)
Change current memory access mode.
Definition: oc_mem_lld.c:654
bool oC_MEM_LLD_IsMemoryFaultInterruptTurnedOn(void)
checks if memory fault interrupt is turned on
Definition: oc_mem_lld.c:583
void * oC_MEM_LLD_GetStackEndAddress(void)
returns end address of the stack
Definition: oc_mem_lld.c:268
bool oC_MEM_LLD_IsUsedFlashAddress(const void *Address)
checks if the pointer is in used flash section
Definition: oc_mem_lld.c:444
bool Cacheable
True if the region should be cacheable - If you set a region to be cacheable: When you load from that...
Definition: oc_mcs.h:231
static void * oC_LSF_GetRamEnd(void)
returns ram end address
Definition: oc_lsf.h:172
oC_ErrorCode_t oC_MEM_LLD_TurnOffBusFaultInterrupt(void)
turns off bus fault interrupt
Definition: oc_mem_lld.c:572
oC_MEM_LLD_Size_t oC_MEM_LLD_GetDataSize(void)
returns size of the data section
Definition: oc_mem_lld.c:312
void * oC_MEM_LLD_GetDataEndAddress(void)
returns end address of the data section
Definition: oc_mem_lld.c:301
oC_ErrorCode_t oC_MEM_LLD_SetBusFaultInterrupt(oC_MEM_LLD_Interrupt_t Interrupt)
sets interrupt handler for bus fault
Definition: oc_mem_lld.c:498
oC_MemorySize_t Size
Size of the region.
Definition: oc_mcs.h:225
bool oC_MCS_SetMemoryAccessMode(oC_MCS_MemoryAccessMode_t Mode)
sets the memory access mode
Definition: oc_mcs.c:847
void * oC_MEM_LLD_GetFlashStartAddress(void)
returns start address of the flash
Definition: oc_mem_lld.c:191
oC_ErrorCode_t oC_MEM_LLD_TurnOffDriver(void)
release the driver
Definition: oc_mem_lld.c:92
stores configuration of the memory region
Definition: oc_mem_lld.h:114
bool oC_MEM_LLD_IsExternalAddress(const void *Address)
checks if the pointer is in external section
Definition: oc_mem_lld.c:411
void * oC_MEM_LLD_GetDmaRamStartAddress(void)
returns start address of the DMA RAM
Definition: oc_mem_lld.c:158
static oC_UInt_t oC_LSF_GetDmaSize(void)
returns size of the section in linkage
Definition: oc_lsf.h:569
const void * BaseAddress
Base address of the region - this must point to the start of the region.
Definition: oc_mem_lld.h:116
static void * oC_LSF_GetRomEnd(void)
returns rom end address
Definition: oc_lsf.h:130
The file with interface for LSF module.
static void * oC_LSF_GetTextStart(void)
returns text start address
Definition: oc_lsf.h:284
oC_ErrorCode_t oC_MEM_LLD_ConfigureMemoryRegion(oC_MEM_LLD_MemoryRegionConfig_t *Config)
configures memory region
Definition: oc_mem_lld.c:609
bool oC_MEM_LLD_IsFlashAddress(const void *Address)
checks if the pointer is in flash section
Definition: oc_mem_lld.c:433
static oC_UInt_t oC_LSF_GetRomSize(void)
returns size of the section in linkage
Definition: oc_lsf.h:144
oC_ErrorCode_t oC_MEM_LLD_TurnOnBusFaultInterrupt(void)
turns on bus fault interrupt
Definition: oc_mem_lld.c:551
The file with LLD interface for the MEM driver.
void * oC_MEM_LLD_GetUsedFlashEndAddress(void)
returns used flash end address
Definition: oc_mem_lld.c:367
const void * BaseAddress
Base address of the region - this must point to the start of the region.
Definition: oc_mcs.h:224
oC_ErrorCode_t oC_MEM_LLD_TurnOnDriver(void)
initializes the driver to work
Definition: oc_mem_lld.c:63
void * oC_MEM_LLD_GetHeapEndAddress(void)
returns end address of the heap
Definition: oc_mem_lld.c:235
bool oC_MEM_LLD_IsBusFaultInterruptTurnedOn(void)
checks if bus fault interrupt is turned on
Definition: oc_mem_lld.c:596
void * oC_MEM_LLD_GetBssEndAddress(void)
returns end address of the Bss section
Definition: oc_mem_lld.c:334
oC_MEM_LLD_Size_t oC_MEM_LLD_GetUsedFlashSize(void)
returns size of the used flash section
Definition: oc_mem_lld.c:378
static void * oC_LSF_GetTextEnd(void)
returns text end address
Definition: oc_lsf.h:298
oC_MEM_LLD_Size_t oC_MEM_LLD_GetDmaRamSize(void)
returns size of the DMA ram
Definition: oc_mem_lld.c:180
bool oC_MCS_EnableInterrupt(IRQn_Type InterruptNumber)
enables interrupt with specified number
Definition: oc_mcs.c:368
static void * oC_LSF_GetRamStart(void)
returns ram start address
Definition: oc_lsf.h:158
uint32_t RegionNumber
Number of the region to configure.
Definition: oc_mcs.h:233
oC_Access_t UserAccess
Definition of access for user space.
Definition: oc_mem_lld.h:119
oC_ErrorCode_t oC_MCS_ConfigureMemoryRegion(const oC_MCS_MemoryRegionConfig_t *Config)
configures memory region
Definition: oc_mcs.c:701
bool Cachable
True if the region should be cacheable - If you set a region to be cacheable: When you load from that...
Definition: oc_mem_lld.h:121
static void * oC_LSF_GetBssStart(void)
returns bss start address
Definition: oc_lsf.h:242
The file with interface for the module library.
oC_Access_t PrivilegedAccess
Definition of access for privileged space (portable or core)
Definition: oc_mem_lld.h:118
bool Bufforable
True if the region should be bufforable - Bufferable means whether a write to the address can be buff...
Definition: oc_mcs.h:232
static oC_UInt_t oC_LSF_GetDataSize(void)
returns size of the section in linkage
Definition: oc_lsf.h:228
static void * oC_LSF_GetDmaEnd(void)
returns end address of DMA section
Definition: oc_lsf.h:554
static void * oC_LSF_GetDataStart(void)
returns data start address
Definition: oc_lsf.h:200
bool oC_MEM_LLD_IsHeapAddress(const void *Address)
checks if the pointer is in heap section
Definition: oc_mem_lld.c:455
bool oC_MCS_IsInterruptEnabled(IRQn_Type InterruptNumber)
checks if interrupt is enabled
Definition: oc_mcs.c:390
oC_Access_t UserAccess
Definition of access for user space.
Definition: oc_mcs.h:228
static void * oC_LSF_GetStackEnd(void)
returns stack end address
Definition: oc_lsf.h:382
oC_MemorySize_t Size
Size of the region.
Definition: oc_mem_lld.h:117
uint32_t RegionNumber
(optional) Number of the region to configure.
Definition: oc_mem_lld.h:123
static oC_UInt_t oC_LSF_GetTextSize(void)
returns size of the section in linkage
Definition: oc_lsf.h:312
oC_MEM_LLD_MemoryAccessMode_t
stores access memory mode
Definition: oc_mem_lld.h:134
oC_MEM_LLD_Size_t oC_MEM_LLD_GetRamSize(void)
returns size of the ram
Definition: oc_mem_lld.c:147
oC_MEM_LLD_Size_t oC_MEM_LLD_GetHeapSize(void)
returns size of the heap
Definition: oc_mem_lld.c:246
static void oC_Module_TurnOn(oC_Module_t Module)
sets module as turned on
Definition: oc_module.h:170
Contains machine core specific functions.
oC_MEM_LLD_Size_t oC_MEM_LLD_GetFlashSize(void)
returns size of the flash section
Definition: oc_mem_lld.c:213
void * oC_MEM_LLD_GetRamEndAddress(void)
returns end address of the RAM
Definition: oc_mem_lld.c:136
void * oC_MEM_LLD_GetUsedFlashStartAddress(void)
returns start address of the used flash section
Definition: oc_mem_lld.c:356
static void oC_MCS_EnterCriticalSection(void)
Enters to critical section.
Definition: oc_mcs.h:755
oC_UInt_t oC_MEM_LLD_Size_t
type for storing size of memory
Definition: oc_mem_lld.h:157
void * oC_MEM_LLD_GetBssStartAddress(void)
returns start address of the Bss section
Definition: oc_mem_lld.c:323
void * oC_MEM_LLD_GetHeapStartAddress(void)
returns start address of the heap
Definition: oc_mem_lld.c:224
bool Bufforable
True if the region should be bufforable - Bufferable means whether a write to the address can be buff...
Definition: oc_mem_lld.h:122
configuration structure for the memory region
Definition: oc_mcs.h:222
oC_Access_t PrivilegedAccess
Definition of access for privileged space (portable or core)
Definition: oc_mcs.h:229
The file with interface interrupt module.
bool FindFreeRegion
If true, the RegionNumber field is ignored and filled with the new value after configuration.
Definition: oc_mem_lld.h:124
void * oC_MEM_LLD_GetStackStartAddress(void)
returns start address of the stack
Definition: oc_mem_lld.c:257
bool oC_MCS_ReadFreeRegionNumber(uint32_t *outFreeRegionNumber)
reads number of a free region
Definition: oc_mcs.c:807
oC_MEM_LLD_MemoryAccessMode_t oC_MEM_LLD_GetMemoryAccessMode(void)
returns currently configured memory access mode
Definition: oc_mem_lld.c:665
static oC_UInt_t oC_LSF_GetBssSize(void)
returns size of the section in linkage
Definition: oc_lsf.h:270
static bool oC_Module_TurnOffVerification(oC_ErrorCode_t *outErrorCode, oC_Module_t Module)
verify if module is turned off
Definition: oc_module.h:155
static bool oC_MCS_ExitCriticalSection(void)
Exits from critical section.
Definition: oc_mcs.h:784
oC_ErrorCode_t oC_MEM_LLD_SetMemoryFaultInterrupt(oC_MEM_LLD_Interrupt_t Interrupt)
sets interrupt handler for memory fault
Definition: oc_mem_lld.c:466
static bool oC_Module_TurnOnVerification(oC_ErrorCode_t *outErrorCode, oC_Module_t Module)
verify if module is turned on
Definition: oc_module.h:138
oC_MEM_LLD_Size_t oC_MEM_LLD_GetBssSize(void)
returns size of the Bss section
Definition: oc_mem_lld.c:345
bool oC_MEM_LLD_IsDmaRamAddress(const void *Address)
checks if the pointer is in DMA RAM section
Definition: oc_mem_lld.c:422
oC_MEM_LLD_Size_t oC_MEM_LLD_GetAlignmentSize(void)
returns size of alignment
Definition: oc_mem_lld.c:389
oC_ErrorCode_t oC_MEM_LLD_TurnOffMemoryFaultInterrupt(void)
turns off memory fault interrupt
Definition: oc_mem_lld.c:540
oC_ErrorCode_t oC_MEM_LLD_TurnOnMemoryFaultInterrupt(void)
turns on memory fault interrupt
Definition: oc_mem_lld.c:529
void(* oC_MEM_LLD_Interrupt_t)(void)
type for storing memory interrupt pointers
Definition: oc_mem_lld.h:167
void * oC_MEM_LLD_GetRamStartAddress(void)
returns start address of the RAM
Definition: oc_mem_lld.c:125
void * oC_MEM_LLD_GetDmaRamEndAddress(void)
returns end address of the DMA RAM
Definition: oc_mem_lld.c:169
oC_Power_t Power
Power state for the region (enabled or disabled)
Definition: oc_mem_lld.h:120
oC_MCS_MemoryAccessMode_t oC_MCS_GetMemoryAccessMode(void)
reads memory access mode
Definition: oc_mcs.c:870
bool Shareable
For a shareable memory region that is implemented, the memory system provides data synchronization be...
Definition: oc_mcs.h:230
oC_MEM_LLD_Size_t oC_MEM_LLD_GetStackSize(void)
returns size of the stack
Definition: oc_mem_lld.c:279
static void * oC_LSF_GetDataEnd(void)
returns data end address
Definition: oc_lsf.h:214
oC_Power_t Power
Power state for the region (enabled or disabled)
Definition: oc_mcs.h:227
static void * oC_LSF_GetRomStart(void)
returns rom start address
Definition: oc_lsf.h:116
static void * oC_LSF_GetBssEnd(void)
returns bss end address
Definition: oc_lsf.h:256
static void * oC_LSF_GetStackStart(void)
returns stack start address
Definition: oc_lsf.h:368
static void * oC_LSF_GetHeapEnd(void)
returns heap end address
Definition: oc_lsf.h:340
static oC_UInt_t oC_LSF_GetStackSize(void)
returns size of the section in linkage
Definition: oc_lsf.h:396
bool oC_MCS_DisableInterrupt(IRQn_Type InterruptNumber)
disables interrupt with specified number
Definition: oc_mcs.c:379
static oC_UInt_t oC_LSF_GetHeapSize(void)
returns size of the section in linkage
Definition: oc_lsf.h:354
static oC_UInt_t oC_LSF_GetRamSize(void)
returns size of the section in linkage
Definition: oc_lsf.h:186
bool AlignSize
True if the MCS should find the size nearest to the value given as the Size field.
Definition: oc_mcs.h:226
bool oC_MEM_LLD_IsRamAddress(const void *Address)
checks if the pointer is in ram section
Definition: oc_mem_lld.c:400
#define NULL
pointer to a zero
Definition: oc_null.h:37
void * oC_MEM_LLD_GetDataStartAddress(void)
returns start address of the data section
Definition: oc_mem_lld.c:290
static void oC_Module_TurnOff(oC_Module_t Module)
sets module as turned off
Definition: oc_module.h:185