lib/iec_types.h
changeset 59 37ba6f9e51e2
child 137 9ceda59abd27
equal deleted inserted replaced
58:273d6d5cec9d 59:37ba6f9e51e2
       
     1 #include <limits.h>
       
     2 #include <float.h>
       
     3 #include <time.h>
       
     4 #include <stdint.h>
       
     5 
       
     6 /*********************/
       
     7 /*  IEC Types defs   */
       
     8 /*********************/
       
     9 
       
    10 typedef uint8_t  IEC_BOOL;
       
    11 
       
    12 typedef int8_t    IEC_SINT;
       
    13 typedef int16_t   IEC_INT;
       
    14 typedef int32_t   IEC_DINT;
       
    15 typedef int64_t   IEC_LINT;
       
    16 
       
    17 typedef uint8_t    IEC_USINT;
       
    18 typedef uint16_t   IEC_UINT;
       
    19 typedef uint32_t   IEC_UDINT;
       
    20 typedef uint64_t   IEC_ULINT;
       
    21 
       
    22 typedef uint8_t    IEC_BYTE;
       
    23 typedef uint16_t   IEC_WORD;
       
    24 typedef uint32_t   IEC_DWORD;
       
    25 typedef uint64_t   IEC_LWORD;
       
    26 
       
    27 typedef float    IEC_REAL;
       
    28 typedef double   IEC_LREAL;
       
    29 
       
    30 
       
    31 #if !defined __timespec_defined
       
    32 # define __timespec_defined     1
       
    33 
       
    34 struct timespec
       
    35   {
       
    36     long int tv_sec;            /* Seconds.  */
       
    37     long int tv_nsec;           /* Nanoseconds.  */
       
    38   };
       
    39 
       
    40 #endif
       
    41 
       
    42 typedef struct timespec IEC_TIME;
       
    43 typedef struct timespec IEC_DATE;
       
    44 typedef struct timespec IEC_DT;
       
    45 typedef struct timespec IEC_TOD;
       
    46 
       
    47 #define STR_MAX_LEN 40
       
    48 typedef int8_t __strlen_t;
       
    49 typedef struct {
       
    50     __strlen_t len;
       
    51     uint8_t body[STR_MAX_LEN];
       
    52 } IEC_STRING;
       
    53