WE310F5  39.00.000
m2mb_os.h File Reference

Basic functionality of Operating systems. More...

#include "m2mb_os_types.h"
#include "m2mb_os_ev.h"
#include "m2mb_os_mtx.h"
#include "m2mb_os_q.h"
#include "m2mb_os_sem.h"

Go to the source code of this file.

#define vspfunc(...)   (0)
 
#define uart_print(...)
 
#define M2MB_OS_TASK_INVALID   0
 
#define M2MB_OS_TASK_INVALID_ATTR   0
 
#define M2MB_OS_TASK_AUTOSTART   1
 
#define M2MB_OS_TASK_NOT_START   0
 
#define M2MB_OS_ISR_ON   1
 
#define M2MB_OS_ISR_OFF   0
 
#define M2MB_OS_MIN_STACK_SIZE   1024
 
#define M2MB_FS_CAT   ( (UINT32)0 )
 
#define M2MB_SMS_CAT   ( (UINT32)1 )
 
#define M2MB_GNSS_CAT   ( (UINT32)2 )
 
#define M2MB_OS_CAT   ( (UINT32)3 )
 
#define M2MB_OS_ENTER_CRITICAL()   do { __asm("cpsid i"); } while(0)
 
#define M2MB_OS_EXIT_CRITICAL()   do { __asm("cpsie i"); } while(0)
 
enum  M2MB_OS_TASK_SEL_CMD_E {
  M2MB_OS_TASK_SEL_CMD_CREATE_ATTR,
  M2MB_OS_TASK_SEL_CMD_DEL_ATTR,
  M2MB_OS_TASK_SEL_CMD_NAME,
  M2MB_OS_TASK_SEL_CMD_USRNAME,
  M2MB_OS_TASK_SEL_CMD_STACK_START,
  M2MB_OS_TASK_SEL_CMD_STACK_SIZE,
  M2MB_OS_TASK_SEL_CMD_PRIORITY,
  M2MB_OS_TASK_SEL_CMD_PREEMPTIONTH,
  M2MB_OS_TASK_SEL_CMD_TSLICE,
  M2MB_OS_TASK_SEL_CMD_AUTOSTART,
  M2MB_OS_TASK_SEL_CMD_STATE,
  M2MB_OS_TASK_SEL_CMD_RUN_CNT,
  M2MB_OS_TASK_SEL_CMD_END
}
 
enum  M2MB_OS_TASK_STATE_E {
  M2MB_OS_TASK_STATE_READY,
  M2MB_OS_TASK_STATE_COMPLETED,
  M2MB_OS_TASK_STATE_TERMINATED,
  M2MB_OS_TASK_STATE_SUSP,
  M2MB_OS_TASK_STATE_SLEEP,
  M2MB_OS_TASK_STATE_QUEUE_SUSP,
  M2MB_OS_TASK_STATE_SEMAPHORE_SUSP,
  M2MB_OS_TASK_STATE_SIG_SUSP,
  M2MB_OS_TASK_STATE_BLOCK_MEM_SUSP,
  M2MB_OS_TASK_STATE_BYTE_MEM_SUSP,
  M2MB_OS_TASK_STATE_MUTEX_SUSP = 0x0D,
  M2MB_OS_TASK_STATE_END
}
 
enum  M2MB_OS_MEMINFO_E {
  M2MB_OS_MEMINFO_FRAGMENTS,
  M2MB_OS_MEMINFO_BYTES_AVAILABLE,
  M2MB_OS_MEMINFO_SIZE,
  M2MB_OS_MEMINFO_END
}
 
typedef HANDLE M2MB_OS_TASK_HANDLE
 
typedef HANDLE M2MB_OS_TASK_ATTR_HANDLE
 
typedef void(* ENTRY_FN) (void *)
 
UINT32 M2MB_OS_MS2TICKS (UINT32 ms)
 
void * m2mb_os_malloc (UINT32 size)
 Allocates bytes of memory. More...
 
void * m2mb_os_calloc (UINT32 count, UINT32 size)
 Allocates bytes of memory and init space with 0. More...
 
void * m2mb_os_realloc (void *ptr, UINT32 size)
 
M2MB_OS_RESULT_E m2mb_os_free (void *pMem)
 Free allocated memory. More...
 
M2MB_OS_RESULT_E m2mb_os_init (void)
 Initialization of OS. More...
 
M2MB_OS_RESULT_E m2mb_os_taskCreate (M2MB_OS_TASK_HANDLE *pTaskHandle, M2MB_OS_TASK_ATTR_HANDLE *pTaskAttr, ENTRY_FN entryFn, void *pArg)
 Create application task. More...
 
M2MB_OS_RESULT_E m2mb_os_taskGetItem (M2MB_OS_TASK_HANDLE taskHandle, M2MB_OS_TASK_SEL_CMD_E selCmd, MEM_W *pOut, void *pIn)
 Get specific task properties. More...
 
M2MB_OS_RESULT_E m2mb_os_taskSetItem (M2MB_OS_TASK_HANDLE taskHandle, M2MB_OS_TASK_SEL_CMD_E selCmd, void *pIn)
 Set specific task properties. More...
 
M2MB_OS_RESULT_E m2mb_os_taskSetAttrItem (M2MB_OS_TASK_ATTR_HANDLE *pTaskAttrHandle, UINT8 nCmds,...)
 Set specific attribute for task creation. More...
 
M2MB_OS_TASK_HANDLE m2mb_os_taskGetId (void)
 Retrieves handle to the currently executing task. More...
 
M2MB_OS_RESULT_E m2mb_os_taskSuspend (M2MB_OS_TASK_HANDLE taskHandle)
 Suspend application task. More...
 
M2MB_OS_RESULT_E m2mb_os_taskResume (M2MB_OS_TASK_HANDLE taskHandle)
 Resume suspended application task. More...
 
M2MB_OS_RESULT_E m2mb_os_taskTerminate (M2MB_OS_TASK_HANDLE taskHandle)
 Terminates application task. More...
 
M2MB_OS_RESULT_E m2mb_os_taskRestart (M2MB_OS_TASK_HANDLE taskHandle)
 Task restart. More...
 
M2MB_OS_RESULT_E m2mb_os_taskDelete (M2MB_OS_TASK_HANDLE taskHandle)
 Task delete. More...
 
M2MB_OS_RESULT_E m2mb_os_taskCooperate (void)
 Make task to cooperate by releasing scheduler control. More...
 
M2MB_OS_RESULT_E m2mb_os_taskWaitAbort (M2MB_OS_TASK_HANDLE taskHandle)
 Abort suspension of a specified task. More...
 
UINT32 m2mb_os_getSysTicks (void)
 Get system time in ticks. More...
 
M2MB_OS_RESULT_E m2mb_os_setSysTicks (UINT32 newTick)
 Set start system time in ticks. More...
 
FLOAT32 m2mb_os_getSysTickDuration_ms (void)
 Get the duration of system tick in ms. More...
 
UINT8 m2mb_os_isrCtrl (UINT8 newIsrState)
 Enable and disable interrupts (ISRs) More...
 
M2MB_OS_RESULT_E m2mb_os_get_errno (UINT32 *pCategory, INT32 *pErrno)
 Allow to get Errno saved in a relative task environment. More...
 
int m2mb_thread_fp_enable (void)
 Sets the thread floating point unit flag. More...
 

Detailed Description

Basic functionality of Operating systems.

we866e4/epl/inc/rtos/m2mb_os.h

Majors task related functionalities are defined, plus some systems info and settings. For example system timer tick

Note
<Notes, dependencies mandatory> Dependencies:
"#include m2mb_types.h"
"#include m2mb_os_types.h"
"#include m2mb_platform_conf.h"
Author
Alessandro Papagno
Date
01/03/2017

Definition in file m2mb_os.h.