Graphics framework for GR-PEACH. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE
Dependents: ImageZoomInout_Sample ImageRotaion_Sample ImageScroll_Sample GR-PEACH_LCD_4_3inch_Save_to_USB ... more
OS Porting Layer. More...
Go to the source code of this file.
Functions | |
static r_ospl_error_t * | R_OSPL_GetCurrentThreadError_Sub (r_ospl_if_not_t const TypeOfIfNot) |
GetCurrentThreadError. | |
int32_t | R_OSPL_GetVersion (void) |
Returns version number of OSPL. | |
bool_t | R_OSPL_IsPreemption (void) |
Returns whether the environment is supported preemption. | |
void | R_OSPL_FLAG32_InitConst (volatile r_ospl_flag32_t *const self) |
Clears all flags in 32bit to 0. | |
void | R_OSPL_FLAG32_Set (volatile r_ospl_flag32_t *const self, bit_flags32_t const SetFlags) |
Set one or some bits to 1. | |
void | R_OSPL_FLAG32_Clear (volatile r_ospl_flag32_t *const self, bit_flags32_t const ClearFlags1) |
Set one or some bits to 0. | |
bit_flags32_t | R_OSPL_FLAG32_Get (volatile const r_ospl_flag32_t *const self) |
Get 32bit flags value. | |
bit_flags32_t | R_OSPL_FLAG32_GetAndClear (volatile r_ospl_flag32_t *const self) |
Get 32bit flags value. | |
void | R_OSPL_ASYNC_CopyExceptAThread (const r_ospl_async_t *const Source, r_ospl_async_t *const Destination) |
CopyExceptAThread. | |
void | R_OSPL_EnableAllInterrupt (void) |
Releases all disabled interrupts. | |
bool_t | R_OSPL_DisableAllInterrupt (void) |
Disables all interrupts. | |
void | R_BSP_InterruptsEnable (void) |
Globally enables interrupts. | |
void | R_BSP_InterruptsDisable (void) |
Globally disables interrupts. | |
errnum_t | R_OSPL_LockChannel (int_fast32_t ChannelNum, int_fast32_t *out_ChannelNum, mcu_lock_t HardwareIndexMin, mcu_lock_t HardwareIndexMax) |
Locks by channel number. | |
errnum_t | R_OSPL_UnlockChannel (int_fast32_t ChannelNum, errnum_t e, mcu_lock_t HardwareIndexMin, mcu_lock_t HardwareIndexMax) |
Unlocks by channel number. | |
void | R_OSPL_C_LOCK_InitConst (r_ospl_c_lock_t *const self) |
Initializes the C-lock object. | |
errnum_t | R_OSPL_C_LOCK_Lock (r_ospl_c_lock_t *const self) |
Locks the target, if lockable state. | |
errnum_t | R_OSPL_C_LOCK_Unlock (r_ospl_c_lock_t *const self) |
Unlocks the target. | |
bool_t | R_OSPL_I_LOCK_LockStub (void *const self_) |
Do nothing. | |
void | R_OSPL_I_LOCK_UnlockStub (void *const self_) |
Do nothing. | |
void | R_OSPL_I_LOCK_RequestFinalizeStub (void *const self_) |
Do nothing. | |
void | R_OSPL_MEMORY_Barrier (void) |
Set a memory barrier. | |
void | R_OSPL_InstructionSyncBarrier (void) |
Set a instruction barrier. | |
void | R_OSPL_CALLER_Initialize (r_ospl_caller_t *const self, r_ospl_async_t *const Async, volatile void *const PointerToState, int_t const StateValueOfOnInterrupting, void *const I_Lock, const r_ospl_i_lock_vtable_t *const I_LockVTable) |
Initialize <r_ospl_caller_t>. | |
errnum_t | R_OSPL_FTIMER_InitializeIfNot (r_ospl_ftimer_spec_t *const out_Specification) |
Set up the free running timer. | |
void | R_OSPL_FTIMER_GetSpecification (r_ospl_ftimer_spec_t *const out_Specification) |
Gets the specification of free running timer. | |
uint32_t | R_OSPL_FTIMER_Get (void) |
Get current time of free running timer. | |
errnum_t | R_OSPL_FTIMER_IsPast (const r_ospl_ftimer_spec_t *const ts, uint32_t const Now, uint32_t const TargetTime, bool_t *const out_IsPast) |
Returns whether specified time was passed. | |
void | R_OSPL_TABLE_InitConst (r_ospl_table_t *const self, void *const Area, size_t const AreaByteSize, bool_t const Is_T_Lock) |
Initializes an index table. | |
errnum_t | R_OSPL_TABLE_GetIndex (r_ospl_table_t *const self, const void *const Key, int_fast32_t *const out_Index, r_ospl_if_not_t const TypeOfIfNot) |
Returns index from related key. | |
void | R_OSPL_TABLE_Free (r_ospl_table_t *const self, const void *const Key) |
Separates relationship of specified key and related index. | |
void | R_OSPL_TABLE_Print (r_ospl_table_t *const self) |
Print status of specified index table object (for debug) | |
void | R_OSPL_CallInterruptCallback (const r_ospl_caller_t *const self, const r_ospl_interrupt_t *const InterruptSource) |
Calls the interrupt callback function. | |
void | R_OSPL_SetErrNum (errnum_t const e) |
Sets an error code to TLS (Thread Local Storage). | |
errnum_t | R_OSPL_GetErrNum (void) |
Returns the error code from TLS (Thread Local Storage). | |
static bool_t | R_OSPL_OnRaisingError_Sub (const char_t *const FilePath, int_fast32_t const LineNum) |
Function part of error break. | |
bool_t | R_OSPL_OnRaisingErrorForMISRA (bool_t const Condition, const char_t *const File, int_t const Line) |
Sub routine of IF macro. | |
void | R_OSPL_DebugBreakIfError (const char_t *const File, int_t const Line) |
Function part of <R_DEBUG_BREAK_IF_ERROR> | |
r_ospl_error_t * | R_OSPL_GetCurrentThreadError (void) |
Returns debbug information of current thread. | |
void | R_OSPL_SET_DEBUG_WORK (void *const WorkArea, uint32_t const WorkAreaSize) |
Set the debug work area. | |
Variables | |
static r_ospl_table_block_t | gs_thread_index_table_body [R_OSPL_DEFAULT_DEBUG_THREAD_COUNT] |
For until calling "R_OSPL_SET_DEBUG_WORK". | |
static r_ospl_error_t | gs_error |
For until calling "R_OSPL_SET_DEBUG_WORK". | |
static r_ospl_global_error_t | gs_global_error |
as <r_ospl_global_error_t> |
Detailed Description
OS Porting Layer.
Functions not depended on any environment.
- Module:
- OSPL
- PublicVersion:
- 0.90
(=R_OSPL_VERSION)
- Rev:
- 35
- Date:
- 2014-04-15 21:38:18 +0900#
Definition in file r_ospl.c.
Function Documentation
void R_BSP_InterruptsDisable | ( | void | ) |
void R_BSP_InterruptsEnable | ( | void | ) |
void R_OSPL_ASYNC_CopyExceptAThread | ( | const r_ospl_async_t *const | Source, |
r_ospl_async_t *const | Destination | ||
) |
void R_OSPL_C_LOCK_InitConst | ( | r_ospl_c_lock_t *const | self ) |
errnum_t R_OSPL_C_LOCK_Lock | ( | r_ospl_c_lock_t *const | self ) |
Locks the target, if lockable state.
- Parameters:
-
self C-lock object
- Returns:
- Error code. If there is no error, the return value is 0.
- Description
- Even if lock owner called this function, if lock object was already locked, E_ACCESS_DENIED error is raised.
"R_OSPL_C_LOCK_Lock" does not do exclusive control.
errnum_t R_OSPL_C_LOCK_Unlock | ( | r_ospl_c_lock_t *const | self ) |
Unlocks the target.
- Parameters:
-
self C-lock object
- Returns:
- Error code. If there is no error, the return value is 0.
- Description
- If this function was called with unlocked object, this function does nothing and raises "E_ACCESS_DENIED" error.
If self == NULL, this function does nothing and raises no error. E_NOT_THREAD error is raised, if this function was called from the interrupt context.
- I - lock does not do in this function.
"R_OSPL_C_LOCK_Unlock" does not do exclusive control.
void R_OSPL_CALLER_Initialize | ( | r_ospl_caller_t *const | self, |
r_ospl_async_t *const | Async, | ||
volatile void *const | PointerToState, | ||
int_t const | StateValueOfOnInterrupting, | ||
void *const | I_Lock, | ||
const r_ospl_i_lock_vtable_t *const | I_LockVTable | ||
) |
void R_OSPL_CallInterruptCallback | ( | const r_ospl_caller_t *const | self, |
const r_ospl_interrupt_t *const | InterruptSource | ||
) |
void R_OSPL_DebugBreakIfError | ( | const char_t *const | File, |
int_t const | Line | ||
) |
bool_t R_OSPL_DisableAllInterrupt | ( | void | ) |
Disables all interrupts.
- Parameters
- None
- Returns:
- None
- Description
- Driver user should not call this function. Call this function at begin of area of all interrupts disabled. This function does not disable NMI.
- Example
void Func() { bool_t was_all_enabled = false; was_all_enabled = R_OSPL_DisableAllInterrupt(); // All interrupt disabled if ( was_all_enabled ) { R_OSPL_EnableAllInterrupt(); } }
void R_OSPL_EnableAllInterrupt | ( | void | ) |
Releases all disabled interrupts.
- Parameters
- None
- Returns:
- None
- Description
- Driver user should not call this function. Call this function at the end of area of all interrupts disabled. Do not release, if all interrupts was already disabled by caller function. This function does not release disabled NMI.
void R_OSPL_FLAG32_Clear | ( | volatile r_ospl_flag32_t *const | self, |
bit_flags32_t const | ClearFlags1 | ||
) |
Set one or some bits to 0.
- Parameters:
-
self The value of 32bit flags ClearFlags1 The value of bit flags that clearing bit is 1
- Returns:
- None
- Description
- Operates following operation.
volatile bit_flags32_t self->Flags; bit_flags32_t ClearFlags1; self->Flags &= ~ClearFlags1;
Set "R_OSPL_FLAG32_ALL_BITS", if you wanted to clear all bits.
This function is not atomic because "&=" operator is "Read Modify Write" operation.
bit_flags32_t R_OSPL_FLAG32_Get | ( | volatile const r_ospl_flag32_t *const | self ) |
Get 32bit flags value.
- Parameters:
-
self The value of 32bit flags
- Returns:
- The value of 32bit flags
- Description
- In receiving the event, call "R_OSPL_FLAG32_GetAndClear" function instead of "R_OSPL_FLAG32_Get" function or call "R_OSPL_FLAG32_Clear" function passed the NOT operated value of flags got by "R_OSPL_FLAG32_Get" function.
Operates following operation. volatile bit_flags32_t self->Flags; bit_flags32_t return_flags; return_flags = self->Flags; return return_flags;
bit_flags32_t R_OSPL_FLAG32_GetAndClear | ( | volatile r_ospl_flag32_t *const | self ) |
Get 32bit flags value.
- Parameters:
-
self The value of 32bit flags
- Returns:
- The value of 32bit flags
- Description
- Operates following operation.
volatile bit_flags32_t self->Flags; bit_flags32_t return_flags; return_flags = self->Flags; self->Flags = 0; return return_flags;
This function is not atomic because the value might be set before clearing to 0.
void R_OSPL_FLAG32_InitConst | ( | volatile r_ospl_flag32_t *const | self ) |
Clears all flags in 32bit to 0.
- Parameters:
-
self The value of 32bit flags
- Returns:
- None
- Description
- Operates following operation.
volatile bit_flags32_t self->flags; self->flags = 0;
void R_OSPL_FLAG32_Set | ( | volatile r_ospl_flag32_t *const | self, |
bit_flags32_t const | SetFlags | ||
) |
Set one or some bits to 1.
- Parameters:
-
self The value of 32bit flags SetFlags The value of bit flags that target bit is 1
- Returns:
- None
- Description
- Operates following operation. This function is not atomic because "|=" operator is "Read Modify Write" operation.
volatile bit_flags32_t self->Flags; bit_flags32_t SetFlags; self->Flags |= SetFlags;
uint32_t R_OSPL_FTIMER_Get | ( | void | ) |
Get current time of free running timer.
- Parameters
- None
- Returns:
- The current clock count of free run timer
- Description
- Call "R_OSPL_FTIMER_InitializeIfNot" function before calling this function. Call "R_OSPL_FTIMER_IsPast" function, when it is determined whether time passed.
- Example
errnum_t e; r_ospl_ftimer_spec_t ts; uint32_t start; uint32_t end; e= R_OSPL_FTIMER_InitializeIfNot( &ts ); IF(e){goto fin;} start = R_OSPL_FTIMER_Get(); // The section of measuring end = R_OSPL_FTIMER_Get(); printf( "%d msec\n", R_OSPL_FTIMER_CountToTime( &ts, end - start ) );
void R_OSPL_FTIMER_GetSpecification | ( | r_ospl_ftimer_spec_t *const | out_Specification ) |
errnum_t R_OSPL_FTIMER_InitializeIfNot | ( | r_ospl_ftimer_spec_t *const | out_Specification ) |
Set up the free running timer.
- Parameters:
-
out_Specification NULL is permitted. Output: The precision of the free run timer
- Returns:
- Error code. If there is no error, the return value is 0.
- Description
- The free running timer does not stop.
If the counter of the free running timer was overflow, the counter returns to 0. Even in interrupt handler, the counter does count up. OSPL free running timer does not use any interrupt.
Using timer can be selected by "R_OSPL_FTIMER_IS" macro.
If the free running timer was already set up, this function does not set up it, outputs to "out_Specification" argument and does not raise any error.
When OSPL API function with timeout or "R_OSPL_Delay" function was called, "R_OSPL_FTIMER_InitializeIfNot" function is callbacked from these functions.
There is all interrupt disabled area inside.
errnum_t R_OSPL_FTIMER_IsPast | ( | const r_ospl_ftimer_spec_t *const | ts, |
uint32_t const | Now, | ||
uint32_t const | TargetTime, | ||
bool_t *const | out_IsPast | ||
) |
Returns whether specified time was passed.
- Parameters:
-
ts Precision of the free running timer Now Count of current time TargetTime Count of target time out_IsPast Output: Whether the target time was past or not
- Returns:
- Error code. If there is no error, the return value is 0.
r_ospl_error_t* R_OSPL_GetCurrentThreadError | ( | void | ) |
static r_ospl_error_t * R_OSPL_GetCurrentThreadError_Sub | ( | r_ospl_if_not_t const | TypeOfIfNot ) | [static] |
errnum_t R_OSPL_GetErrNum | ( | void | ) |
Returns the error code from TLS (Thread Local Storage).
- Parameters
- None
- Returns:
- Error code
- Description
- Usually error code is returned. If API function cannot return any error code, API function may have the specification of getting error code by "R_OSPL_GetErrNum".
There is this function, if "R_OSPL_TLS_ERROR_CODE" macro was defined to be 1. This function returns 0 after called "R_OSPL_CLEAR_ERROR" function.
int32_t R_OSPL_GetVersion | ( | void | ) |
bool_t R_OSPL_I_LOCK_LockStub | ( | void *const | self_ ) |
void R_OSPL_I_LOCK_RequestFinalizeStub | ( | void *const | self_ ) |
void R_OSPL_I_LOCK_UnlockStub | ( | void *const | self_ ) |
void R_OSPL_InstructionSyncBarrier | ( | void | ) |
bool_t R_OSPL_IsPreemption | ( | void | ) |
errnum_t R_OSPL_LockChannel | ( | int_fast32_t | ChannelNum, |
int_fast32_t * | out_ChannelNum, | ||
mcu_lock_t | HardwareIndexMin, | ||
mcu_lock_t | HardwareIndexMax | ||
) |
Locks by channel number.
- Parameters:
-
ChannelNum Locking channel number or "R_OSPL_UNLOCKED_CHANNEL" out_ChannelNum Output: Locked channel number, (in) NULL is permitted HardwareIndexMin Hardware index of channel number = 0 HardwareIndexMax Hardware index of max channel number
- Returns:
- Error code. If there is no error, the return value is 0
- Description
- This function is called from the internal of "R_DRIVER_Initialize" function or "R_DRIVER_LockChannel" function. This function calls "R_BSP_HardwareLock".
void R_OSPL_MEMORY_Barrier | ( | void | ) |
static bool_t R_OSPL_OnRaisingError_Sub | ( | const char_t *const | FilePath, |
int_fast32_t const | LineNum | ||
) | [static] |
bool_t R_OSPL_OnRaisingErrorForMISRA | ( | bool_t const | Condition, |
const char_t *const | File, | ||
int_t const | Line | ||
) |
void R_OSPL_SET_DEBUG_WORK | ( | void * | WorkArea, |
uint32_t | WorkAreaSize | ||
) |
Set the debug work area.
- Parameters:
-
WorkArea Start address of work area WorkAreaSize Size of work area (byte). See. <R_OSPL_DEBUG_WORK_SIZE>
- Returns:
- None
- Description
- This function does nothing, if "R_OSPL_ERROR_BREAK" macro was defined to be 0. The following descriptions are available, if "R_OSPL_ERROR_BREAK" macro was defined to be 1.
Set the debug work area, when "R_OSPL_SET_BREAK_ERROR_ID" function supports multi thread. "E_NO_DEBUG_TLS" error is raised, if the debug work area was not set, when errors was raised in 2 or more threads. It is not necessary to call this function, if error handling did by one thread only.
- Example
#if R_OSPL_ERROR_BREAK #define GS_MAX_THREAD 10 static uint8_t gs_DebugWorkArea[ R_OSPL_DEBUG_WORK_SIZE( GS_MAX_THREAD ) ]; #endif R_OSPL_SET_DEBUG_WORK( gs_DebugWorkArea, sizeof(gs_DebugWorkArea) );
void R_OSPL_SetErrNum | ( | errnum_t const | e ) |
Sets an error code to TLS (Thread Local Storage).
- Parameters:
-
e Raising error code
- Returns:
- None
- Description
- Usually error code is returned. If API function cannot return any error code, API function can have the specification of setting error code by "R_OSPL_SetErrNum".
There is this function, if "R_OSPL_TLS_ERROR_CODE" macro was defined to be 1. This function does nothing, if any error code was stored already in TLS. The state does not change to error state, if "R_OSPL_SetErrNum" function was called only. See "R_OSPL_GET_ERROR_ID".
void R_OSPL_TABLE_Free | ( | r_ospl_table_t *const | self, |
const void *const | Key | ||
) |
errnum_t R_OSPL_TABLE_GetIndex | ( | r_ospl_table_t *const | self, |
const void *const | Key, | ||
int_fast32_t *const | out_Index, | ||
r_ospl_if_not_t const | TypeOfIfNot | ||
) |
void R_OSPL_TABLE_InitConst | ( | r_ospl_table_t *const | self, |
void *const | Area, | ||
size_t const | AreaByteSize, | ||
bool_t const | Is_T_Lock | ||
) |
void R_OSPL_TABLE_Print | ( | r_ospl_table_t *const | self ) |
errnum_t R_OSPL_UnlockChannel | ( | int_fast32_t | ChannelNum, |
errnum_t | e, | ||
mcu_lock_t | HardwareIndexMin, | ||
mcu_lock_t | HardwareIndexMax | ||
) |
Unlocks by channel number.
- Parameters:
-
ChannelNum Channel number e Raising error code, If there is no error, 0 HardwareIndexMin Hardware index of channel number = 0 HardwareIndexMax Hardware index of max channel number
- Returns:
- Error code. If there is no error, the return value is 0
- Description
- This function is called from the internal of "R_DRIVER_Finalize" function or "R_DRIVER_UnlockChannel" function. This function calls "R_BSP_HardwareUnlock".
Variable Documentation
r_ospl_error_t gs_error [static] |
r_ospl_global_error_t gs_global_error [static] |
{ { gs_thread_index_table_body, 0, R_OSPL_DEFAULT_DEBUG_THREAD_COUNT, NULL, 0, 0, #if R_OSPL_IS_PREEMPTION true #endif }, &gs_error, #if R_OSPL_ERROR_BREAK 0, 0 #endif }
as <r_ospl_global_error_t>
r_ospl_table_block_t gs_thread_index_table_body[R_OSPL_DEFAULT_DEBUG_THREAD_COUNT] [static] |
Generated on Tue Jul 12 2022 11:15:06 by 1.7.2