====== OSA : Data types ====== ===== System ===== ==== OST_UINT8 ==== Platform independent unsigned 8-bit integer. ==== OST_UINT16 ==== Platform independent unsigned 16-bit integer. ==== OST_UINT32 ==== Platform independent unsigned 32-bit integer. ==== OST_WORD ==== Platform dependent unsigned integer. Has width of controller's data bus. ===== Common ===== ==== OST_CSEM ==== Counting semaphore type. === Definition === typedef OST_UINT8 OST_CSEM; This type is available only when the ##[[en:osa:ref:appendix:configuration|OS_ENABLE_CSEM]]## constant is defined in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##. === Redefining === You can redefine this type by changing the size of CSEM in file ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##: #define OS_CSEM_SIZE 4 Allowed values of ##[[en:osa:ref:appendix:configuration|OS_CSEM_SIZE]]##: {|class = "fpl" |1 |##[[en:osa:ref:description:data_types#OST_UINT8|OST_UINT8]]## (0..2^8-1) |- |2 |##[[en:osa:ref:description:data_types#OST_UINT16|OST_UINT16]]## (0..2^16-1) |- |4 |##[[en:osa:ref:description:data_types#OST_UINT32|OST_UINT32]]## (0..2^32-1) |} ~~UP~~ ---- ==== OST_FLAG ==== Bit fields. === Definition === typedef OST_UINT8 OST_FLAG; typedef OST_UINT16 OST_FLAG16; typedef OST_UINT32 OST_FLAG32; === Redefining === Unavailable. ~~UP~~ ---- ==== OST_MSG ==== Pointer to message. === Definition === typedef void * OST_MSG; === Redefining === You can redefine this type by defining the ##[[en:osa:ref:appendix:configuration|OS_MSG_TYPE]]## constant in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##. For example: typedef stuct { char * Name; char Age; } MyType; #define OS_MSG_TYPE MyType * Allowed: all types (for example **const char * ** - pointer to ROM). ~~UP~~ ---- ==== OST_MSG_CB ==== Descriptor of pointer to message. Contains pointer to message and message's state flag (free/busy). === Definition === typedef struct { char status; // Message's state flag (=0 - free, =1 - busy) OST_MSG msg; // Pointer to message body } OST_MSG_CB; === Redefining === You can only redefine the pointer to message type ##[[en:osa:ref:description:data_types#OST_MSG|OST_MSG]]## by defining it manually in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##. ~~UP~~ ---- ==== OST_DTIMER ==== Dynamic timer. === Definition === typedef struct { OST_DTIMER_FLAGS Flags; void * Next; _OST_DTIMER Timer; // Timer's counter } OST_DTIMER; State flags are used to tell the timer routine (##[[en:osa:ref:allservices:OS_Timer|OS_Timer]]##) how to handle this timer (is it running or stopped, is it active, is there a subsequent timer in the list): {|class = "fpl" |- |//Flags// |Timer's state flags (see ##[[en:osa:ref:description:data_types#OST_DTIMER_FLAGS|OST_DTIMER_FLAGS]]##) |- |//Next// |Pointer to next timer in list of active timers |- |//Timer// |Counter. Size of counter is set by ##[[en:osa:ref:appendix:configuration#Data types|OS_DTIMER_SIZE]]## constant (default = 2) |} === Redefining === You can only redefine the counter's size constant ##[[en:osa:ref:appendix:configuration#Data types|OS_DTIMER_SIZE]]## in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##: #define OS_DTIMER_SIZE 4 Allowed values of ##[[en:osa:ref:appendix:configuration#Data types|OS_DTIMER_SIZE]]##: {|class = "fpl" |1 |##[[en:osa:ref:description:data_types#OST_UINT8|OST_UINT8]]## (0..2^8-1) |- |2 |##[[en:osa:ref:description:data_types#OST_UINT16|OST_UINT16]]## (0..2^16-1) |- |4 |##[[en:osa:ref:description:data_types#OST_UINT32|OST_UINT32]]## (0..2^32-1) |} ~~UP~~ ---- ==== OST_QTIMER ==== Timer in queue of timers. === Definition === typedef struct { OST_QTIMER_FLAGS Flags; void * Next; _OST_QTIMER Timer; // Timer's counter } OST_QTIMER; State flags are used to tell the timer routine (##[[en:osa:ref:allservices:OS_Timer|OS_Timer]]##) how to handle this timer (is it running or stopped, is it active, is there a subsequent timer in the list): {|class = "fpl" |- |//Flags// |Timer's state flags (see ##[[en:osa:ref:description:data_types#OST_QTIMER_FLAGS|OST_QTIMER_FLAGS]]##) |- |//Next// |Pointer to next timer in list of active timers |- |//Timer// |Counter. Size of counter is set by ##[[en:osa:ref:appendix:configuration#Data types|OS_QTIMER_SIZE]]## constant (default = 2) |} === Redefining === You can only redefine the counter's size constant ##[[en:osa:ref:appendix:configuration#Data types|OS_QTIMER_SIZE]]## in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##: #define OS_QTIMER_SIZE 4 Allowed values of ##[[en:osa:ref:appendix:configuration#Data types|OS_QTIMER_SIZE]]##: {|class = "fpl" |1 |##[[en:osa:ref:description:data_types#OST_UINT8|OST_UINT8]]## (0..2^8-1) |- |2 |##[[en:osa:ref:description:data_types#OST_UINT16|OST_UINT16]]## (0..2^16-1) |- |4 |##[[en:osa:ref:description:data_types#OST_UINT32|OST_UINT32]]## (0..2^32-1) |} ~~UP~~ ---- ==== OST_QUEUE ==== Queue of pointers to messages. === Definition === typedef struct { OST_QUEUE_CONTROL Q; OST_MSG *pMsg; } OST_QUEUE; ##Q## - [[en:osa:ref:description:data_types#OST_QUEUE_CONTROL|queue control block]].\\ ##pMsg## - pointer to buffer where pointers to message will be stored. === Redefining === You can only redefine the type of ##[[en:osa:ref:description:data_types#OST_MSG|OST_MSG]]##. ~~UP~~ ---- ==== OST_SQUEUE ==== Queue of simple messages. === Definition === typedef struct { OST_QUEUE_CONTROL Q; OST_SMSG *pSMsg; } OST_SQUEUE; ##Q## - [[en:osa:ref:description:data_types#OST_QUEUE_CONTROL|queue control block]].\\ ##pSMsg## - pointer to buffer where simple message will be stored. === Redefining === You can only redefine the type of ##[[en:osa:ref:description:data_types#OST_SMSG|OST_SMSG]]##. ~~UP~~ ---- ==== OST_SMSG ==== Simple byte message. Used to reduce RAM usage when there is no need to use pointers to messages. === Definition === typedef OST_UINT8 OST_SMSG; === Redefining === You can redefine this type by defining the ##[[en:osa:ref:appendix:configuration|OS_SMSG_TYPE]]## constant in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##. For example: #define OS_SMSG_TYPE unsigned long Allowed: any counting type. You should bear in mind that the simple message type does not have a separate flag indicating the busy state. This state is indicated by the message's body: if the simple message is zero, then it is free, otherwise it is busy. Thus you may exchange only non-zero simple messages between tasks. ==== OST_TASK_POINTER ==== Variables of this type are used to control tasks from anywhere in the program. Task descriptors are not accessible directly, so these variables are used to access task descriptors via pointers. === Definition === typedef OS_TASKS_BANK OST_TCB * OST_TASK_POINTER; Note that prefix ##[[en:osa:ref:appendix:configuration|OS_TASKS_BANK]]## is used. === Redefining === Not allowed ~~UP~~ ---- ===== Timer counters ===== ==== _OST_DTIMER ==== Type of dynamic timer's counter. === Definition === #if OS_DTIMER_SIZE == 1 #define _OST_DTIMER OST_UINT8 #elif OS_DTIMER_SIZE == 2 #define _OST_DTIMER OST_UINT16 #elif OS_DTIMER_SIZE == 4 #define _OST_DTIMER OST_UINT32 #endif If the constant ##[[en:osa:ref:appendix:configuration|OS_DTIMER_SIZE]]## is not defined, then type is set to default value ##[[en:osa:ref:appendix:configuration|OS_TIMER_SIZE.]]## ~~UP~~ ==== _OST_STIMER ==== Type of static timer's counter. === Definition === #if OS_STIMER_SIZE == 1 #define _OST_STIMER OST_UINT8 #elif OS_STIMER_SIZE == 2 #define _OST_STIMER OST_UINT16 #elif OS_STIMER_SIZE == 4 #define _OST_STIMER OST_UINT32 #endif If the constant ##[[en:osa:ref:appendix:configuration|OS_STIMER_SIZE]]## is not defined, then type is set to default value ##[[en:osa:ref:appendix:configuration|OS_TIMER_SIZE.]]## ~~UP~~ ==== _OST_TTIMER ==== Type of task timer's counter. === Definition === #if OS_TTIMER_SIZE == 1 #define _OST_TTIMER OST_UINT8 #elif OS_TTIMER_SIZE == 2 #define _OST_TTIMER OST_UINT16 #elif OS_TTIMER_SIZE == 4 #define _OST_TTIMER OST_UINT32 #endif If the constant ##[[en:osa:ref:appendix:configuration|OS_TTIMER_SIZE]]## is not defined, then type is set to default value ##[[en:osa:ref:appendix:configuration|OS_TIMER_SIZE.]]## ~~UP~~ ==== _OST_QTIMER ==== Type of queue timer's counter. === Definition === #if OS_QTIMER_SIZE == 1 #define _OST_QTIMER OST_UINT8 #elif OS_QTIMER_SIZE == 2 #define _OST_QTIMER OST_UINT16 #elif OS_QTIMER_SIZE == 4 #define _OST_QTIMER OST_UINT32 #endif If the constant ##[[en:osa:ref:appendix:configuration|OS_QTIMER_SIZE]]## is not defined, then type is set to default value ##[[en:osa:ref:appendix:configuration|OS_TIMER_SIZE.]]## ~~UP~~