monoZ docs
MZ_sys_cmsis_os2.h File Reference

monoZ system CMSIS OS2 This is an abstraction layer and includes FreeRTOS configuration, here can create the App and can also migrate to different versions with user required changes. More...

#include "cmsis_os2.h"
#include "MZ_common.h"
#include "FreeRTOSConfig.h"
#include "projdefs.h"
#include "portmacro.h"
#include "FreeRTOS.h"
#include "timers.h"
#include "MZ_error_handler.h"

Go to the source code of this file.

Macros

#define MZ_SYS_CMSIS_OS2_H_
 Defines monoZ System CMSIS OS2. More...
 
#define CMSISOS2_INFINITE32   (0xFFFFFFFF)
 Defines address of CMISOS_INFINITE32. More...
 
#define SEMA_TIMEOUT   (CMSISOS2_INFINITE32)
 Defines SEMA_TIMEOUT. More...
 
#define MAILBOX_TIMEOUT   (CMSISOS2_INFINITE32)
 Defines MAILBOX_TIMEOUT. More...
 
#define DEFAULT_STACK_SIZE   (256)
 Defines size of the DEFAULT STACK. More...
 

Typedefs

typedef osMutexId_t mz_mutex_t
 mz_mutex_t variable of type osMutexId_t More...
 
typedef osSemaphoreId_t mz_semaphore_t
 mz_semaphore_t variable of type osSemaphoreId_t More...
 
typedef osMessageQueueId_t mz_mailbox_t
 mz_mailbox_t variable of type osMessageQueueId_t More...
 
typedef osThreadId_t mz_thread_t
 mz_thread_t variable of type osThreadId_t More...
 
typedef osPriority_t mz_thread_prio_t
 mz_thread_prio_t variable of type osPriority_t More...
 
typedef TimerHandle_t mz_timer_t
 mz_timer_t variable of type TimerHandle_t More...
 
typedef TimerCallbackFunction_t mz_timer_fp
 mz_timer_fp variable of type TimerCallbackFunction_t More...
 

Functions

uint32_t mz_sys_now (void)
 This function returns the RTOS system timer count as 32 bit value. More...
 
uint8_t mz_mutex_create (mz_mutex_t *c)
 This function is used to create and initialize the mutex object Create and Initialize a Mutex object. More...
 
uint8_t mz_mutex_lock (mz_mutex_t *c)
 This function is used to acquire the mutex or timeout if it is locked Acquire a Mutex or timeout if it is locked. More...
 
uint8_t mz_mutex_unlock (mz_mutex_t *c)
 This function is used to release the mutex Release a Mutex that was acquired by. More...
 
uint8_t mz_mutex_delete (mz_mutex_t *c)
 This function is used to delete the mutex object Delete a Mutex object. More...
 
uint8_t mz_mutex_isvalid (mz_mutex_t *c)
 This function is used to check the mutex object validity Check the Mutex Object Validation. More...
 
uint8_t mz_mutex_invalid (mz_mutex_t *c)
 This function is used to invalidate the created mutex object Mutex Object created is invalid. More...
 
uint8_t mz_sem_create (mz_semaphore_t *c, uint8_t cnt, uint8_t init)
 This function is used to create and initialize the semaphore object Create and Initialize a Semaphore object. More...
 
uint8_t mz_sem_delete (mz_semaphore_t *c)
 This function is used to delete a semaphore object Delete a Semaphore object. More...
 
uint32_t mz_sem_wait (mz_semaphore_t *c, uint32_t timeout)
 This function is used to acquire a semaphore token or timout if no tokens are available Acquire a Semaphore token or timeout if no tokens are available. More...
 
uint8_t mz_sem_release (mz_semaphore_t *c)
 This function is used to acquire a semaphore token or timout if no tokens are available Release a Semaphore token up to the initial maximum count. More...
 
uint8_t mz_sem_isvalid (mz_semaphore_t *c)
 This functiion is used to check the semaphore object validity Check the Semaphore object validation. More...
 
uint8_t mz_sem_invalid (mz_semaphore_t *c)
 This function is used to invalidate the created semaphore Semaphore object is invalid. More...
 
uint8_t mz_mailbox_create (mz_mailbox_t *c, size_t no_of_mail, size_t mail_size)
 This function is used to create and initialize the message queue object Create and initialize a message queue object. More...
 
uint8_t mz_mailbox_delete (mz_mailbox_t *c)
 This function is used to delete the message queue object Delete message queue object. More...
 
mz_error_t mz_mailbox_put (mz_mailbox_t *c, void *m)
 This function is used to put a message into the queue or timeout if queue is full Put a message into a queue or timeout if queue is full. More...
 
