sensor_sdr.c.reference.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. /*
  2. * config sensor sdr in here.
  3. * Author:Jimbo
  4. */
  5. #include <stdio.h>
  6. #include <stdint.h>
  7. #include "com_IPMI_SDRRecord.h"
  8. /*
  9. * sdr table
  10. */
  11. const MgmtCtrlrDevLocator_T bmc_sdr = {
  12. /* SDR Record Header */
  13. {
  14. 0x01, //Record ID
  15. 0x51, //SDR Version
  16. MGMT_CTRL_DEV_LOCATOR_SDR_REC, //Record Type
  17. 11+MAX_ID_STR_LEN, //Record Length = 11+string length
  18. },
  19. /* Record Key Bytes*/
  20. 0x20, /* Slave address - 0x20 Primary BMC */
  21. 0x00, /* ChannelNumber - 0x00 Primary BMC */
  22. /* Record Body Bytes*/
  23. 0x0, /* power state notification */
  24. 0xff, /* Device Capablities */
  25. {0, 0, 0,}, /* RESERVED */
  26. 0x0, /* Entity ID */
  27. 0x1, /* Entity Instance */
  28. 0x0, /* OEM */
  29. 0xc0 +MAX_ID_STR_LEN, /* ID String Type / Length Code */
  30. "STM32F429_BMC"
  31. };
  32. /***************** Attation ************************
  33. * <Record ID>, <Sensor Number> must be modified!!!
  34. **************************************************/
  35. const FullSensorRec_T full_sdr_tbl[] = {
  36. /*
  37. * sensor number: 1
  38. * sensor name: +12V
  39. * brief: ltc4280
  40. */
  41. {
  42. /* SDR Record Header */
  43. {
  44. 0x02, //Record ID
  45. 0x51, //SDR Version
  46. FULL_SDR_REC, //Record Type
  47. 43+MAX_ID_STR_LEN, //Record Length = 43+string length
  48. },
  49. /* Record Key Bytes */
  50. 0x20, //Sensor Owner ID
  51. 0x0, //Sensor Owner LUN
  52. 0x01, //Sensor Number
  53. /* Record Body Bytes */
  54. 0x7, //Entity ID
  55. 0x1, //Entity Instance
  56. 0x7f, //Entity Initialization
  57. 0x68, //Sensor Capabilities
  58. 0x02, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan
  59. 0x01, //Event / Reading Type
  60. 0x7a95, //Lower Threshold Reading Mask
  61. 0x7a95, //Upper Threshold Reading Mask
  62. 0x3f3f, //Settable / Readable Threshold Mask
  63. /*
  64. [7:6] - Analog (numeric) Data Format**
  65. 00b = unsigned
  66. 01b = 1's complement(singed)
  67. 10b = 2's complement(singed)
  68. 11b = Does not return analog (numeric) reading
  69. [5:3] - Rate unit
  70. 000b = none
  71. 001b = per µS
  72. 010b = per ms
  73. 011b = per s
  74. 100b = per minute
  75. 101b = per hour
  76. 110b = per day
  77. 111b = reserved
  78. [2:1] - Modifier unit
  79. 00b = none
  80. 01b = Basic Unit / Modifier Unit
  81. 10b = Basic Unit * Modifier Unit
  82. 11b = reserved
  83. [0] - Percentage 0b = no, 1b = yes
  84. */
  85. (0x0<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1
  86. /*
  87. 0 unspecified
  88. 1 degrees C
  89. 2 degrees F
  90. 3 degrees K
  91. 4 Volts
  92. 5 Amps
  93. */
  94. 0x4, //Sensor Units 2 - Base Unit
  95. 0x0, //Sensor Units 3 - Modifier Unit
  96. 0x0, //Linerization
  97. /* M = 0x12e x 10^-4 */
  98. 0x3d, //M_LSB
  99. /*
  100. [7:6] - M: MS 2 bits
  101. [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts)
  102. */
  103. ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance
  104. 0x0, //B_LSB
  105. /*
  106. [7:6] - B: MS 2 bits
  107. Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned
  108. Accuracy exponent:
  109. [5:0] - Accuracy: LS 6 bits
  110. */
  111. ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy
  112. ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent
  113. (uint8_t)(0xfd<<4)+(0x0&0x0F), //R exponent,B exponent
  114. 0x0, //Analog Characteristics Flags
  115. 0x7f, //Nominal Reading
  116. 0xff, //Normal Maximum
  117. 0x00, //Normal Minimum
  118. 0xff, //Sensor Maximum Reading
  119. 0x00, //Sensor Minimum Reading
  120. 0xff, //Upper Non-Recoverable Threshold
  121. 0xff, //Upper Critical Threshold
  122. 0xff, //Upper Non-Critical Threshold
  123. 0x00, //Lower Non-Recoverable Threshold
  124. 0x00, //Lower Critical Threshold
  125. 0x00, //Lower Non-Critical threshold
  126. 0x0, //Positive - threshold Hysteresis value
  127. 0x0, //Negative - threshold Hysteresis value
  128. 0x0, //Reserved
  129. 0x0, //Reserved
  130. 0x0, //OEM
  131. 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code
  132. "+12V"
  133. },
  134. /*
  135. * sensor number: 2
  136. * sensor name: +12V_Current
  137. * brief: ltc4280
  138. */
  139. {
  140. /* SDR Record Header */
  141. {
  142. 0x03, //Record ID
  143. 0x51, //SDR Version
  144. FULL_SDR_REC, //Record Type
  145. 43+MAX_ID_STR_LEN, //Record Length = 43+string length
  146. },
  147. /* Record Key Bytes */
  148. 0x20, //Sensor Owner ID
  149. 0x0, //Sensor Owner LUN
  150. 0x02, //Sensor Number
  151. /* Record Body Bytes */
  152. 0x7, //Entity ID
  153. 0x1, //Entity Instance
  154. 0x7f, //Entity Initialization
  155. 0x68, //Sensor Capabilities
  156. 0x02, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan
  157. 0x01, //Event / Reading Type
  158. 0x7a95, //Lower Threshold Reading Mask
  159. 0x7a95, //Upper Threshold Reading Mask
  160. 0x3f3f, //Settable / Readable Threshold Mask
  161. /*
  162. [7:6] - Analog (numeric) Data Format**
  163. 00b = unsigned
  164. 01b = 1's complement(singed)
  165. 10b = 2's complement(singed)
  166. 11b = Does not return analog (numeric) reading
  167. [5:3] - Rate unit
  168. 000b = none
  169. 001b = per µS
  170. 010b = per ms
  171. 011b = per s
  172. 100b = per minute
  173. 101b = per hour
  174. 110b = per day
  175. 111b = reserved
  176. [2:1] - Modifier unit
  177. 00b = none
  178. 01b = Basic Unit / Modifier Unit
  179. 10b = Basic Unit * Modifier Unit
  180. 11b = reserved
  181. [0] - Percentage 0b = no, 1b = yes
  182. */
  183. (0x0<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1
  184. /*
  185. 0 unspecified
  186. 1 degrees C
  187. 2 degrees F
  188. 3 degrees K
  189. 4 Volts
  190. 5 Amps
  191. */
  192. 0x5, //Sensor Units 2 - Base Unit
  193. 0x0, //Sensor Units 3 - Modifier Unit
  194. 0x0, //Linerization
  195. /* M = 0x12e x 10^-4 */
  196. 0x2e, //M_LSB
  197. /*
  198. [7:6] - M: MS 2 bits
  199. [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts)
  200. */
  201. ((0x12e>>2)&0xC0)+(0x0&0x3F), //M,Tolerance
  202. 0x0, //B_LSB
  203. /*
  204. [7:6] - B: MS 2 bits
  205. Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned
  206. Accuracy exponent:
  207. [5:0] - Accuracy: LS 6 bits
  208. */
  209. ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy
  210. ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent
  211. (uint8_t)(0xfc<<4)+(0x0&0x0F), //R exponent,B exponent
  212. 0x0, //Analog Characteristics Flags
  213. 0x7f, //Nominal Reading
  214. 0xff, //Normal Maximum
  215. 0x00, //Normal Minimum
  216. 0xff, //Sensor Maximum Reading
  217. 0x00, //Sensor Minimum Reading
  218. 0xff, //Upper Non-Recoverable Threshold
  219. 0xff, //Upper Critical Threshold
  220. 0xff, //Upper Non-Critical Threshold
  221. 0x0, //Lower Non-Recoverable Threshold
  222. 0x0, //Lower Critical Threshold
  223. 0x0, //Lower Non-Critical threshold
  224. 0x0, //Positive - threshold Hysteresis value
  225. 0x0, //Negative - threshold Hysteresis value
  226. 0x0, //Reserved
  227. 0x0, //Reserved
  228. 0x0, //OEM
  229. 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code
  230. "+12V_Current"
  231. },
  232. /*
  233. * sensor number: 3
  234. * sensor name: Temp_Board
  235. * brief: G780 local
  236. */
  237. {
  238. /* SDR Record Header */
  239. {
  240. 0x04, //Record ID
  241. 0x51, //SDR Version
  242. FULL_SDR_REC, //Record Type
  243. 43+MAX_ID_STR_LEN, //Record Length = 43+string length
  244. },
  245. /* Record Key Bytes */
  246. 0x20, //Sensor Owner ID
  247. 0x0, //Sensor Owner LUN
  248. 0x03, //Sensor Number
  249. /* Record Body Bytes */
  250. 0x7, //Entity ID
  251. 0x1, //Entity Instance
  252. 0x7f, //Entity Initialization
  253. 0x68, //Sensor Capabilities
  254. 0x01, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan
  255. 0x01, //Event / Reading Type
  256. 0x7a95, //Lower Threshold Reading Mask
  257. 0x7a95, //Upper Threshold Reading Mask
  258. 0x3f3f, //Settable / Readable Threshold Mask
  259. /*
  260. [7:6] - Analog (numeric) Data Format**
  261. 00b = unsigned
  262. 01b = 1's complement(singed)
  263. 10b = 2's complement(singed)
  264. 11b = Does not return analog (numeric) reading
  265. [5:3] - Rate unit
  266. 000b = none
  267. 001b = per µS
  268. 010b = per ms
  269. 011b = per s
  270. 100b = per minute
  271. 101b = per hour
  272. 110b = per day
  273. 111b = reserved
  274. [2:1] - Modifier unit
  275. 00b = none
  276. 01b = Basic Unit / Modifier Unit
  277. 10b = Basic Unit * Modifier Unit
  278. 11b = reserved
  279. [0] - Percentage 0b = no, 1b = yes
  280. */
  281. (0x2<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1
  282. /*
  283. 0 unspecified
  284. 1 degrees C
  285. 2 degrees F
  286. 3 degrees K
  287. 4 Volts
  288. 5 Amps
  289. */
  290. 0x1, //Sensor Units 2 - Base Unit
  291. 0x0, //Sensor Units 3 - Modifier Unit
  292. 0x0, //Linerization
  293. 0x1, //M_LSB
  294. /*
  295. [7:6] - M: MS 2 bits
  296. [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts)
  297. */
  298. ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance
  299. 0x0, //B_LSB
  300. /*
  301. [7:6] - B: MS 2 bits
  302. Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned
  303. Accuracy exponent:
  304. [5:0] - Accuracy: LS 6 bits
  305. */
  306. ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy
  307. ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent
  308. (0x0<<4)+(0x0&0x0F), //R exponent,B exponent
  309. 0x0, //Analog Characteristics Flags
  310. 0x7f, //Nominal Reading
  311. 0x7f, //Normal Maximum
  312. 0x80, //Normal Minimum
  313. 0x7f, //Sensor Maximum Reading
  314. 0x80, //Sensor Minimum Reading
  315. 0x7f, //Upper Non-Recoverable Threshold
  316. 0x7f, //Upper Critical Threshold
  317. 0x7f, //Upper Non-Critical Threshold
  318. 0x80, //Lower Non-Recoverable Threshold
  319. 0x80, //Lower Critical Threshold
  320. 0x80, //Lower Non-Critical threshold
  321. 0x0, //Positive - threshold Hysteresis value
  322. 0x0, //Negative - threshold Hysteresis value
  323. 0x0, //Reserved
  324. 0x0, //Reserved
  325. 0x0, //OEM
  326. 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code
  327. "Temp_Board"
  328. },
  329. /*
  330. * sensor number: 4
  331. * sensor name: Temp_FPGA
  332. * brief: G780 remote
  333. */
  334. {
  335. /* SDR Record Header */
  336. {
  337. 0x05, //Record ID
  338. 0x51, //SDR Version
  339. FULL_SDR_REC, //Record Type
  340. 43+MAX_ID_STR_LEN, //Record Length = 43+string length
  341. },
  342. /* Record Key Bytes */
  343. 0x20, //Sensor Owner ID
  344. 0x0, //Sensor Owner LUN
  345. 0x04, //Sensor Number
  346. /* Record Body Bytes */
  347. 0x7, //Entity ID
  348. 0x1, //Entity Instance
  349. 0x7f, //Entity Initialization
  350. 0x68, //Sensor Capabilities
  351. 0x01, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan
  352. 0x01, //Event / Reading Type
  353. 0x7a95, //Lower Threshold Reading Mask
  354. 0x7a95, //Upper Threshold Reading Mask
  355. 0x3f3f, //Settable / Readable Threshold Mask
  356. /*
  357. [7:6] - Analog (numeric) Data Format**
  358. 00b = unsigned
  359. 01b = 1's complement(singed)
  360. 10b = 2's complement(singed)
  361. 11b = Does not return analog (numeric) reading
  362. [5:3] - Rate unit
  363. 000b = none
  364. 001b = per µS
  365. 010b = per ms
  366. 011b = per s
  367. 100b = per minute
  368. 101b = per hour
  369. 110b = per day
  370. 111b = reserved
  371. [2:1] - Modifier unit
  372. 00b = none
  373. 01b = Basic Unit / Modifier Unit
  374. 10b = Basic Unit * Modifier Unit
  375. 11b = reserved
  376. [0] - Percentage 0b = no, 1b = yes
  377. */
  378. (0x2<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1
  379. /*
  380. 0 unspecified
  381. 1 degrees C
  382. 2 degrees F
  383. 3 degrees K
  384. 4 Volts
  385. 5 Amps
  386. */
  387. 0x1, //Sensor Units 2 - Base Unit
  388. 0x0, //Sensor Units 3 - Modifier Unit
  389. 0x0, //Linerization
  390. 0x1, //M_LSB
  391. /*
  392. [7:6] - M: MS 2 bits
  393. [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts)
  394. */
  395. ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance
  396. 0x0, //B_LSB
  397. /*
  398. [7:6] - B: MS 2 bits
  399. Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned
  400. Accuracy exponent:
  401. [5:0] - Accuracy: LS 6 bits
  402. */
  403. ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy
  404. ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent
  405. (0x0<<4)+(0x0&0x0F), //R exponent,B exponent
  406. 0x0, //Analog Characteristics Flags
  407. 0x7f, //Nominal Reading
  408. 0x7f, //Normal Maximum
  409. 0x80, //Normal Minimum
  410. 0x7f, //Sensor Maximum Reading
  411. 0x80, //Sensor Minimum Reading
  412. 0x7f, //Upper Non-Recoverable Threshold
  413. 0x7f, //Upper Critical Threshold
  414. 0x7f, //Upper Non-Critical Threshold
  415. 0x80, //Lower Non-Recoverable Threshold
  416. 0x80, //Lower Critical Threshold
  417. 0x80, //Lower Non-Critical threshold
  418. 0x0, //Positive - threshold Hysteresis value
  419. 0x0, //Negative - threshold Hysteresis value
  420. 0x0, //Reserved
  421. 0x0, //Reserved
  422. 0x0, //OEM
  423. 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code
  424. "Temp_FPGA"
  425. },
  426. /*
  427. * sensor number: 5
  428. * sensor name: +1.5V
  429. * brief: adc_ch1
  430. */
  431. {
  432. /* SDR Record Header */
  433. {
  434. 0x06, //Record ID
  435. 0x51, //SDR Version
  436. FULL_SDR_REC, //Record Type
  437. 43+MAX_ID_STR_LEN, //Record Length = 43+string length
  438. },
  439. /* Record Key Bytes */
  440. 0x20, //Sensor Owner ID
  441. 0x0, //Sensor Owner LUN
  442. 0x05, //Sensor Number
  443. /* Record Body Bytes */
  444. 0x7, //Entity ID
  445. 0x1, //Entity Instance
  446. 0x7f, //Entity Initialization
  447. 0x68, //Sensor Capabilities
  448. 0x02, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan
  449. 0x01, //Event / Reading Type
  450. 0x7a95, //Lower Threshold Reading Mask
  451. 0x7a95, //Upper Threshold Reading Mask
  452. 0x3f3f, //Settable / Readable Threshold Mask
  453. /*
  454. [7:6] - Analog (numeric) Data Format**
  455. 00b = unsigned
  456. 01b = 1's complement(singed)
  457. 10b = 2's complement(singed)
  458. 11b = Does not return analog (numeric) reading
  459. [5:3] - Rate unit
  460. 000b = none
  461. 001b = per µS
  462. 010b = per ms
  463. 011b = per s
  464. 100b = per minute
  465. 101b = per hour
  466. 110b = per day
  467. 111b = reserved
  468. [2:1] - Modifier unit
  469. 00b = none
  470. 01b = Basic Unit / Modifier Unit
  471. 10b = Basic Unit * Modifier Unit
  472. 11b = reserved
  473. [0] - Percentage 0b = no, 1b = yes
  474. */
  475. (0x0<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1
  476. /*
  477. 0 unspecified
  478. 1 degrees C
  479. 2 degrees F
  480. 3 degrees K
  481. 4 Volts
  482. 5 Amps
  483. */
  484. 0x4, //Sensor Units 2 - Base Unit
  485. 0x0, //Sensor Units 3 - Modifier Unit
  486. 0x0, //Linerization
  487. 0x81, //M_LSB
  488. /*
  489. [7:6] - M: MS 2 bits
  490. [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts)
  491. */
  492. ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance
  493. 0x0, //B_LSB
  494. /*
  495. [7:6] - B: MS 2 bits
  496. Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned
  497. Accuracy exponent:
  498. [5:0] - Accuracy: LS 6 bits
  499. */
  500. ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy
  501. ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent
  502. (uint8_t)(0xfc<<4)+(0x0&0x0F), //R exponent,B exponent
  503. 0x0, //Analog Characteristics Flags
  504. 0x7f, //Nominal Reading
  505. 0xff, //Normal Maximum
  506. 0x00, //Normal Minimum
  507. 0xff, //Sensor Maximum Reading
  508. 0x00, //Sensor Minimum Reading
  509. 0xff, //Upper Non-Recoverable Threshold
  510. 0xff, //Upper Critical Threshold
  511. 0xff, //Upper Non-Critical Threshold
  512. 0x00, //Lower Non-Recoverable Threshold
  513. 0x00, //Lower Critical Threshold
  514. 0x00, //Lower Non-Critical threshold
  515. 0x0, //Positive - threshold Hysteresis value
  516. 0x0, //Negative - threshold Hysteresis value
  517. 0x0, //Reserved
  518. 0x0, //Reserved
  519. 0x0, //OEM
  520. 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code
  521. "+1.5V"
  522. },
  523. /*
  524. * sensor number: 6
  525. * sensor name: +0.75V
  526. * brief: adc_ch2
  527. */
  528. {
  529. /* SDR Record Header */
  530. {
  531. 0x07, //Record ID
  532. 0x51, //SDR Version
  533. FULL_SDR_REC, //Record Type
  534. 43+MAX_ID_STR_LEN, //Record Length = 43+string length
  535. },
  536. /* Record Key Bytes */
  537. 0x20, //Sensor Owner ID
  538. 0x0, //Sensor Owner LUN
  539. 0x06, //Sensor Number
  540. /* Record Body Bytes */
  541. 0x7, //Entity ID
  542. 0x1, //Entity Instance
  543. 0x7f, //Entity Initialization
  544. 0x68, //Sensor Capabilities
  545. 0x02, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan
  546. 0x01, //Event / Reading Type
  547. 0x7a95, //Lower Threshold Reading Mask
  548. 0x7a95, //Upper Threshold Reading Mask
  549. 0x3f3f, //Settable / Readable Threshold Mask
  550. /*
  551. [7:6] - Analog (numeric) Data Format**
  552. 00b = unsigned
  553. 01b = 1's complement(singed)
  554. 10b = 2's complement(singed)
  555. 11b = Does not return analog (numeric) reading
  556. [5:3] - Rate unit
  557. 000b = none
  558. 001b = per µS
  559. 010b = per ms
  560. 011b = per s
  561. 100b = per minute
  562. 101b = per hour
  563. 110b = per day
  564. 111b = reserved
  565. [2:1] - Modifier unit
  566. 00b = none
  567. 01b = Basic Unit / Modifier Unit
  568. 10b = Basic Unit * Modifier Unit
  569. 11b = reserved
  570. [0] - Percentage 0b = no, 1b = yes
  571. */
  572. (0x0<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1
  573. /*
  574. 0 unspecified
  575. 1 degrees C
  576. 2 degrees F
  577. 3 degrees K
  578. 4 Volts
  579. 5 Amps
  580. */
  581. 0x4, //Sensor Units 2 - Base Unit
  582. 0x0, //Sensor Units 3 - Modifier Unit
  583. 0x0, //Linerization
  584. 0x81, //M_LSB
  585. /*
  586. [7:6] - M: MS 2 bits
  587. [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts)
  588. */
  589. ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance
  590. 0x0, //B_LSB
  591. /*
  592. [7:6] - B: MS 2 bits
  593. Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned
  594. Accuracy exponent:
  595. [5:0] - Accuracy: LS 6 bits
  596. */
  597. ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy
  598. ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent
  599. (uint8_t)(0xfc<<4)+(0x0&0x0F), //R exponent,B exponent
  600. 0x0, //Analog Characteristics Flags
  601. 0x7f, //Nominal Reading
  602. 0xff, //Normal Maximum
  603. 0x00, //Normal Minimum
  604. 0xff, //Sensor Maximum Reading
  605. 0x00, //Sensor Minimum Reading
  606. 0xff, //Upper Non-Recoverable Threshold
  607. 0xff, //Upper Critical Threshold
  608. 0xff, //Upper Non-Critical Threshold
  609. 0x00, //Lower Non-Recoverable Threshold
  610. 0x00, //Lower Critical Threshold
  611. 0x00, //Lower Non-Critical threshold
  612. 0x0, //Positive - threshold Hysteresis value
  613. 0x0, //Negative - threshold Hysteresis value
  614. 0x0, //Reserved
  615. 0x0, //Reserved
  616. 0x0, //OEM
  617. 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code
  618. "+0.75V"
  619. },
  620. };
  621. const CompactSensorRec_T Compact_sdr_tbl[] = {
  622. {0}, //dummy sensor, make compiler happy.
  623. };