summaryrefslogtreecommitdiff
path: root/AT91SAM7S256/Source/c_input.iom
blob: 8d651b880607538a0603474b8a865ae1c6118242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//
// Date init       14.12.2004
//
// Revision date   $Date:: 16-05-06 10:06                                    $
//
// Filename        $Workfile:: c_input.iom                                   $
//
// Version         $Revision:: 15                                            $
//
// Archive         $Archive:: /LMS2006/Sys01/Main/Firmware/Source/c_input.io $
//
// Platform        C
//

#ifndef   CINPUT_IOM
#define   CINPUT_IOM

#define   NO_OF_INPUTS     4
#define   pMapInput        ((IOMAPINPUT*)(pHeaders[ENTRY_INPUT]->pIOMap))


/* Constants related to sensor type  */
enum
{
  NO_SENSOR           = 0,
  SWITCH              = 1,
  TEMPERATURE         = 2,
  REFLECTION          = 3,
  ANGLE               = 4,
  LIGHT_ACTIVE        = 5,
  LIGHT_INACTIVE      = 6,
  SOUND_DB            = 7,
  SOUND_DBA           = 8,
  CUSTOM              = 9,
  LOWSPEED            = 10,
  LOWSPEED_9V         = 11,
  HIGHSPEED           = 12,
  NO_OF_SENSOR_TYPES  = 13
};

/* Constants related to sensor mode */
enum
{
  RAWMODE           = 0x00,
  BOOLEANMODE       = 0x20,
  TRANSITIONCNTMODE = 0x40,
  PERIODCOUNTERMODE = 0x60,
  PCTFULLSCALEMODE  = 0x80,
  CELSIUSMODE       = 0xA0,
  FAHRENHEITMODE    = 0xC0,
  ANGLESTEPSMODE    = 0xE0,
  SLOPEMASK         = 0x1F,
  MODEMASK          = 0xE0
};

/* Constants related to Digital I/O */
enum
{
  DIGI0             = 1,
  DIGI1             = 2
};

enum
{
  CUSTOMINACTIVE    = 0x00,
  CUSTOM9V          = 0x01,
  CUSTOMACTIVE      = 0x02
};

enum
{
  INVALID_DATA   = 0x01
};

typedef   struct
{
  UWORD   CustomZeroOffset;    /* Set the offset of the custom sensor                          */
  UWORD   ADRaw;
  UWORD   SensorRaw;
  SWORD   SensorValue;

  UBYTE   SensorType;
  UBYTE   SensorMode;
  UBYTE   SensorBoolean;

  UBYTE   DigiPinsDir;         /* Direction of the Digital pins 1 is output 0 is input         */
  UBYTE   DigiPinsIn;          /* Contains the status of the digital pins                      */
  UBYTE   DigiPinsOut;         /* Sets the output level of the digital pins                    */
  UBYTE   CustomPctFullScale;  /* Sets the Pct full scale of the custom sensor                 */
  UBYTE   CustomActiveStatus;  /* Sets the active or inactive state of the custom sensor       */

  UBYTE   InvalidData;         /* Indicates wether data is invalid (1) or valid (0)            */
  
  UBYTE   Spare1;
  UBYTE   Spare2;
  UBYTE   Spare3;

}INPUT;


typedef   struct
{
  INPUT   Inputs[NO_OF_INPUTS];
}IOMAPINPUT;

#endif