mz_error_t mz_mailbox_get (mz_mailbox_t *c, void *m, uint32_t timeout)
 This function is used to put a message into the queue or timeout if queue is full Get a message from a queue or timeout if queue is empty. More...
 
mz_error_t mz_mailbox_putnow (mz_mailbox_t *c, void *m)
 This function is used to put a message now into the queue or timeout if queue is full Put a message into a queue or timeout if queue is full. More...
 
mz_error_t mz_mailbox_getnow (mz_mailbox_t *c, void *m)
 This function is used to get the message now from the queue or timeout if queue is empty Get a message from a queue or timeout if queue is empty. More...
 
uint8_t mz_mailbox_isvalid (mz_mailbox_t *c)
 This function is used to check the message queue object validity Check the message queue object validation. More...
 
uint8_t mz_mailbox_invalid (mz_mailbox_t *c)
 This function is used to check the message queue object validity Message queue object is invalid. More...
 
uint8_t mz_thread_create (mz_thread_t *t, const char *name, mz_fn thread_func, void *const arg, mz_thread_prio_t prio, StackType_t *stack_mem, size_t stack_size, StaticTask_t *cb_mem, uint32_t cb_size)
 This function is used to check the message queue object validity Create a thread and add it to Active Threads. More...
 
uint8_t mz_thread_terminate (mz_thread_t *t)
 This function is used to terminate the execution of thread Terminate the execution of thread. More...
 
uint8_t mz_thread_yield (void)
 This function is used to pass control to the next thread that is in ready state. More...
 
void * mz_malloc (size_t size)
 This function is used to allocate and map the required memory. More...
 
void mz_free (void *_ptr)
 This function is used to free the mapped memory Map to the memory management routines required for the port. More...
 

Detailed Description

monoZ system CMSIS OS2 This is an abstraction layer and includes FreeRTOS configuration, here can create the App and can also migrate to different versions with user required changes.

Author
SKM
Date
Mar 16 2021

Definition in file MZ_sys_cmsis_os2.h.

Macro Definition Documentation

◆ MZ_SYS_CMSIS_OS2_H_

#define MZ_SYS_CMSIS_OS2_H_

Defines monoZ System CMSIS OS2.

Definition at line 22 of file MZ_sys_cmsis_os2.h.

◆ CMSISOS2_INFINITE32

#define CMSISOS2_INFINITE32   (0xFFFFFFFF)

Defines address of CMISOS_INFINITE32.

Definition at line 27 of file MZ_sys_cmsis_os2.h.

◆ SEMA_TIMEOUT

#define SEMA_TIMEOUT   (CMSISOS2_INFINITE32)

Defines SEMA_TIMEOUT.

Definition at line 29 of file MZ_sys_cmsis_os2.h.

◆ MAILBOX_TIMEOUT

#define MAILBOX_TIMEOUT   (CMSISOS2_INFINITE32)

Defines MAILBOX_TIMEOUT.

Definition at line 31 of file MZ_sys_cmsis_os2.h.

◆ DEFAULT_STACK_SIZE

#define DEFAULT_STACK_SIZE   (256)

Defines size of the DEFAULT STACK.

Definition at line 33 of file MZ_sys_cmsis_os2.h.

Typedef Documentation

◆ mz_mutex_t

typedef osMutexId_t mz_mutex_t

mz_mutex_t variable of type osMutexId_t

Definition at line 37 of file MZ_sys_cmsis_os2.h.

◆ mz_semaphore_t

typedef osSemaphoreId_t mz_semaphore_t

mz_semaphore_t variable of type osSemaphoreId_t

Definition at line 39 of file MZ_sys_cmsis_os2.h.

◆ mz_mailbox_t

typedef osMessageQueueId_t mz_mailbox_t

mz_mailbox_t variable of type osMessageQueueId_t

Definition at line 41 of file MZ_sys_cmsis_os2.h.

◆ mz_thread_t

typedef osThreadId_t mz_thread_t

mz_thread_t variable of type osThreadId_t

Definition at line 43 of file MZ_sys_cmsis_os2.h.

◆ mz_thread_prio_t

typedef osPriority_t mz_thread_prio_t

mz_thread_prio_t variable of type osPriority_t

Definition at line 45 of file MZ_sys_cmsis_os2.h.

◆ mz_timer_t

typedef TimerHandle_t mz_timer_t

mz_timer_t variable of type TimerHandle_t

Definition at line 47 of file MZ_sys_cmsis_os2.h.

◆ mz_timer_fp

typedef TimerCallbackFunction_t mz_timer_fp

mz_timer_fp variable of type TimerCallbackFunction_t

Definition at line 49 of file MZ_sys_cmsis_os2.h.