Choco OS  V.0.16.9.0
Join to the chocolate world
oc_sys_lld.h
Go to the documentation of this file.
1 
117 #ifndef SYSTEM_PORTABLE_INC_LLD_OC_SYS_LLD_H_
118 #define SYSTEM_PORTABLE_INC_LLD_OC_SYS_LLD_H_
119 
120 #include <oc_machine.h>
121 #include <oc_frequency.h>
122 #include <oc_errors.h>
123 
129 #define _________________________________________TYPES_SECTION______________________________________________________________________________
130 
133 //==========================================================================================================================================
142 //==========================================================================================================================================
143 typedef void oC_SYS_LLD_Context_t;
144 
145 //==========================================================================================================================================
152 //==========================================================================================================================================
153 typedef enum
154 {
162 
163 //==========================================================================================================================================
171 //==========================================================================================================================================
172 typedef void (*oC_SYS_LLD_Interrupt_t)(void);
173 
174 //==========================================================================================================================================
181 //==========================================================================================================================================
183 
184 //==========================================================================================================================================
195 //==========================================================================================================================================
196 typedef void (*oC_SYS_LLD_EventInterrupt_t)( oC_SYS_LLD_EventFlags_t EventFlags , oC_SYS_LLD_Context_t * Context , void * BusAddress );
197 
198 //==========================================================================================================================================
206 //==========================================================================================================================================
207 typedef void (*oC_SYS_LLD_ContextHandler_t)( void * Parameter );
208 
209 //==========================================================================================================================================
215 //==========================================================================================================================================
216 typedef void (*oC_SYS_LLD_ContextExitHandler_t)(void);
217 
218 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
219 
226 #define _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
227 
230 //==========================================================================================================================================
239 //==========================================================================================================================================
240 extern oC_ErrorCode_t oC_SYS_LLD_TurnOnDriver( void );
241 //==========================================================================================================================================
253 //==========================================================================================================================================
254 extern oC_ErrorCode_t oC_SYS_LLD_TurnOffDriver( void );
255 //==========================================================================================================================================
269 //==========================================================================================================================================
270 extern oC_ErrorCode_t oC_SYS_LLD_SetEventInterruptHandler(oC_SYS_LLD_EventInterrupt_t EventHandler , oC_SYS_LLD_EventFlags_t EventsFlags);
271 //==========================================================================================================================================
279 //==========================================================================================================================================
281 //==========================================================================================================================================
288 //==========================================================================================================================================
289 extern void oC_SYS_LLD_TurnOnInterrupts(void);
290 //==========================================================================================================================================
297 //==========================================================================================================================================
298 extern void oC_SYS_LLD_TurnOffInterrupts(void);
299 //==========================================================================================================================================
305 //==========================================================================================================================================
306 extern void oC_SYS_LLD_EnterCriticalSection(void);
307 //==========================================================================================================================================
313 //==========================================================================================================================================
314 extern void oC_SYS_LLD_ExitCriticalSection(void);
315 //==========================================================================================================================================
319 //==========================================================================================================================================
320 extern bool oC_SYS_LLD_AreInterruptsEnabled(void);
321 //==========================================================================================================================================
332 //==========================================================================================================================================
333 extern oC_ErrorCode_t oC_SYS_LLD_ConfigureSystemTimer( oC_Frequency_t Frequency , oC_SYS_LLD_SysTickIncrementHandler_t Interrupt);
334 //==========================================================================================================================================
344 //==========================================================================================================================================
345 extern oC_ErrorCode_t oC_SYS_LLD_ReadSystemTimerFrequency( oC_Frequency_t * outFrequency );
346 //==========================================================================================================================================
356 //==========================================================================================================================================
357 extern oC_ErrorCode_t oC_SYS_LLD_SetNextContext(oC_SYS_LLD_Context_t * Context);
358 
359 //==========================================================================================================================================
370 //==========================================================================================================================================
371 extern oC_Int_t oC_SYS_LLD_GetContextStackSize(oC_SYS_LLD_Context_t * Context);
372 
373 //==========================================================================================================================================
383 //==========================================================================================================================================
385 
386 //==========================================================================================================================================
394 //==========================================================================================================================================
395 extern oC_ErrorCode_t oC_SYS_LLD_ReturnToSystemContext( void );
396 
397 //==========================================================================================================================================
401 //==========================================================================================================================================
403 
404 //==========================================================================================================================================
408 //==========================================================================================================================================
410 
411 //==========================================================================================================================================
450 //==========================================================================================================================================
451 extern oC_ErrorCode_t oC_SYS_LLD_InitializeContext(oC_SYS_LLD_Context_t ** Context , oC_Int_t StackSize , oC_SYS_LLD_ContextHandler_t ContextHandler , void * Parameters , oC_SYS_LLD_ContextExitHandler_t ExitHandler );
452 //==========================================================================================================================================
462 //==========================================================================================================================================
463 extern oC_Int_t oC_SYS_LLD_GetMinimumContextSize(oC_Int_t StackSize);
464 //==========================================================================================================================================
472 //==========================================================================================================================================
473 extern const char * oC_SYS_LLD_GetMachineName( void );
474 //==========================================================================================================================================
482 //==========================================================================================================================================
483 extern const char * oC_SYS_LLD_GetMachineFamilyName( void );
484 //==========================================================================================================================================
492 //==========================================================================================================================================
493 extern const char * oC_SYS_LLD_GetMachineProducentName( void );
494 //==========================================================================================================================================
502 //==========================================================================================================================================
503 extern void oC_SYS_LLD_Reset( void );
504 //==========================================================================================================================================
512 //==========================================================================================================================================
513 extern bool oC_SYS_LLD_IsStackPushDecrementPointer( void );
514 //==========================================================================================================================================
520 //==========================================================================================================================================
521 extern oC_ErrorCode_t oC_SYS_LLD_ReadPowerState( float * outVcc );
522 
523 //==========================================================================================================================================
527 //==========================================================================================================================================
528 extern void * oC_SYS_LLD_GetLastProcessStackPointer( void );
529 
530 #undef _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
531 
533 #endif /* SYSTEM_PORTABLE_INC_LLD_OC_SYS_LLD_H_ */
Hard fault, divide by 0 detected.
Definition: oc_sys_lld.h:156
oC_SYS_LLD_Context_t * oC_SYS_LLD_GetSystemContext(void)
returns pointer to the system context
Definition: oc_sys_lld.c:408
oC_SYS_LLD_EventFlags_t
event flags handled by the module.
Definition: oc_sys_lld.h:153
void(* oC_SYS_LLD_ContextHandler_t)(void *Parameter)
stores pointer to context handler function
Definition: oc_sys_lld.h:207
oC_Int_t oC_SYS_LLD_GetMinimumContextSize(oC_Int_t StackSize)
returns minimum size to allocate for context
Definition: oc_sys_lld.c:452
The file with frequency definitions.
double oC_Frequency_t
type to store frequency
Definition: oc_frequency.h:76
void(* oC_SYS_LLD_EventInterrupt_t)(oC_SYS_LLD_EventFlags_t EventFlags, oC_SYS_LLD_Context_t *Context, void *BusAddress)
stores event handler function
Definition: oc_sys_lld.h:196
oC_ErrorCode_t oC_SYS_LLD_InitializeContext(oC_SYS_LLD_Context_t **Context, oC_Int_t StackSize, oC_SYS_LLD_ContextHandler_t ContextHandler, void *Parameters, oC_SYS_LLD_ContextExitHandler_t ExitHandler)
initializes stack of process
Definition: oc_sys_lld.c:419
oC_SYS_LLD_Context_t * oC_SYS_LLD_GetCurrentContext(void)
returns pointer to the current context
Definition: oc_sys_lld.c:397
const char * oC_SYS_LLD_GetMachineFamilyName(void)
returns printable name of the machine family
Definition: oc_sys_lld.c:474
oC_ErrorCode_t oC_SYS_LLD_TurnOnDriver(void)
initializes the driver to work
Definition: oc_sys_lld.c:103
void(* oC_SYS_LLD_Interrupt_t)(void)
type for storing interrupt pointers
Definition: oc_sys_lld.h:172
const char * oC_SYS_LLD_GetMachineProducentName(void)
returns printable name of the machine producent
Definition: oc_sys_lld.c:485
oC_ErrorCode_t oC_SYS_LLD_ReturnToSystemContext(void)
switches to the system context
Definition: oc_sys_lld.c:386
void oC_SYS_LLD_ExitCriticalSection(void)
exits from critical section
Definition: oc_sys_lld.c:239
oC_ErrorCode_t oC_SYS_LLD_ConfigureSystemTimer(oC_Frequency_t Frequency, oC_SYS_LLD_SysTickIncrementHandler_t Interrupt)
configures system timer
Definition: oc_sys_lld.c:261
oC_ErrorCode_t oC_SYS_LLD_ReadSystemTimerFrequency(oC_Frequency_t *outFrequency)
reads configured system frequency
Definition: oc_sys_lld.c:299
void oC_SYS_LLD_Context_t
type for storing context of the machine
Definition: oc_sys_lld.h:143
void oC_SYS_LLD_TurnOnInterrupts(void)
turns on interrupt
Definition: oc_sys_lld.c:206
void(* oC_SYS_LLD_SysTickIncrementHandler_t)(void)
stores SysTick interrupt handler
Definition: oc_sys_lld.h:182
Loading or storing data to memory occurs with not aligned address.
Definition: oc_sys_lld.h:157
oC_ErrorCode_t oC_SYS_LLD_TurnOffDriver(void)
release the driver
Definition: oc_sys_lld.c:138
void(* oC_SYS_LLD_ContextExitHandler_t)(void)
pointer to the context exit handler
Definition: oc_sys_lld.h:216
const char * oC_SYS_LLD_GetMachineName(void)
returns printable name of the machine
Definition: oc_sys_lld.c:463
oC_Int_t oC_SYS_LLD_GetContextStackSize(oC_SYS_LLD_Context_t *Context)
returns size of the stack for context
Definition: oc_sys_lld.c:350
oC_ErrorCode_t oC_SYS_LLD_ReadPowerState(float *outVcc)
reads power state
Definition: oc_sys_lld.c:518
oC_ErrorCode_t oC_SYS_LLD_SetNextContext(oC_SYS_LLD_Context_t *Context)
configures next machine context
Definition: oc_sys_lld.c:321
void oC_SYS_LLD_EnterCriticalSection(void)
enters to critical section
Definition: oc_sys_lld.c:228
oC_ErrorCode_t oC_SYS_LLD_SetEventInterruptHandler(oC_SYS_LLD_EventInterrupt_t EventHandler, oC_SYS_LLD_EventFlags_t EventsFlags)
sets event interrupt handler
Definition: oc_sys_lld.c:164
The file with interface for the machine module.
void oC_SYS_LLD_Reset(void)
software reset of the machine
Definition: oc_sys_lld.c:496
bool oC_SYS_LLD_AreInterruptsEnabled(void)
checks if interrupts are turned on
Definition: oc_sys_lld.c:250
The process is not correct, or the process stack was overflowed.
Definition: oc_sys_lld.h:160
void * oC_SYS_LLD_GetLastProcessStackPointer(void)
returns stack pointer of last executed process
Definition: oc_sys_lld.c:537
Undefined instruction detected.
Definition: oc_sys_lld.h:158
bool oC_SYS_LLD_IsStackPushDecrementPointer(void)
flag if stack push is decrement pointer
Definition: oc_sys_lld.c:507
void oC_SYS_LLD_TurnOffInterrupts(void)
turns off interrupt
Definition: oc_sys_lld.c:217
bool oC_SYS_LLD_IsMachineSupportMultithreadMode(void)
checks if the machine supports multi-thread mode
Definition: oc_sys_lld.c:195
Hard fault, reason is unknown.
Definition: oc_sys_lld.h:155
oC_Int_t oC_SYS_LLD_GetContextFreeStackSize(oC_SYS_LLD_Context_t *Context)
returns size of free stack in the context
Definition: oc_sys_lld.c:368