Advertisement
Guest User

wbus.h

a guest
Jun 11th, 2015
9,110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 15.94 KB | None | 0 0
  1. //
  2. // W-Bus addresses_
  3. // 0x0F : thermo Test Software
  4. // 0x04 : heating device
  5. // 0x03 : 1533 Timer
  6. // 0x02 : Telestart
  7. //
  8. // address as client
  9. #define WBUS_CLIENT_ADDR    0x0F
  10. // address as host
  11. #define WBUS_HOST_ADDR      0x04
  12.  
  13. /* W-Bus commands */
  14. #define WBUS_CMD_OFF        0x10 /* no data */
  15. #define WBUS_CMD_ON         0x20 /* For all CMD_ON_x : 1 byte = time in minutes */
  16. #define WBUS_CMD_ON_PH      0x21 /* Parking Heating */
  17. #define WBUS_CMD_ON_VENT    0x22 /* Ventilation */
  18. #define WBUS_CMD_ON_SH      0x23 /* Supplemental Heating */
  19. #define WBUS_CMD_CP         0x24 /* Circulation Pump external control */
  20. #define WBUS_CMD_BOOST      0x25 /* Boost mode */
  21. #define WBUS_CMD_SL_RD      0x32 /* Telestart system level read */
  22. #define WBUS_CMD_SL_WR      0x33 /* Telestart system level write */
  23. #define WBUS_CMD_EEPROM_RD  0x35 /* READ_EEPROM [address].
  24.                                  Response length 2 byte. Reads two bytes from
  25.                                  eeprom memory, from address given as parameter.
  26.                                  The eeprom is accessible from address 0x00 to 0x1f.
  27.                                  In eeprom dump I found customer ID Number,
  28.                                  registered remote fob codes, telestart system level etc. */
  29. #define WBUS_CMD_EEPROM_WR  0x36 /* WRITE_EEPROM [address],[byte1],[byte2]
  30.                                  Write two bytes to eeprom. Address, byte1, byte2
  31.                                  as parameter. */
  32. #define WBUS_CMD_U1         0x38 /* No idea. */
  33. #define WBUS_TS_REGR        0x40 /* discovered by pczepek, Response length 0 byte.
  34.                                  Parameter 0-0x0f. After issuing command,
  35.                                  press remote fob OFF button to register.
  36.                                  You can register max 3 remote fob. */
  37. #define WBUS_CMD_FP         0x42 /* Fuel prime. data 0x03 <2 bytes time in seconds / 2> */
  38. #define WBUS_CMD_CHK        0x44 /* Check current command (0x20,0x21,0x22 or 0x23) */
  39. #define WBUS_CMD_TEST       0x45 /* <1 byte sub system id> <1 byte time in seconds> <2 bytes value> */
  40. #define WBUS_CMD_QUERY      0x50 /* Read operational information registers */
  41. #define WBUS_CMD_IDENT      0x51 /* Read device identification information registers */
  42. #define WBUS_CMD_OPINFO     0x53 /* 1 byte, operational info index. */
  43. #define WBUS_CMD_ERR        0x56 /* Error related commands */
  44. #define WBUS_CMD_CO2CAL     0x57 /* CO2 calibration */
  45. #define WBUS_CMD_DATASET    0x58 /* (Not Webasto) data set related commands */
  46.  
  47. /* 0x50 Command parameters */
  48. /* Status flags. Bitmasks below. STAxy_desc means status "x", byte offset "y", flag called 2desc" */
  49. #define QUERY_STATUS0       0x02
  50. #define     STA00_SHR       0x10 /*!< Supplemental heater request*/
  51. #define     STA00_MS        0x01 /*!< Main switch */
  52. #define     STA01_S         0x01 /*!< Summer season */
  53. #define     STA02_D         0x10 /*!< Generator signal D+ */
  54. #define     STA03_BOOST     0x10 /*!< boost mode */
  55. #define     STA03_AD        0x01 /*!< auxiliary drive */
  56. #define     STA04_T15       0x01 /*!< ignition (terminal 15) */
  57.  
  58. #define QUERY_STATUS1       0x03
  59. #define     STA10_CF        0x01 /*!< Combustion Fan    */
  60. #define     STA10_GP        0x02 /*!< Glühkerze        */
  61. #define     STA10_FP        0x04 /*!< Fuel Pump             */
  62. #define     STA10_CP        0x08 /*!< Circulation Pump  */
  63. #define     STA10_VF        0x10 /*!< Vehicle Fan Relay */
  64. #define     STA10_NSH       0x20 /*!< Nozzle stock heating  */
  65. #define     STA10_FI        0x40 /*!< Flame indicator       */
  66.  
  67. #define QUERY_OPINFO0       0x04 /* Fuel type, max heat time and factor for shortening ventilation time (but details are unclear) */
  68. #define     OP0_FUEL        0      /*!< 0x0b: gasoline, 0x0d: diesel, 0:neutral */
  69. #define     OP0_TIME        1      /*!< max heating time / 10 in minutes */
  70. #define     OP0_FACT        2      /*!< ventilation shortening factor (?) */
  71.  
  72. #define QUERY_SENSORS       0x05 /*!< Assorted sensors. 8 bytes. Byte offsets below. */
  73. #define     SEN_TEMP        0   /*!< Temperature with 50�C offset (20�C is represented by 70) */
  74. #define     SEN_VOLT        1   /*!< 2 bytes Spannung in mili Volt, big endian */
  75. #define     SEN_FD          3   /*!< 1 byte Flame detector flag */
  76. #define     SEN_HE          4   /*!< 2 byte, heating power, in percent or watts (semantic seems wrong, heating energy?) */
  77. #define     SEN_GPR         6   /*!< 2 byte, glow plug resistance in mili Ohm. */
  78.  
  79. #define QUERY_COUNTERS1     0x06
  80. #define     WORK_HOURS      0 /*!< Working hours     */
  81. #define     WORK_MIN        2 /*!< Working minutes   */
  82. #define     OP_HOURS        3 /*!< Operating hours   */
  83. #define     OP_MIN          5 /*!< Operating minutes */
  84. #define     CNT_START       6 /*!< Start counter     */
  85.  
  86. #define QUERY_STATE         0x07
  87. #define     OP_STATE        0
  88. #define     OP_STATE_N      1
  89. #define     DEV_STATE       2
  90. /* 3 more unknown bytes */
  91. #define WB_STATE_BO         0x00 /* Burn out */
  92. #define WB_STATE_DEACT1     0x01 /* Deactivation */
  93. #define WB_STATE_BOADR      0x02 /* Burn out ADR (has something to due with hazardous substances transportation) */
  94. #define WB_STATE_BORAMP     0x03 /* Burn out Ramp */
  95. #define WB_STATE_OFF        0x04 /* Off state */
  96. #define WB_STATE_CPL        0x05 /* Combustion process part load */
  97. #define WB_STATE_CFL        0x06 /* Combustion process full load */
  98. #define WB_STATE_FS         0x07 /* Fuel supply */
  99. #define WB_STATE_CAFS       0x08 /* Combustion air fan start */
  100. #define WB_STATE_FSI        0x09 /* Fuel supply interruption */
  101. #define WB_STATE_DIAG       0x0a /* Diagnostic state */
  102. #define WB_STATE_FPI        0x0b /* Fuel pump interruption */
  103. #define WB_STATE_EMF        0x0c /* EMF measurement */
  104. #define WB_STATE_DEB        0x0d /* Debounce */
  105. #define WB_STATE_DEACTE     0x0e /* Deactivation */
  106. #define WB_STATE_FDI        0x0f /* Flame detector interrogation */
  107. #define WB_STATE_FDC        0x10 /* Flame detector cooling */
  108. #define WB_STATE_FDM        0x11 /* Flame detector measuring phase */
  109. #define WB_STATE_FDMZ       0x12 /* Flame detector measuring phase ZUE */
  110. #define WB_STATE_FAN        0x13 /* Fan start up */
  111. #define WB_STATE_GPRAMP     0x14 /* Glow plug ramp */
  112. #define WB_STATE_LOCK       0x15 /* Heater interlock */
  113. #define WB_STATE_INIT       0x16 /* Initialization   */
  114. #define WB_STATE_BUBLE      0x17 /* Fuel bubble compensation */
  115. #define WB_STATE_FANC       0x18 /* Fan cold start-up */
  116. #define WB_STATE_COLDR      0x19 /* Cold start enrichment */
  117. #define WB_STATE_COOL       0x1a /* Cooling */
  118. #define WB_STATE_LCHGUP     0x1b /* Load change PL-FL */
  119. #define WB_STATE_VENT       0x1c /* Ventilation */
  120. #define WB_STATE_LCHGDN     0x1d /* Load change FL-PL */
  121. #define WB_STATE_NINIT      0x1e /* New initialization */
  122. #define WB_STATE_CTRL       0x1f /* Controlled operation */
  123. #define WB_STATE_CIDDLE     0x20 /* Control iddle period */
  124. #define WB_STATE_SSTART     0x21 /* Soft start */
  125. #define WB_STATE_STIME      0x22 /* Savety time */
  126. #define WB_STATE_PURGE      0x23 /* Purge */
  127. #define WB_STATE_START      0x24 /* Start */
  128. #define WB_STATE_STAB       0x25 /* Stabilization */
  129. #define WB_STATE_SRAMP      0x26 /* Start ramp    */
  130. #define WB_STATE_OOP        0x27 /* Out of power  */
  131. #define WB_STATE_LOCK2      0x28 /* Interlock     */
  132. #define WB_STATE_LOCKADR    0x29 /* Interlock ADR (Australian design rules) */
  133. #define WB_STATE_STABT      0x2a /* Stabilization time */
  134. #define WB_STATE_CHGCTRL    0x2b /* Change to controlled operation */
  135. #define WB_STATE_DECIS      0x2c /* Decision state */
  136. #define WB_STATE_PSFS       0x2d /* Prestart fuel supply */
  137. #define WB_STATE_GLOW       0x2e /* Glowing */
  138. #define WB_STATE_GLOWP      0x2f /* Glowing power control */
  139. #define WB_STATE_DELAY      0x30 /* Delay lowering */
  140. #define WB_STATE_SLUG       0x31 /* Sluggish fan start */
  141. #define WB_STATE_AGLOW      0x32 /* Additional glowing */
  142. #define WB_STATE_IGNI       0x33 /* Ignition interruption */
  143. #define WB_STATE_IGN        0x34 /* Ignition */
  144. #define WB_STATE_IGNII      0x35 /* Intermittent glowing */
  145. #define WB_STATE_APMON      0x36 /* Application monitoring */
  146. #define WB_STATE_LOCKS      0x37 /* Interlock save to memory */
  147. #define WB_STATE_LOCKD      0x38 /* Heater interlock deactivation */
  148. #define WB_STATE_OUTCTL     0x39 /* Output control */
  149. #define WB_STATE_CPCTL      0x3a /* Circulating pump control */
  150. #define WB_STATE_INITUC     0x3b /* Initialization uP */
  151. #define WB_STATE_SLINT      0x3c /* Stray light interrogation */
  152. #define WB_STATE_PRES       0x3d /* Prestart */
  153. #define WB_STATE_PREIGN     0x3e /* Pre-ignition */
  154. #define WB_STATE_FIGN       0x3f /* Flame ignition */
  155. #define WB_STATE_FSTAB      0x40 /* Flame stabilization */
  156. #define WB_STATE_PH         0x41 /* Combustion process parking heating */
  157. #define WB_STATE_SH         0x42 /* Combustion process suppl. heating  */
  158. #define WB_STATE_PHFAIL     0x43 /* Combustion failure failure heating */
  159. #define WB_STATE_SHFAIL     0x44 /* Combustion failure suppl. heating  */
  160. #define WB_STATE_OFFR       0x45 /* Heater off after run */
  161. #define WB_STATE_CID        0x46 /* Control iddle after run */
  162. #define WB_STATE_ARFAIL     0x47 /* After-run due to failure */
  163. #define WB_STATE_ARTCTL     0x48 /* Time-controlled after-run due to failure */
  164. #define WB_STATE_LOCKCP     0x49 /* Interlock circulation pump */
  165. #define WB_STATE_CIDPH      0x4a /* Control iddle after parking heating */
  166. #define WB_STATE_CIDSH      0x4b /* Control iddle after suppl. heating  */
  167. #define WB_STATE_CIDHCP     0x4c /* Control iddle period suppl. heating with circulation pump */
  168. #define WB_STATE_CPNOH      0x4d /* Circulation pump without heating function */
  169. #define WB_STATE_OV         0x4e /* Waiting loop overvoltage */
  170. #define WB_STATE_MFAULT     0x4f /* Fault memory update */
  171. #define WB_STATE_WLOOP      0x50 /* Waiting loop */
  172. #define WB_STATE_CTEST      0x51 /* Component test */
  173. #define WB_STATE_BOOST      0x52 /* Boost */
  174. #define WB_STATE_COOL2      0x53 /* Cooling */
  175. #define WB_STATE_LOCKP      0x54 /* Heater interlock permanent */
  176. #define WB_STATE_FANIDL     0x55 /* Fan iddle */
  177. #define WB_STATE_BA         0x56 /* Break away */
  178. #define WB_STATE_TINT       0x57 /* Temperature interrogation */
  179. #define WB_STATE_PREUV      0x58 /* Prestart undervoltage */
  180. #define WB_STATE_AINT       0x59 /* Accident interrogation */
  181. #define WB_STATE_ARSV       0x5a /* After-run solenoid valve */
  182. #define WB_STATE_MFLTSV     0x5b /* Fault memory update solenoid valve */
  183. #define WB_STATE_TCARSV     0x5c /* Timer-controlled after-run solenoid valve */
  184. #define WB_STATE_SA         0x5d /* Startup attempt */
  185. #define WB_STATE_PREEXT     0x5e /* Prestart extension */
  186. #define WB_STATE_COMBP      0x5f /* Combustion process */
  187. #define WB_STATE_TIARUV     0x60 /* Timer-controlled after-run due to undervoltage */
  188. #define WB_STATE_MFLTSW     0x61 /* Fault memory update prior switch off */
  189. #define WB_STATE_RAMPFL     0x62 /* Ramp full load */
  190.     /*byte1 Operating state state number*/
  191.     /*byte2 Device state*/
  192. #define WB_DSTATE_STFL      0x01 /* STFL */
  193. #define WB_DSTATE_UEHFL     0x02 /* UEHFL */
  194. #define WB_DSTATE_SAFL      0x04 /* SAFL   */
  195. #define WB_DSTATE_RZFL      0x08 /* RZFL */
  196.     /*byte3,4,5: Unknown*/
  197. #define QUERY_DURATIONS0    0x0a /* 24 bytes */
  198.  
  199. #define QUERY_DURATIONS1    0x0b /* 6 bytes*/
  200. #define     DUR1_PH         0 /* Parking heating duration, hh:m */
  201. #define     DUR1_SH         3 /* Supplemental heating duration hh:m */
  202.  
  203. #define QUERY_COUNTERS2     0x0c
  204. #define     STA3_SCPH       0   /*!< 2 bytes, parking heater start counter  */
  205. #define     STA3_SCSH       2   /*!< 2 bytes, supplemtal heater start counter */
  206. #define     STA34_FD        0x00    /*!< Flame detected  */
  207.  
  208. #define QUERY_STATUS2       0x0F
  209. #define     STA2_GP         0 /* glow plug (ignition/flame detection)*/
  210. #define     STA2_FP         1 /* fuel pump */
  211. #define     STA2_CAF        2 /* combustion air fan */
  212. #define     STA2_U0         3 /* unknown */
  213. #define     STA2_CP         4 /* (coolant) circulation pump */
  214.  
  215. #define QUERY_OPINFO1       0x11
  216. #define     OP1_THI         0 /* Lower temperature threshold */
  217. #define     OP1_TLO         1 /* Higher temperature threshold */
  218. #define     OP1_U0          2
  219.  
  220. #define QUERY_DURATIONS2    0x12 /* 3 bytes */
  221. #define     DUR2_VENT       0 /* Ventilation duration hh:m */
  222.                
  223. #define QUERY_FPW           0x13 /*!< Fuel prewarming. May not be available. See wbcode */
  224. #define     FPW_R           0   /*!< 2 bytes: Current fuel prewarming PTC resistance in mili ohm, big endian */
  225. #define     FPW_P           2   /*!< 2 bytes: Currently applied fuel prewarming power in watts, big endian */
  226.  
  227. /* 0x51 Command parameters */
  228. #define IDENT_DEV_ID        0x01 /*!< Device ID Number */
  229. #define IDENT_HWSW_VER      0x02 /*!< Hardware version (KW/Jahr), Software version, Software version EEPROM, 6 bytes */
  230. #define IDENT_DATA_SET      0x03 /*!< Data Set ID Number */
  231. #define IDENT_DOM_CU        0x04 /*!< Control Unit Herstellungsdatum (Tag monat jahr je ein byte) */
  232. #define IDENT_DOM_HT        0x05 /*!< Heizer Herstellungsdatum (Tag monat jahr je ein byte) */
  233. #define IDENT_TSCODE        0x06 /*!< Telestart code */
  234. #define IDENT_CUSTID        0x07 /*!< Customer ID Number (Die VW Teilenummer als string und noch ein paar Nummern dran) + test sig */
  235. #define IDENT_U0            0x08 /*!< ? */
  236. #define IDENT_SERIAL        0x09 /*!< Serial Number */
  237. #define IDENT_WB_VER        0x0a /*!< W-BUS version. Antwort ergibt ein byte. Jedes nibble dieses byte entspricht einer Zahl (Zahl1.Zahl2) */
  238. #define IDENT_DEV_NAME      0x0b /*!< Device Name: Als character string zu interpretieren. */
  239. #define IDENT_WB_CODE       0x0c /*!< W-BUS code. 7 bytes. This is sort of a capability bit field */
  240.  
  241. /* W-Bus code bits */
  242. #define WB_CODE_0            0 /* Unknown supplemental heater feature */
  243. #define WB_CODE_ON           3 /* on/off switch capability */
  244. #define WB_CODE_PH           4 /* Parking heater capability */
  245. #define WB_CODE_SH           5 /* Supplemental heater capability */
  246. #define WB_CODE_VENT         6 /* Ventilation capability */
  247. #define WB_CODE_BOOST        7 /* Boost capability */
  248.  
  249. #define WB_CODE_ECPC         9 /* External circulation pump control */
  250. #define WB_CODE_CAV         10 /* Combustion air fan (CAV) */
  251. #define WB_CODE_GP          11 /* Glow Plug (flame detector) */
  252. #define WB_CODE_FP          12 /* Fuel pump (FP) */
  253. #define WB_CODE_CP          13 /* Circulation pump (CP) */
  254. #define WB_CODE_VFR         14 /* Vehicle fan relay (VFR) */
  255. #define WB_CODE_LEDY        15 /* Yellow LED */
  256.  
  257. #define WB_CODE_LEDG        16 /* Green LED present */
  258. #define WB_CODE_ST          17 /* Spark transmitter. Implies no Glow plug and thus no resistive flame detection */
  259. #define WB_CODE_SV          18 /* Solenoid valve present (coolant circuit switching) */
  260. #define WB_CODE_DI          19 /* Auxiliary drive indicator (whatever that means) */
  261. #define WB_CODE_D           20 /* Generator signal D+ present */
  262. #define WB_CODE_CAVR        21 /* Combustion air fan level is in RPM instead of percent */
  263. #define WB_CODE_22          22 /* (ZH) */
  264. #define WB_CODE_23          23 /* (ZH) */
  265.  
  266. #define WB_CODE_CO2         25 /* CO2 calibration */
  267. #define WB_CODE_OI          27 /* Operation indicator (OI) */
  268.  
  269. #define WB_CODE_32          32 /* (ZH) */
  270. #define WB_CODE_33          33 /* (ZH) */
  271. #define WB_CODE_34          34 /* (ZH) */
  272. #define WB_CODE_35          35 /* (ZH) */
  273. #define WB_CODE_HEW         36 /* Heating energy is in watts (or if not set in percent and the value field must be divided by 2 to get the percent value) */
  274.  
  275. #define WB_CODE_37          37 /* (ZH) */
  276. #define WB_CODE_FI          38 /* Flame indicator (FI) */
  277. #define WB_CODE_NSH         39 /* Nozzle Stock heating (NSH) */
  278.  
  279. #define WB_CODE_T15         45 /* Ignition (T15) flag present */
  280. #define WB_CODE_TTH         46 /* Temperature thresholds available, command 0x50 index 0x11 */
  281. #define WB_CODE_VPWR        47 /* Fuel prewarming resistance and power can be read. */
  282.  
  283. #define WB_CODE_SET         57 /* 0x02 Set value flame detector resistance (FW-SET), set value combustion air fan revolutions (BG-SET), set value output temperature (AT-SET) */
  284.  
  285. #define IDENT_SW_ID         0x0D /*!< Software ID */
  286.  
  287. /* 053 operational info indexes */
  288. #define OPINFO_LIMITS       02
  289. /*
  290.   data format:
  291.  1 byte:  no idea
  292.  2 bytes: Minimum voltage threshold in milivolts
  293.  4 bytes: no idea
  294.  1 byte:  minimum voltage detection delay (seconds)
  295.  2 bytes: maximum voltage threshold in milivolts
  296.  4 bytes: no idea
  297.  1 byte:  maximum voltage detection delay (seconds
  298.  */
  299.  
  300. /* 0x56 Error code operand 0 */
  301. #define ERR_LIST            1 /* send not data. answer is n, code0, counter0-1, code1, counter1-1 ... coden, countern-1 */
  302. #define ERR_READ            2 /* send code. answer code, flags, counter ... (err_info_t) */
  303. #define ERR_DEL             3 /* send no data. answer also no data. */
  304.  
  305. #define CO2CAL_READ         1 /* 3 data bytes: current value, min value, max value. */
  306. #define CO2CAL_WRITE        3 /* 1 data byte: new current value. */
  307.  
  308. /* Component test device definitions */
  309. #define WBUS_TEST_CF         1 /*!< Combustion Fan */
  310. #define WBUS_TEST_FP         2 /*!< Fuel Pump */
  311. #define WBUS_TEST_GP         3 /*!< Glow Plug */
  312. #define WBUS_TEST_CP         4 /*!< Circulation Pump */
  313. #define WBUS_TEST_VF         5 /*!< Vehicle Fan Relays */
  314. #define WBUS_TEST_SV         9 /*!< Solenoid Valve */
  315. #define WBUS_TEST_NSH       13 /*!< Nozzel Stock Heating */
  316. #define WBUS_TEXT_NAC       14 /*!< Nozzle air compressor (not standart, POELI specific) */
  317. #define WBUS_TEST_FPW       15 /*!< Fuel Prewarming */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement