Command disabled: backlink
 
Available Languages?:

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 OS_ENABLE_CSEM constant is defined in OSAcfg.h.

Redefining

You can redefine this type by changing the size of CSEM in file OSAcfg.h:

#define OS_CSEM_SIZE    4

Allowed values of OS_CSEM_SIZE:

1 OST_UINT8 (0..2^8-1)
2 OST_UINT16 (0..2^16-1)
4 OST_UINT32 (0..2^32-1)

OST_FLAG

Bit fields.

Definition

typedef OST_UINT8   OST_FLAG;
typedef OST_UINT16  OST_FLAG16;
typedef OST_UINT32  OST_FLAG32;

Redefining

Unavailable.


OST_MSG

Pointer to message.

Definition

typedef void * OST_MSG;

Redefining

You can redefine this type by defining the OS_MSG_TYPE constant in 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).


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 OST_MSG by defining it manually in OSAcfg.h.


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 (OS_Timer) how to handle this timer (is it running or stopped, is it active, is there a subsequent timer in the list):

Flags Timer's state flags (see OST_DTIMER_FLAGS)
Next Pointer to next timer in list of active timers
Timer Counter. Size of counter is set by OS_DTIMER_SIZE constant (default = 2)

Redefining

You can only redefine the counter's size constant OS_DTIMER_SIZE in OSAcfg.h:

#define OS_DTIMER_SIZE       4

Allowed values of OS_DTIMER_SIZE:

1 OST_UINT8 (0..2^8-1)
2 OST_UINT16 (0..2^16-1)
4 OST_UINT32 (0..2^32-1)

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 (OS_Timer) how to handle this timer (is it running or stopped, is it active, is there a subsequent timer in the list):

Flags Timer's state flags (see OST_QTIMER_FLAGS)
Next Pointer to next timer in list of active timers
Timer Counter. Size of counter is set by OS_QTIMER_SIZE constant (default = 2)

Redefining

You can only redefine the counter's size constant OS_QTIMER_SIZE in OSAcfg.h:

#define OS_QTIMER_SIZE       4

Allowed values of OS_QTIMER_SIZE:

1 OST_UINT8 (0..2^8-1)
2 OST_UINT16 (0..2^16-1)
4 OST_UINT32 (0..2^32-1)

OST_QUEUE

Queue of pointers to messages.

Definition

typedef struct {
    OST_QUEUE_CONTROL Q;
    OST_MSG *pMsg;
} OST_QUEUE;

Q - queue control block.
pMsg - pointer to buffer where pointers to message will be stored.

Redefining

You can only redefine the type of OST_MSG.


OST_SQUEUE

Queue of simple messages.

Definition

typedef struct {
    OST_QUEUE_CONTROL Q;
    OST_SMSG *pSMsg;
} OST_SQUEUE;

Q - queue control block.
pSMsg - pointer to buffer where simple message will be stored.

Redefining

You can only redefine the type of OST_SMSG.


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 OS_SMSG_TYPE constant in 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 OS_TASKS_BANK is used.

Redefining

Not allowed


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 OS_DTIMER_SIZE is not defined, then type is set to default value OS_TIMER_SIZE.

_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 OS_STIMER_SIZE is not defined, then type is set to default value OS_TIMER_SIZE.

_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 OS_TTIMER_SIZE is not defined, then type is set to default value OS_TIMER_SIZE.

_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 OS_QTIMER_SIZE is not defined, then type is set to default value OS_TIMER_SIZE.

 
en/osa/ref/description/data_types.txt · Last modified: 07.10.2010 13:58 (external edit)
 
Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki