Rev 167 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 167 | Rev 316 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | /* |
1 | /* |
| 2 | * Defines functs, funccs and other global definitions |
2 | * Defines functs, funccs and other global definitions |
| 3 | * This is the one for eqnet |
3 | * This is the one for eqnet :) |
| 4 | * |
4 | * |
| - | 5 | * IDENT: <CLASS><TYPE><SID> DATA: <data7>...<data0> |
|
| - | 6 | * |
|
| - | 7 | * <CLASS>, 4 bits = Function type. |
|
| - | 8 | * <TYPE>, 17 bits = Function code. |
|
| - | 9 | * <SID>, 8 bits = Sender ID. |
|
| - | 10 | */ |
|
| - | 11 | ||
| - | 12 | ||
| - | 13 | /* Definitions for masking */ |
|
| - | 14 | #define CLASS_MASK 0x1E000000L /* bit[28..25] */ |
|
| - | 15 | #define TYPE_MASK 0x01FFFF00L /* bit[24..8] */ |
|
| - | 16 | #define SID_MASK 0x000000FFL /* bit[7..0] */ |
|
| - | 17 | ||
| - | 18 | #define CLASS_MASK_BITS 25 |
|
| - | 19 | #define TYPE_MASK_BITS 8 |
|
| - | 20 | #define SID_MASK_BITS 0 |
|
| - | 21 | ||
| - | 22 | /************************************************************** |
|
| - | 23 | * <CLASS> 4 bits 0xFL |
|
| - | 24 | *************************************************************/ |
|
| - | 25 | #define CLASS_SNS 0x4L |
|
| - | 26 | #define CLASS_ACT 0x5L |
|
| - | 27 | ||
| - | 28 | /**************************************************************** |
|
| - | 29 | * <TYPE> 17 bits 0x1FFFFL |
|
| - | 30 | ***************************************************************/ |
|
| - | 31 | ||
| - | 32 | /* SNS: Sensor data */ |
|
| - | 33 | ||
| - | 34 | /* <SNS_TYPE><SNS_ID> |
|
| - | 35 | * |
|
| - | 36 | * <SNS_TYPE>, 8 bits = Sensor type. |
|
| - | 37 | * <SNS_ID>, 9 bits = Sensor ID. Ex outdoor ds18s20, NodeRelay tc1047. |
|
| - | 38 | */ |
|
| - | 39 | /* SNS masking */ |
|
| - | 40 | #define SNS_TYPE_MASK 0x1FE00L /* bit[16..9] */ |
|
| - | 41 | #define SNS_ID_MASK 0x001FFL /* bit[8..0] */ |
|
| - | 42 | ||
| - | 43 | #define SNS_TYPE_BITS 9 |
|
| - | 44 | #define SNS_ID_BITS 0 |
|
| - | 45 | ||
| - | 46 | /* <SNS_TYPE> 8 bits 0xFFL */ |
|
| - | 47 | #define SNS_TEMP_DS18S20 0x08L |
|
| - | 48 | #define SNS_TEMP_TC1047 0x09L |
|
| - | 49 | #define SNS_IR_RECIEVE 0x0AL |
|
| - | 50 | #define SNS_ACT_STATUS_RELAY 0x0BL |
|
| - | 51 | #define SNS_ACT_STATUS_SERVO 0x0CL |
|
| - | 52 | #define SNS_ACT_STATUS_DIMMER 0x0DL |
|
| - | 53 | ||
| - | 54 | /* <SNS_ID> 9 bits 0x1FFL */ |
|
| - | 55 | //idn för alla sensorer |
|
| - | 56 | ||
| - | 57 | /* ACT: Actuator data */ |
|
| - | 58 | ||
| - | 59 | /* <ACT_TYPE><GROUP><NODE> |
|
| - | 60 | * |
|
| - | 61 | * <ACT_TYPE>, 5 bits = Actuator type, relay, dimmer etc. |
|
| - | 62 | * <GROUP>, 4 bits = To adress larger groups of actuators. |
|
| - | 63 | * <NODE>, 8 bits = Specific node. |
|
| 5 | */ |
64 | */ |
| - | 65 | /* ACT masking */ |
|
| - | 66 | #define ACT_TYPE_MASK 0x1F000L /* bit[16..12] */ |
|
| - | 67 | #define ACT_GROUP_MASK 0x00F00L /* bit[11..8] */ |
|
| - | 68 | #define ACT_NODE_MASK 0x000FFL /* bit[7..0] */ |
|
| - | 69 | ||
| - | 70 | #define ACT_TYPE_BITS 12 |
|
| - | 71 | #define ACT_GROUP_BITS 8 |
|
| - | 72 | #define ACT_NODE_BITS 0 |
|
| - | 73 | ||
| - | 74 | /* <ACT_TYPE> 5 bits 0x1FL */ |
|
| - | 75 | #define ACT_TYPE_RELAY 0x01L |
|
| - | 76 | #define ACT_TYPE_DIMMER 0x02L |
|
| - | 77 | #define ACT_TYPE_SERVO 0x03L |
|
| - | 78 | #define ACT_TYPE_LCD 0x04L |
|
| - | 79 | #define ACT_TYPE_IRTRANS 0x05L |
|
| - | 80 | ||
| - | 81 | ||
| - | 82 | /************************************************************* |
|
| - | 83 | * <SID> 8 bits 0xFFL |
|
| - | 84 | ************************************************************/ |
|
| - | 85 | ||
| - | 86 | ||
| - | 87 | //////////////////////////////////////////////////////////// |
|
| - | 88 | ||
| 6 | 89 | ||
| 7 | /* TODO temporary FUNCT, NID (until global_funcdefs.h is fixed) */ |
- | |
| 8 | #define FUNCT_SENSORS 0x01 |
- | |
| 9 | #define NID 0x05 |
- | |
| 10 | #define FUNCC_DEFAULT 0x00 |
- | |
| 11 | 90 | ||
| 12 | /* <FUNCC> 10 bits, 0x3FF */ |
- | |
| 13 | #define FUNCC_SENSORS_IR 0x001 |
- | |
| 14 | - | ||
| 15 | #define FUNCC_SENSORS_TEMPERATURE_INSIDE 0x002 |
- | |
| 16 | #define FUNCC_SENSORS_TEMPERATURE_OUTSIDE 0x003 |
- | |
| 17 | #define FUNCC_SENSORS_TEMPERATURE_FREEZER 0x004 |
- | |
| 18 | #define FUNCC_SENSORS_TEMPERATURE_REFRIGERATOR 0x005 |
- | |
| 19 | 91 | ||
| 20 | /* LCD: strings */ |
92 | /* LCD: strings */ |
| 21 | #define LCD_SENSOR_TEMPERATURE_INSIDE "Inne " |
93 | #define LCD_SENSOR_TEMPERATURE_INSIDE "Inne " |
| 22 | #define LCD_SENSOR_TEMPERATURE_OUTSIDE "Ute " |
94 | #define LCD_SENSOR_TEMPERATURE_OUTSIDE "Ute " |
| 23 | #define LCD_SENSOR_TEMPERATURE_FREEZER "Frys " |
95 | #define LCD_SENSOR_TEMPERATURE_FREEZER "Frys " |
| 24 | #define LCD_SENSOR_TEMPERATURE_REFRIGERATOR "Kyl " |
96 | #define LCD_SENSOR_TEMPERATURE_REFRIGERATOR "Kyl " |
| 25 | - | ||
| 26 | /* LCD: layout */ |
- | |
| 27 | #define LCD_TOP 0,0 |
- | |
| 28 | - | ||
| 29 | #define LCD_LINE0_0 0,0 |
- | |
| 30 | #define LCD_LINE0_1 4,0 |
- | |
| 31 | #define LCD_LINE0_2 10,0 |
- | |
| 32 | #define LCD_LINE0_3 14,0 |
- | |
| 33 | - | ||
| 34 | #define LCD_LINE1_0 0,1 |
- | |
| 35 | #define LCD_LINE1_1 4,1 |
- | |
| 36 | #define LCD_LINE1_2 10,1 |
- | |
| 37 | #define LCD_LINE1_3 14,1 |
- | |
| 38 | - | ||
| 39 | #define LCD_LINE2_0 0,2 |
- | |
| 40 | #define LCD_LINE2_1 4,2 |
- | |
| 41 | #define LCD_LINE2_2 10,2 |
- | |
| 42 | #define LCD_LINE2_3 14,2 |
- | |
| 43 | - | ||
| 44 | #define LCD_LINE3_0 0,3 |
- | |
| 45 | #define LCD_LINE3_1 4,3 |
- | |
| 46 | #define LCD_LINE3_2 10,3 |
- | |
| 47 | #define LCD_LINE3_3 14,3 |
- | |
| 48 | 97 | ||
| 49 | /* DS18S20 serial ID */ |
98 | /* DS18S20 serial ID */ |
| 50 | #define DS18S20_FREEZER 0x10A7022601080005 |
99 | #define DS18S20_FREEZER 0x10A7022601080005 |
| 51 | #define DS18S20_OUTSIDE 0x100901E50008001E |
100 | #define DS18S20_OUTSIDE 0x100901E50008001E |
| 52 | #define DS18S20_INSIDE_1 0x1061C125010800CC |
101 | #define DS18S20_INSIDE_1 0x1061C125010800CC |
| 53 | //#define DS18S20_INSIDE_2 |
102 | //#define DS18S20_INSIDE_2 |
| 54 | //#define DS18S20_REFRIGERATOR |
103 | //#define DS18S20_REFRIGERATOR |
| 55 | #define DS18S20_UNDEF 0x00 |
104 | #define DS18S20_UNDEF 0x00 |
| 56 | 105 | ||
| 57 | /* Node IDs */ |
- | |
| 58 | #define NODE_SENSOR_1 0x0F |
- | |
| 59 | #define NODE_LCD_1 0x02 |
- | |
| 60 | 106 | ||