You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2215 lines
29KB

  1. /*! \addtogroup AFE_Library AFE Library
  2. * Author: Jean Rintoul , Mindseye Biomedical LLC Copyright 2018
  3. */
  4. #ifndef __LOOKUP_H__
  5. #define __LOOKUP_H__
  6. /* C++ linkage */
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif /* __cplusplus */
  10. /***************************************************************************/
  11. /* Look Up Tables 32, 192, 896 */
  12. /***************************************************************************/
  13. typedef const int16_t e_config[4];
  14. /****************************************
  15. This is the opposition sequence for 8 elextrodes where:
  16. ex_mat = eit_scan_lines(ne=8, dist=4) step = 1
  17. **********************************************/
  18. const e_config electrode_configuration_8_opposition[32] = {
  19. 0,16,8,4,
  20. 0,16,12,8,
  21. 0,16,24,20,
  22. 0,16,28,24,
  23. 4,20,12,8,
  24. 4,20,16,12,
  25. 4,20,28,24,
  26. 4,20,0,28,
  27. 8,24,4,0,
  28. 8,24,16,12,
  29. 8,24,20,16,
  30. 8,24,0,28,
  31. 12,28,4,0,
  32. 12,28,8,4,
  33. 12,28,20,16,
  34. 12,28,24,20,
  35. 16,0,8,4,
  36. 16,0,12,8,
  37. 16,0,24,20,
  38. 16,0,28,24,
  39. 20,4,12,8,
  40. 20,4,16,12,
  41. 20,4,28,24,
  42. 20,4,0,28,
  43. 24,8,4,0,
  44. 24,8,16,12,
  45. 24,8,20,16,
  46. 24,8,0,28,
  47. 28,12,4,0,
  48. 28,12,8,4,
  49. 28,12,20,16,
  50. 28,12,24,20
  51. };
  52. /****************************************
  53. This is the opposition sequence for 16 elextrodes where:
  54. ex_mat = eit_scan_lines(ne=16, dist=8) step = 8
  55. **********************************************/
  56. const e_config electrode_configuration_16_opposition[192] = {
  57. 0,16,4,2,
  58. 0,16,6,4,
  59. 0,16,8,6,
  60. 0,16,10,8,
  61. 0,16,12,10,
  62. 0,16,14,12,
  63. 0,16,20,18,
  64. 0,16,22,20,
  65. 0,16,24,22,
  66. 0,16,26,24,
  67. 0,16,28,26,
  68. 0,16,30,28,
  69. 2,18,6,4,
  70. 2,18,8,6,
  71. 2,18,10,8,
  72. 2,18,12,10,
  73. 2,18,14,12,
  74. 2,18,16,14,
  75. 2,18,22,20,
  76. 2,18,24,22,
  77. 2,18,26,24,
  78. 2,18,28,26,
  79. 2,18,30,28,
  80. 2,18,0,30,
  81. 4,20,2,0,
  82. 4,20,8,6,
  83. 4,20,10,8,
  84. 4,20,12,10,
  85. 4,20,14,12,
  86. 4,20,16,14,
  87. 4,20,18,16,
  88. 4,20,24,22,
  89. 4,20,26,24,
  90. 4,20,28,26,
  91. 4,20,30,28,
  92. 4,20,0,30,
  93. 6,22,2,0,
  94. 6,22,4,2,
  95. 6,22,10,8,
  96. 6,22,12,10,
  97. 6,22,14,12,
  98. 6,22,16,14,
  99. 6,22,18,16,
  100. 6,22,20,18,
  101. 6,22,26,24,
  102. 6,22,28,26,
  103. 6,22,30,28,
  104. 6,22,0,30,
  105. 8,24,2,0,
  106. 8,24,4,2,
  107. 8,24,6,4,
  108. 8,24,12,10,
  109. 8,24,14,12,
  110. 8,24,16,14,
  111. 8,24,18,16,
  112. 8,24,20,18,
  113. 8,24,22,20,
  114. 8,24,28,26,
  115. 8,24,30,28,
  116. 8,24,0,30,
  117. 10,26,2,0,
  118. 10,26,4,2,
  119. 10,26,6,4,
  120. 10,26,8,6,
  121. 10,26,14,12,
  122. 10,26,16,14,
  123. 10,26,18,16,
  124. 10,26,20,18,
  125. 10,26,22,20,
  126. 10,26,24,22,
  127. 10,26,30,28,
  128. 10,26,0,30,
  129. 12,28,2,0,
  130. 12,28,4,2,
  131. 12,28,6,4,
  132. 12,28,8,6,
  133. 12,28,10,8,
  134. 12,28,16,14,
  135. 12,28,18,16,
  136. 12,28,20,18,
  137. 12,28,22,20,
  138. 12,28,24,22,
  139. 12,28,26,24,
  140. 12,28,0,30,
  141. 14,30,2,0,
  142. 14,30,4,2,
  143. 14,30,6,4,
  144. 14,30,8,6,
  145. 14,30,10,8,
  146. 14,30,12,10,
  147. 14,30,18,16,
  148. 14,30,20,18,
  149. 14,30,22,20,
  150. 14,30,24,22,
  151. 14,30,26,24,
  152. 14,30,28,26,
  153. 16,0,4,2,
  154. 16,0,6,4,
  155. 16,0,8,6,
  156. 16,0,10,8,
  157. 16,0,12,10,
  158. 16,0,14,12,
  159. 16,0,20,18,
  160. 16,0,22,20,
  161. 16,0,24,22,
  162. 16,0,26,24,
  163. 16,0,28,26,
  164. 16,0,30,28,
  165. 18,2,6,4,
  166. 18,2,8,6,
  167. 18,2,10,8,
  168. 18,2,12,10,
  169. 18,2,14,12,
  170. 18,2,16,14,
  171. 18,2,22,20,
  172. 18,2,24,22,
  173. 18,2,26,24,
  174. 18,2,28,26,
  175. 18,2,30,28,
  176. 18,2,0,30,
  177. 20,4,2,0,
  178. 20,4,8,6,
  179. 20,4,10,8,
  180. 20,4,12,10,
  181. 20,4,14,12,
  182. 20,4,16,14,
  183. 20,4,18,16,
  184. 20,4,24,22,
  185. 20,4,26,24,
  186. 20,4,28,26,
  187. 20,4,30,28,
  188. 20,4,0,30,
  189. 22,6,2,0,
  190. 22,6,4,2,
  191. 22,6,10,8,
  192. 22,6,12,10,
  193. 22,6,14,12,
  194. 22,6,16,14,
  195. 22,6,18,16,
  196. 22,6,20,18,
  197. 22,6,26,24,
  198. 22,6,28,26,
  199. 22,6,30,28,
  200. 22,6,0,30,
  201. 24,8,2,0,
  202. 24,8,4,2,
  203. 24,8,6,4,
  204. 24,8,12,10,
  205. 24,8,14,12,
  206. 24,8,16,14,
  207. 24,8,18,16,
  208. 24,8,20,18,
  209. 24,8,22,20,
  210. 24,8,28,26,
  211. 24,8,30,28,
  212. 24,8,0,30,
  213. 26,10,2,0,
  214. 26,10,4,2,
  215. 26,10,6,4,
  216. 26,10,8,6,
  217. 26,10,14,12,
  218. 26,10,16,14,
  219. 26,10,18,16,
  220. 26,10,20,18,
  221. 26,10,22,20,
  222. 26,10,24,22,
  223. 26,10,30,28,
  224. 26,10,0,30,
  225. 28,12,2,0,
  226. 28,12,4,2,
  227. 28,12,6,4,
  228. 28,12,8,6,
  229. 28,12,10,8,
  230. 28,12,16,14,
  231. 28,12,18,16,
  232. 28,12,20,18,
  233. 28,12,22,20,
  234. 28,12,24,22,
  235. 28,12,26,24,
  236. 28,12,0,30,
  237. 30,14,2,0,
  238. 30,14,4,2,
  239. 30,14,6,4,
  240. 30,14,8,6,
  241. 30,14,10,8,
  242. 30,14,12,10,
  243. 30,14,18,16,
  244. 30,14,20,18,
  245. 30,14,22,20,
  246. 30,14,24,22,
  247. 30,14,26,24,
  248. 30,14,28,26
  249. };
  250. /****************************************
  251. This is the opposition sequence for 32 elextrodes where:
  252. ex_mat = eit_scan_lines(ne=32, dist=16) step = 1
  253. **********************************************/
  254. const e_config electrode_configuration_32_opposition[896] = {
  255. 0,16,2,1,
  256. 0,16,3,2,
  257. 0,16,4,3,
  258. 0,16,5,4,
  259. 0,16,6,5,
  260. 0,16,7,6,
  261. 0,16,8,7,
  262. 0,16,9,8,
  263. 0,16,10,9,
  264. 0,16,11,10,
  265. 0,16,12,11,
  266. 0,16,13,12,
  267. 0,16,14,13,
  268. 0,16,15,14,
  269. 0,16,18,17,
  270. 0,16,19,18,
  271. 0,16,20,19,
  272. 0,16,21,20,
  273. 0,16,22,21,
  274. 0,16,23,22,
  275. 0,16,24,23,
  276. 0,16,25,24,
  277. 0,16,26,25,
  278. 0,16,27,26,
  279. 0,16,28,27,
  280. 0,16,29,28,
  281. 0,16,30,29,
  282. 0,16,31,30,
  283. 1,17,3,2,
  284. 1,17,4,3,
  285. 1,17,5,4,
  286. 1,17,6,5,
  287. 1,17,7,6,
  288. 1,17,8,7,
  289. 1,17,9,8,
  290. 1,17,10,9,
  291. 1,17,11,10,
  292. 1,17,12,11,
  293. 1,17,13,12,
  294. 1,17,14,13,
  295. 1,17,15,14,
  296. 1,17,16,15,
  297. 1,17,19,18,
  298. 1,17,20,19,
  299. 1,17,21,20,
  300. 1,17,22,21,
  301. 1,17,23,22,
  302. 1,17,24,23,
  303. 1,17,25,24,
  304. 1,17,26,25,
  305. 1,17,27,26,
  306. 1,17,28,27,
  307. 1,17,29,28,
  308. 1,17,30,29,
  309. 1,17,31,30,
  310. 1,17,0,31,
  311. 2,18,1,0,
  312. 2,18,4,3,
  313. 2,18,5,4,
  314. 2,18,6,5,
  315. 2,18,7,6,
  316. 2,18,8,7,
  317. 2,18,9,8,
  318. 2,18,10,9,
  319. 2,18,11,10,
  320. 2,18,12,11,
  321. 2,18,13,12,
  322. 2,18,14,13,
  323. 2,18,15,14,
  324. 2,18,16,15,
  325. 2,18,17,16,
  326. 2,18,20,19,
  327. 2,18,21,20,
  328. 2,18,22,21,
  329. 2,18,23,22,
  330. 2,18,24,23,
  331. 2,18,25,24,
  332. 2,18,26,25,
  333. 2,18,27,26,
  334. 2,18,28,27,
  335. 2,18,29,28,
  336. 2,18,30,29,
  337. 2,18,31,30,
  338. 2,18,0,31,
  339. 3,19,1,0,
  340. 3,19,2,1,
  341. 3,19,5,4,
  342. 3,19,6,5,
  343. 3,19,7,6,
  344. 3,19,8,7,
  345. 3,19,9,8,
  346. 3,19,10,9,
  347. 3,19,11,10,
  348. 3,19,12,11,
  349. 3,19,13,12,
  350. 3,19,14,13,
  351. 3,19,15,14,
  352. 3,19,16,15,
  353. 3,19,17,16,
  354. 3,19,18,17,
  355. 3,19,21,20,
  356. 3,19,22,21,
  357. 3,19,23,22,
  358. 3,19,24,23,
  359. 3,19,25,24,
  360. 3,19,26,25,
  361. 3,19,27,26,
  362. 3,19,28,27,
  363. 3,19,29,28,
  364. 3,19,30,29,
  365. 3,19,31,30,
  366. 3,19,0,31,
  367. 4,20,1,0,
  368. 4,20,2,1,
  369. 4,20,3,2,
  370. 4,20,6,5,
  371. 4,20,7,6,
  372. 4,20,8,7,
  373. 4,20,9,8,
  374. 4,20,10,9,
  375. 4,20,11,10,
  376. 4,20,12,11,
  377. 4,20,13,12,
  378. 4,20,14,13,
  379. 4,20,15,14,
  380. 4,20,16,15,
  381. 4,20,17,16,
  382. 4,20,18,17,
  383. 4,20,19,18,
  384. 4,20,22,21,
  385. 4,20,23,22,
  386. 4,20,24,23,
  387. 4,20,25,24,
  388. 4,20,26,25,
  389. 4,20,27,26,
  390. 4,20,28,27,
  391. 4,20,29,28,
  392. 4,20,30,29,
  393. 4,20,31,30,
  394. 4,20,0,31,
  395. 5,21,1,0,
  396. 5,21,2,1,
  397. 5,21,3,2,
  398. 5,21,4,3,
  399. 5,21,7,6,
  400. 5,21,8,7,
  401. 5,21,9,8,
  402. 5,21,10,9,
  403. 5,21,11,10,
  404. 5,21,12,11,
  405. 5,21,13,12,
  406. 5,21,14,13,
  407. 5,21,15,14,
  408. 5,21,16,15,
  409. 5,21,17,16,
  410. 5,21,18,17,
  411. 5,21,19,18,
  412. 5,21,20,19,
  413. 5,21,23,22,
  414. 5,21,24,23,
  415. 5,21,25,24,
  416. 5,21,26,25,
  417. 5,21,27,26,
  418. 5,21,28,27,
  419. 5,21,29,28,
  420. 5,21,30,29,
  421. 5,21,31,30,
  422. 5,21,0,31,
  423. 6,22,1,0,
  424. 6,22,2,1,
  425. 6,22,3,2,
  426. 6,22,4,3,
  427. 6,22,5,4,
  428. 6,22,8,7,
  429. 6,22,9,8,
  430. 6,22,10,9,
  431. 6,22,11,10,
  432. 6,22,12,11,
  433. 6,22,13,12,
  434. 6,22,14,13,
  435. 6,22,15,14,
  436. 6,22,16,15,
  437. 6,22,17,16,
  438. 6,22,18,17,
  439. 6,22,19,18,
  440. 6,22,20,19,
  441. 6,22,21,20,
  442. 6,22,24,23,
  443. 6,22,25,24,
  444. 6,22,26,25,
  445. 6,22,27,26,
  446. 6,22,28,27,
  447. 6,22,29,28,
  448. 6,22,30,29,
  449. 6,22,31,30,
  450. 6,22,0,31,
  451. 7,23,1,0,
  452. 7,23,2,1,
  453. 7,23,3,2,
  454. 7,23,4,3,
  455. 7,23,5,4,
  456. 7,23,6,5,
  457. 7,23,9,8,
  458. 7,23,10,9,
  459. 7,23,11,10,
  460. 7,23,12,11,
  461. 7,23,13,12,
  462. 7,23,14,13,
  463. 7,23,15,14,
  464. 7,23,16,15,
  465. 7,23,17,16,
  466. 7,23,18,17,
  467. 7,23,19,18,
  468. 7,23,20,19,
  469. 7,23,21,20,
  470. 7,23,22,21,
  471. 7,23,25,24,
  472. 7,23,26,25,
  473. 7,23,27,26,
  474. 7,23,28,27,
  475. 7,23,29,28,
  476. 7,23,30,29,
  477. 7,23,31,30,
  478. 7,23,0,31,
  479. 8,24,1,0,
  480. 8,24,2,1,
  481. 8,24,3,2,
  482. 8,24,4,3,
  483. 8,24,5,4,
  484. 8,24,6,5,
  485. 8,24,7,6,
  486. 8,24,10,9,
  487. 8,24,11,10,
  488. 8,24,12,11,
  489. 8,24,13,12,
  490. 8,24,14,13,
  491. 8,24,15,14,
  492. 8,24,16,15,
  493. 8,24,17,16,
  494. 8,24,18,17,
  495. 8,24,19,18,
  496. 8,24,20,19,
  497. 8,24,21,20,
  498. 8,24,22,21,
  499. 8,24,23,22,
  500. 8,24,26,25,
  501. 8,24,27,26,
  502. 8,24,28,27,
  503. 8,24,29,28,
  504. 8,24,30,29,
  505. 8,24,31,30,
  506. 8,24,0,31,
  507. 9,25,1,0,
  508. 9,25,2,1,
  509. 9,25,3,2,
  510. 9,25,4,3,
  511. 9,25,5,4,
  512. 9,25,6,5,
  513. 9,25,7,6,
  514. 9,25,8,7,
  515. 9,25,11,10,
  516. 9,25,12,11,
  517. 9,25,13,12,
  518. 9,25,14,13,
  519. 9,25,15,14,
  520. 9,25,16,15,
  521. 9,25,17,16,
  522. 9,25,18,17,
  523. 9,25,19,18,
  524. 9,25,20,19,
  525. 9,25,21,20,
  526. 9,25,22,21,
  527. 9,25,23,22,
  528. 9,25,24,23,
  529. 9,25,27,26,
  530. 9,25,28,27,
  531. 9,25,29,28,
  532. 9,25,30,29,
  533. 9,25,31,30,
  534. 9,25,0,31,
  535. 10,26,1,0,
  536. 10,26,2,1,
  537. 10,26,3,2,
  538. 10,26,4,3,
  539. 10,26,5,4,
  540. 10,26,6,5,
  541. 10,26,7,6,
  542. 10,26,8,7,
  543. 10,26,9,8,
  544. 10,26,12,11,
  545. 10,26,13,12,
  546. 10,26,14,13,
  547. 10,26,15,14,
  548. 10,26,16,15,
  549. 10,26,17,16,
  550. 10,26,18,17,
  551. 10,26,19,18,
  552. 10,26,20,19,
  553. 10,26,21,20,
  554. 10,26,22,21,
  555. 10,26,23,22,
  556. 10,26,24,23,
  557. 10,26,25,24,
  558. 10,26,28,27,
  559. 10,26,29,28,
  560. 10,26,30,29,
  561. 10,26,31,30,
  562. 10,26,0,31,
  563. 11,27,1,0,
  564. 11,27,2,1,
  565. 11,27,3,2,
  566. 11,27,4,3,
  567. 11,27,5,4,
  568. 11,27,6,5,
  569. 11,27,7,6,
  570. 11,27,8,7,
  571. 11,27,9,8,
  572. 11,27,10,9,
  573. 11,27,13,12,
  574. 11,27,14,13,
  575. 11,27,15,14,
  576. 11,27,16,15,
  577. 11,27,17,16,
  578. 11,27,18,17,
  579. 11,27,19,18,
  580. 11,27,20,19,
  581. 11,27,21,20,
  582. 11,27,22,21,
  583. 11,27,23,22,
  584. 11,27,24,23,
  585. 11,27,25,24,
  586. 11,27,26,25,
  587. 11,27,29,28,
  588. 11,27,30,29,
  589. 11,27,31,30,
  590. 11,27,0,31,
  591. 12,28,1,0,
  592. 12,28,2,1,
  593. 12,28,3,2,
  594. 12,28,4,3,
  595. 12,28,5,4,
  596. 12,28,6,5,
  597. 12,28,7,6,
  598. 12,28,8,7,
  599. 12,28,9,8,
  600. 12,28,10,9,
  601. 12,28,11,10,
  602. 12,28,14,13,
  603. 12,28,15,14,
  604. 12,28,16,15,
  605. 12,28,17,16,
  606. 12,28,18,17,
  607. 12,28,19,18,
  608. 12,28,20,19,
  609. 12,28,21,20,
  610. 12,28,22,21,
  611. 12,28,23,22,
  612. 12,28,24,23,
  613. 12,28,25,24,
  614. 12,28,26,25,
  615. 12,28,27,26,
  616. 12,28,30,29,
  617. 12,28,31,30,
  618. 12,28,0,31,
  619. 13,29,1,0,
  620. 13,29,2,1,
  621. 13,29,3,2,
  622. 13,29,4,3,
  623. 13,29,5,4,
  624. 13,29,6,5,
  625. 13,29,7,6,
  626. 13,29,8,7,
  627. 13,29,9,8,
  628. 13,29,10,9,
  629. 13,29,11,10,
  630. 13,29,12,11,
  631. 13,29,15,14,
  632. 13,29,16,15,
  633. 13,29,17,16,
  634. 13,29,18,17,
  635. 13,29,19,18,
  636. 13,29,20,19,
  637. 13,29,21,20,
  638. 13,29,22,21,
  639. 13,29,23,22,
  640. 13,29,24,23,
  641. 13,29,25,24,
  642. 13,29,26,25,
  643. 13,29,27,26,
  644. 13,29,28,27,
  645. 13,29,31,30,
  646. 13,29,0,31,
  647. 14,30,1,0,
  648. 14,30,2,1,
  649. 14,30,3,2,
  650. 14,30,4,3,
  651. 14,30,5,4,
  652. 14,30,6,5,
  653. 14,30,7,6,
  654. 14,30,8,7,
  655. 14,30,9,8,
  656. 14,30,10,9,
  657. 14,30,11,10,
  658. 14,30,12,11,
  659. 14,30,13,12,
  660. 14,30,16,15,
  661. 14,30,17,16,
  662. 14,30,18,17,
  663. 14,30,19,18,
  664. 14,30,20,19,
  665. 14,30,21,20,
  666. 14,30,22,21,
  667. 14,30,23,22,
  668. 14,30,24,23,
  669. 14,30,25,24,
  670. 14,30,26,25,
  671. 14,30,27,26,
  672. 14,30,28,27,
  673. 14,30,29,28,
  674. 14,30,0,31,
  675. 15,31,1,0,
  676. 15,31,2,1,
  677. 15,31,3,2,
  678. 15,31,4,3,
  679. 15,31,5,4,
  680. 15,31,6,5,
  681. 15,31,7,6,
  682. 15,31,8,7,
  683. 15,31,9,8,
  684. 15,31,10,9,
  685. 15,31,11,10,
  686. 15,31,12,11,
  687. 15,31,13,12,
  688. 15,31,14,13,
  689. 15,31,17,16,
  690. 15,31,18,17,
  691. 15,31,19,18,
  692. 15,31,20,19,
  693. 15,31,21,20,
  694. 15,31,22,21,
  695. 15,31,23,22,
  696. 15,31,24,23,
  697. 15,31,25,24,
  698. 15,31,26,25,
  699. 15,31,27,26,
  700. 15,31,28,27,
  701. 15,31,29,28,
  702. 15,31,30,29,
  703. 16,0,2,1,
  704. 16,0,3,2,
  705. 16,0,4,3,
  706. 16,0,5,4,
  707. 16,0,6,5,
  708. 16,0,7,6,
  709. 16,0,8,7,
  710. 16,0,9,8,
  711. 16,0,10,9,
  712. 16,0,11,10,
  713. 16,0,12,11,
  714. 16,0,13,12,
  715. 16,0,14,13,
  716. 16,0,15,14,
  717. 16,0,18,17,
  718. 16,0,19,18,
  719. 16,0,20,19,
  720. 16,0,21,20,
  721. 16,0,22,21,
  722. 16,0,23,22,
  723. 16,0,24,23,
  724. 16,0,25,24,
  725. 16,0,26,25,
  726. 16,0,27,26,
  727. 16,0,28,27,
  728. 16,0,29,28,
  729. 16,0,30,29,
  730. 16,0,31,30,
  731. 17,1,3,2,
  732. 17,1,4,3,
  733. 17,1,5,4,
  734. 17,1,6,5,
  735. 17,1,7,6,
  736. 17,1,8,7,
  737. 17,1,9,8,
  738. 17,1,10,9,
  739. 17,1,11,10,
  740. 17,1,12,11,
  741. 17,1,13,12,
  742. 17,1,14,13,
  743. 17,1,15,14,
  744. 17,1,16,15,
  745. 17,1,19,18,
  746. 17,1,20,19,
  747. 17,1,21,20,
  748. 17,1,22,21,
  749. 17,1,23,22,
  750. 17,1,24,23,
  751. 17,1,25,24,
  752. 17,1,26,25,
  753. 17,1,27,26,
  754. 17,1,28,27,
  755. 17,1,29,28,
  756. 17,1,30,29,
  757. 17,1,31,30,
  758. 17,1,0,31,
  759. 18,2,1,0,
  760. 18,2,4,3,
  761. 18,2,5,4,
  762. 18,2,6,5,
  763. 18,2,7,6,
  764. 18,2,8,7,
  765. 18,2,9,8,
  766. 18,2,10,9,
  767. 18,2,11,10,
  768. 18,2,12,11,
  769. 18,2,13,12,
  770. 18,2,14,13,
  771. 18,2,15,14,
  772. 18,2,16,15,
  773. 18,2,17,16,
  774. 18,2,20,19,
  775. 18,2,21,20,
  776. 18,2,22,21,
  777. 18,2,23,22,
  778. 18,2,24,23,
  779. 18,2,25,24,
  780. 18,2,26,25,
  781. 18,2,27,26,
  782. 18,2,28,27,
  783. 18,2,29,28,
  784. 18,2,30,29,
  785. 18,2,31,30,
  786. 18,2,0,31,
  787. 19,3,1,0,
  788. 19,3,2,1,
  789. 19,3,5,4,
  790. 19,3,6,5,
  791. 19,3,7,6,
  792. 19,3,8,7,
  793. 19,3,9,8,
  794. 19,3,10,9,
  795. 19,3,11,10,
  796. 19,3,12,11,
  797. 19,3,13,12,
  798. 19,3,14,13,
  799. 19,3,15,14,
  800. 19,3,16,15,
  801. 19,3,17,16,
  802. 19,3,18,17,
  803. 19,3,21,20,
  804. 19,3,22,21,
  805. 19,3,23,22,
  806. 19,3,24,23,
  807. 19,3,25,24,
  808. 19,3,26,25,
  809. 19,3,27,26,
  810. 19,3,28,27,
  811. 19,3,29,28,
  812. 19,3,30,29,
  813. 19,3,31,30,
  814. 19,3,0,31,
  815. 20,4,1,0,
  816. 20,4,2,1,
  817. 20,4,3,2,
  818. 20,4,6,5,
  819. 20,4,7,6,
  820. 20,4,8,7,
  821. 20,4,9,8,
  822. 20,4,10,9,
  823. 20,4,11,10,
  824. 20,4,12,11,
  825. 20,4,13,12,
  826. 20,4,14,13,
  827. 20,4,15,14,
  828. 20,4,16,15,
  829. 20,4,17,16,
  830. 20,4,18,17,
  831. 20,4,19,18,
  832. 20,4,22,21,
  833. 20,4,23,22,
  834. 20,4,24,23,
  835. 20,4,25,24,
  836. 20,4,26,25,
  837. 20,4,27,26,
  838. 20,4,28,27,
  839. 20,4,29,28,
  840. 20,4,30,29,
  841. 20,4,31,30,
  842. 20,4,0,31,
  843. 21,5,1,0,
  844. 21,5,2,1,
  845. 21,5,3,2,
  846. 21,5,4,3,
  847. 21,5,7,6,
  848. 21,5,8,7,
  849. 21,5,9,8,
  850. 21,5,10,9,
  851. 21,5,11,10,
  852. 21,5,12,11,
  853. 21,5,13,12,
  854. 21,5,14,13,
  855. 21,5,15,14,
  856. 21,5,16,15,
  857. 21,5,17,16,
  858. 21,5,18,17,
  859. 21,5,19,18,
  860. 21,5,20,19,
  861. 21,5,23,22,
  862. 21,5,24,23,
  863. 21,5,25,24,
  864. 21,5,26,25,
  865. 21,5,27,26,
  866. 21,5,28,27,
  867. 21,5,29,28,
  868. 21,5,30,29,
  869. 21,5,31,30,
  870. 21,5,0,31,
  871. 22,6,1,0,
  872. 22,6,2,1,
  873. 22,6,3,2,
  874. 22,6,4,3,
  875. 22,6,5,4,
  876. 22,6,8,7,
  877. 22,6,9,8,
  878. 22,6,10,9,
  879. 22,6,11,10,
  880. 22,6,12,11,
  881. 22,6,13,12,
  882. 22,6,14,13,
  883. 22,6,15,14,
  884. 22,6,16,15,
  885. 22,6,17,16,
  886. 22,6,18,17,
  887. 22,6,19,18,
  888. 22,6,20,19,
  889. 22,6,21,20,
  890. 22,6,24,23,
  891. 22,6,25,24,
  892. 22,6,26,25,
  893. 22,6,27,26,
  894. 22,6,28,27,
  895. 22,6,29,28,
  896. 22,6,30,29,
  897. 22,6,31,30,
  898. 22,6,0,31,
  899. 23,7,1,0,
  900. 23,7,2,1,
  901. 23,7,3,2,
  902. 23,7,4,3,
  903. 23,7,5,4,
  904. 23,7,6,5,
  905. 23,7,9,8,
  906. 23,7,10,9,
  907. 23,7,11,10,
  908. 23,7,12,11,
  909. 23,7,13,12,
  910. 23,7,14,13,
  911. 23,7,15,14,
  912. 23,7,16,15,
  913. 23,7,17,16,
  914. 23,7,18,17,
  915. 23,7,19,18,
  916. 23,7,20,19,
  917. 23,7,21,20,
  918. 23,7,22,21,
  919. 23,7,25,24,
  920. 23,7,26,25,
  921. 23,7,27,26,
  922. 23,7,28,27,
  923. 23,7,29,28,
  924. 23,7,30,29,
  925. 23,7,31,30,
  926. 23,7,0,31,
  927. 24,8,1,0,
  928. 24,8,2,1,
  929. 24,8,3,2,
  930. 24,8,4,3,
  931. 24,8,5,4,
  932. 24,8,6,5,
  933. 24,8,7,6,
  934. 24,8,10,9,
  935. 24,8,11,10,
  936. 24,8,12,11,
  937. 24,8,13,12,
  938. 24,8,14,13,
  939. 24,8,15,14,
  940. 24,8,16,15,
  941. 24,8,17,16,
  942. 24,8,18,17,
  943. 24,8,19,18,
  944. 24,8,20,19,
  945. 24,8,21,20,
  946. 24,8,22,21,
  947. 24,8,23,22,
  948. 24,8,26,25,
  949. 24,8,27,26,
  950. 24,8,28,27,
  951. 24,8,29,28,
  952. 24,8,30,29,
  953. 24,8,31,30,
  954. 24,8,0,31,
  955. 25,9,1,0,
  956. 25,9,2,1,
  957. 25,9,3,2,
  958. 25,9,4,3,
  959. 25,9,5,4,
  960. 25,9,6,5,
  961. 25,9,7,6,
  962. 25,9,8,7,
  963. 25,9,11,10,
  964. 25,9,12,11,
  965. 25,9,13,12,
  966. 25,9,14,13,
  967. 25,9,15,14,
  968. 25,9,16,15,
  969. 25,9,17,16,
  970. 25,9,18,17,
  971. 25,9,19,18,
  972. 25,9,20,19,
  973. 25,9,21,20,
  974. 25,9,22,21,
  975. 25,9,23,22,
  976. 25,9,24,23,
  977. 25,9,27,26,
  978. 25,9,28,27,
  979. 25,9,29,28,
  980. 25,9,30,29,
  981. 25,9,31,30,
  982. 25,9,0,31,
  983. 26,10,1,0,
  984. 26,10,2,1,
  985. 26,10,3,2,
  986. 26,10,4,3,
  987. 26,10,5,4,
  988. 26,10,6,5,
  989. 26,10,7,6,
  990. 26,10,8,7,
  991. 26,10,9,8,
  992. 26,10,12,11,
  993. 26,10,13,12,
  994. 26,10,14,13,
  995. 26,10,15,14,
  996. 26,10,16,15,
  997. 26,10,17,16,
  998. 26,10,18,17,
  999. 26,10,19,18,
  1000. 26,10,20,19,
  1001. 26,10,21,20,
  1002. 26,10,22,21,
  1003. 26,10,23,22,
  1004. 26,10,24,23,
  1005. 26,10,25,24,
  1006. 26,10,28,27,
  1007. 26,10,29,28,
  1008. 26,10,30,29,
  1009. 26,10,31,30,
  1010. 26,10,0,31,
  1011. 27,11,1,0,
  1012. 27,11,2,1,
  1013. 27,11,3,2,
  1014. 27,11,4,3,
  1015. 27,11,5,4,
  1016. 27,11,6,5,
  1017. 27,11,7,6,
  1018. 27,11,8,7,
  1019. 27,11,9,8,
  1020. 27,11,10,9,
  1021. 27,11,13,12,
  1022. 27,11,14,13,
  1023. 27,11,15,14,
  1024. 27,11,16,15,
  1025. 27,11,17,16,
  1026. 27,11,18,17,
  1027. 27,11,19,18,
  1028. 27,11,20,19,
  1029. 27,11,21,20,
  1030. 27,11,22,21,
  1031. 27,11,23,22,
  1032. 27,11,24,23,
  1033. 27,11,25,24,
  1034. 27,11,26,25,
  1035. 27,11,29,28,
  1036. 27,11,30,29,
  1037. 27,11,31,30,
  1038. 27,11,0,31,
  1039. 28,12,1,0,
  1040. 28,12,2,1,
  1041. 28,12,3,2,
  1042. 28,12,4,3,
  1043. 28,12,5,4,
  1044. 28,12,6,5,
  1045. 28,12,7,6,
  1046. 28,12,8,7,
  1047. 28,12,9,8,
  1048. 28,12,10,9,
  1049. 28,12,11,10,
  1050. 28,12,14,13,
  1051. 28,12,15,14,
  1052. 28,12,16,15,
  1053. 28,12,17,16,
  1054. 28,12,18,17,
  1055. 28,12,19,18,
  1056. 28,12,20,19,
  1057. 28,12,21,20,
  1058. 28,12,22,21,
  1059. 28,12,23,22,
  1060. 28,12,24,23,
  1061. 28,12,25,24,
  1062. 28,12,26,25,
  1063. 28,12,27,26,
  1064. 28,12,30,29,
  1065. 28,12,31,30,
  1066. 28,12,0,31,
  1067. 29,13,1,0,
  1068. 29,13,2,1,
  1069. 29,13,3,2,
  1070. 29,13,4,3,
  1071. 29,13,5,4,
  1072. 29,13,6,5,
  1073. 29,13,7,6,
  1074. 29,13,8,7,
  1075. 29,13,9,8,
  1076. 29,13,10,9,
  1077. 29,13,11,10,
  1078. 29,13,12,11,
  1079. 29,13,15,14,
  1080. 29,13,16,15,
  1081. 29,13,17,16,
  1082. 29,13,18,17,
  1083. 29,13,19,18,
  1084. 29,13,20,19,
  1085. 29,13,21,20,
  1086. 29,13,22,21,
  1087. 29,13,23,22,
  1088. 29,13,24,23,
  1089. 29,13,25,24,
  1090. 29,13,26,25,
  1091. 29,13,27,26,
  1092. 29,13,28,27,
  1093. 29,13,31,30,
  1094. 29,13,0,31,
  1095. 30,14,1,0,
  1096. 30,14,2,1,
  1097. 30,14,3,2,
  1098. 30,14,4,3,
  1099. 30,14,5,4,
  1100. 30,14,6,5,
  1101. 30,14,7,6,
  1102. 30,14,8,7,
  1103. 30,14,9,8,
  1104. 30,14,10,9,
  1105. 30,14,11,10,
  1106. 30,14,12,11,
  1107. 30,14,13,12,
  1108. 30,14,16,15,
  1109. 30,14,17,16,
  1110. 30,14,18,17,
  1111. 30,14,19,18,
  1112. 30,14,20,19,
  1113. 30,14,21,20,
  1114. 30,14,22,21,
  1115. 30,14,23,22,
  1116. 30,14,24,23,
  1117. 30,14,25,24,
  1118. 30,14,26,25,
  1119. 30,14,27,26,
  1120. 30,14,28,27,
  1121. 30,14,29,28,
  1122. 30,14,0,31,
  1123. 31,15,1,0,
  1124. 31,15,2,1,
  1125. 31,15,3,2,
  1126. 31,15,4,3,
  1127. 31,15,5,4,
  1128. 31,15,6,5,
  1129. 31,15,7,6,
  1130. 31,15,8,7,
  1131. 31,15,9,8,
  1132. 31,15,10,9,
  1133. 31,15,11,10,
  1134. 31,15,12,11,
  1135. 31,15,13,12,
  1136. 31,15,14,13,
  1137. 31,15,17,16,
  1138. 31,15,18,17,
  1139. 31,15,19,18,
  1140. 31,15,20,19,
  1141. 31,15,21,20,
  1142. 31,15,22,21,
  1143. 31,15,23,22,
  1144. 31,15,24,23,
  1145. 31,15,25,24,
  1146. 31,15,26,25,
  1147. 31,15,27,26,
  1148. 31,15,28,27,
  1149. 31,15,29,28,
  1150. 31,15,30,29
  1151. };
  1152. /****************************************
  1153. This is the 928 adjacent sequence where:
  1154. // In the file the ordering is:
  1155. A+, A-, V+, V-
  1156. A, B, M, N
  1157. Other orders include:
  1158. with one pos (A), neg(B) driven pairs.
  1159. A : current driving electrode
  1160. B : current sink
  1161. M, N : boundary electrodes, where v_diff = v_n - v_m
  1162. **********************************************/
  1163. const e_config electrode_configuration_32_adjacent[928] = {
  1164. {0,1,2,3},
  1165. {0,1,3,4},
  1166. {0,1,4,5},
  1167. {0,1,5,6},
  1168. {0,1,6,7},
  1169. {0,1,7,8},
  1170. {0,1,8,9},
  1171. {0,1,9,10},
  1172. {0,1,10,11},
  1173. {0,1,11,12},
  1174. {0,1,12,13},
  1175. {0,1,13,14},
  1176. {0,1,14,15},
  1177. {0,1,15,16},
  1178. {0,1,16,17},
  1179. {0,1,17,18},
  1180. {0,1,18,19},
  1181. {0,1,19,20},
  1182. {0,1,20,21},
  1183. {0,1,21,22},
  1184. {0,1,22,23},
  1185. {0,1,23,24},
  1186. {0,1,24,25},
  1187. {0,1,25,26},
  1188. {0,1,26,27},
  1189. {0,1,27,28},
  1190. {0,1,28,29},
  1191. {0,1,29,30},
  1192. {0,1,30,31},
  1193. {1,2,3,4},
  1194. {1,2,4,5},
  1195. {1,2,5,6},
  1196. {1,2,6,7},
  1197. {1,2,7,8},
  1198. {1,2,8,9},
  1199. {1,2,9,10},
  1200. {1,2,10,11},
  1201. {1,2,11,12},
  1202. {1,2,12,13},
  1203. {1,2,13,14},
  1204. {1,2,14,15},
  1205. {1,2,15,16},
  1206. {1,2,16,17},
  1207. {1,2,17,18},
  1208. {1,2,18,19},
  1209. {1,2,19,20},
  1210. {1,2,20,21},
  1211. {1,2,21,22},
  1212. {1,2,22,23},
  1213. {1,2,23,24},
  1214. {1,2,24,25},
  1215. {1,2,25,26},
  1216. {1,2,26,27},
  1217. {1,2,27,28},
  1218. {1,2,28,29},
  1219. {1,2,29,30},
  1220. {1,2,30,31},
  1221. {1,2,31,0},
  1222. {2,3,0,1},
  1223. {2,3,4,5},
  1224. {2,3,5,6},
  1225. {2,3,6,7},
  1226. {2,3,7,8},
  1227. {2,3,8,9},
  1228. {2,3,9,10},
  1229. {2,3,10,11},
  1230. {2,3,11,12},
  1231. {2,3,12,13},
  1232. {2,3,13,14},
  1233. {2,3,14,15},
  1234. {2,3,15,16},
  1235. {2,3,16,17},
  1236. {2,3,17,18},
  1237. {2,3,18,19},
  1238. {2,3,19,20},
  1239. {2,3,20,21},
  1240. {2,3,21,22},
  1241. {2,3,22,23},
  1242. {2,3,23,24},
  1243. {2,3,24,25},
  1244. {2,3,25,26},
  1245. {2,3,26,27},
  1246. {2,3,27,28},
  1247. {2,3,28,29},
  1248. {2,3,29,30},
  1249. {2,3,30,31},
  1250. {2,3,31,0},
  1251. {3,4,0,1},
  1252. {3,4,1,2},
  1253. {3,4,5,6},
  1254. {3,4,6,7},
  1255. {3,4,7,8},
  1256. {3,4,8,9},
  1257. {3,4,9,10},
  1258. {3,4,10,11},
  1259. {3,4,11,12},
  1260. {3,4,12,13},
  1261. {3,4,13,14},
  1262. {3,4,14,15},
  1263. {3,4,15,16},
  1264. {3,4,16,17},
  1265. {3,4,17,18},
  1266. {3,4,18,19},
  1267. {3,4,19,20},
  1268. {3,4,20,21},
  1269. {3,4,21,22},
  1270. {3,4,22,23},
  1271. {3,4,23,24},
  1272. {3,4,24,25},
  1273. {3,4,25,26},
  1274. {3,4,26,27},
  1275. {3,4,27,28},
  1276. {3,4,28,29},
  1277. {3,4,29,30},
  1278. {3,4,30,31},
  1279. {3,4,31,0},
  1280. {4,5,0,1},
  1281. {4,5,1,2},
  1282. {4,5,2,3},
  1283. {4,5,6,7},
  1284. {4,5,7,8},
  1285. {4,5,8,9},
  1286. {4,5,9,10},
  1287. {4,5,10,11},
  1288. {4,5,11,12},
  1289. {4,5,12,13},
  1290. {4,5,13,14},
  1291. {4,5,14,15},
  1292. {4,5,15,16},
  1293. {4,5,16,17},
  1294. {4,5,17,18},
  1295. {4,5,18,19},
  1296. {4,5,19,20},
  1297. {4,5,20,21},
  1298. {4,5,21,22},
  1299. {4,5,22,23},
  1300. {4,5,23,24},
  1301. {4,5,24,25},
  1302. {4,5,25,26},
  1303. {4,5,26,27},
  1304. {4,5,27,28},
  1305. {4,5,28,29},
  1306. {4,5,29,30},
  1307. {4,5,30,31},
  1308. {4,5,31,0},
  1309. {5,6,0,1},
  1310. {5,6,1,2},
  1311. {5,6,2,3},
  1312. {5,6,3,4},
  1313. {5,6,7,8},
  1314. {5,6,8,9},
  1315. {5,6,9,10},
  1316. {5,6,10,11},
  1317. {5,6,11,12},
  1318. {5,6,12,13},
  1319. {5,6,13,14},
  1320. {5,6,14,15},
  1321. {5,6,15,16},
  1322. {5,6,16,17},
  1323. {5,6,17,18},
  1324. {5,6,18,19},
  1325. {5,6,19,20},
  1326. {5,6,20,21},
  1327. {5,6,21,22},
  1328. {5,6,22,23},
  1329. {5,6,23,24},
  1330. {5,6,24,25},
  1331. {5,6,25,26},
  1332. {5,6,26,27},
  1333. {5,6,27,28},
  1334. {5,6,28,29},
  1335. {5,6,29,30},
  1336. {5,6,30,31},
  1337. {5,6,31,0},
  1338. {6,7,0,1},
  1339. {6,7,1,2},
  1340. {6,7,2,3},
  1341. {6,7,3,4},
  1342. {6,7,4,5},
  1343. {6,7,8,9},
  1344. {6,7,9,10},
  1345. {6,7,10,11},
  1346. {6,7,11,12},
  1347. {6,7,12,13},
  1348. {6,7,13,14},
  1349. {6,7,14,15},
  1350. {6,7,15,16},
  1351. {6,7,16,17},
  1352. {6,7,17,18},
  1353. {6,7,18,19},
  1354. {6,7,19,20},
  1355. {6,7,20,21},
  1356. {6,7,21,22},
  1357. {6,7,22,23},
  1358. {6,7,23,24},
  1359. {6,7,24,25},
  1360. {6,7,25,26},
  1361. {6,7,26,27},
  1362. {6,7,27,28},
  1363. {6,7,28,29},
  1364. {6,7,29,30},
  1365. {6,7,30,31},
  1366. {6,7,31,0},
  1367. {7,8,0,1},
  1368. {7,8,1,2},
  1369. {7,8,2,3},
  1370. {7,8,3,4},
  1371. {7,8,4,5},
  1372. {7,8,5,6},
  1373. {7,8,9,10},
  1374. {7,8,10,11},
  1375. {7,8,11,12},
  1376. {7,8,12,13},
  1377. {7,8,13,14},
  1378. {7,8,14,15},
  1379. {7,8,15,16},
  1380. {7,8,16,17},
  1381. {7,8,17,18},
  1382. {7,8,18,19},
  1383. {7,8,19,20},
  1384. {7,8,20,21},
  1385. {7,8,21,22},
  1386. {7,8,22,23},
  1387. {7,8,23,24},
  1388. {7,8,24,25},
  1389. {7,8,25,26},
  1390. {7,8,26,27},
  1391. {7,8,27,28},
  1392. {7,8,28,29},
  1393. {7,8,29,30},
  1394. {7,8,30,31},
  1395. {7,8,31,0},
  1396. {8,9,0,1},
  1397. {8,9,1,2},
  1398. {8,9,2,3},
  1399. {8,9,3,4},
  1400. {8,9,4,5},
  1401. {8,9,5,6},
  1402. {8,9,6,7},
  1403. {8,9,10,11},
  1404. {8,9,11,12},
  1405. {8,9,12,13},
  1406. {8,9,13,14},
  1407. {8,9,14,15},
  1408. {8,9,15,16},
  1409. {8,9,16,17},
  1410. {8,9,17,18},
  1411. {8,9,18,19},
  1412. {8,9,19,20},
  1413. {8,9,20,21},
  1414. {8,9,21,22},
  1415. {8,9,22,23},
  1416. {8,9,23,24},
  1417. {8,9,24,25},
  1418. {8,9,25,26},
  1419. {8,9,26,27},
  1420. {8,9,27,28},
  1421. {8,9,28,29},
  1422. {8,9,29,30},
  1423. {8,9,30,31},
  1424. {8,9,31,0},
  1425. {9,10,0,1},
  1426. {9,10,1,2},
  1427. {9,10,2,3},
  1428. {9,10,3,4},
  1429. {9,10,4,5},
  1430. {9,10,5,6},
  1431. {9,10,6,7},
  1432. {9,10,7,8},
  1433. {9,10,11,12},
  1434. {9,10,12,13},
  1435. {9,10,13,14},
  1436. {9,10,14,15},
  1437. {9,10,15,16},
  1438. {9,10,16,17},
  1439. {9,10,17,18},
  1440. {9,10,18,19},
  1441. {9,10,19,20},
  1442. {9,10,20,21},
  1443. {9,10,21,22},
  1444. {9,10,22,23},
  1445. {9,10,23,24},
  1446. {9,10,24,25},
  1447. {9,10,25,26},
  1448. {9,10,26,27},
  1449. {9,10,27,28},
  1450. {9,10,28,29},
  1451. {9,10,29,30},
  1452. {9,10,30,31},
  1453. {9,10,31,0},
  1454. {10,11,0,1},
  1455. {10,11,1,2},
  1456. {10,11,2,3},
  1457. {10,11,3,4},
  1458. {10,11,4,5},
  1459. {10,11,5,6},
  1460. {10,11,6,7},
  1461. {10,11,7,8},
  1462. {10,11,8,9},
  1463. {10,11,12,13},
  1464. {10,11,13,14},
  1465. {10,11,14,15},
  1466. {10,11,15,16},
  1467. {10,11,16,17},
  1468. {10,11,17,18},
  1469. {10,11,18,19},
  1470. {10,11,19,20},
  1471. {10,11,20,21},
  1472. {10,11,21,22},
  1473. {10,11,22,23},
  1474. {10,11,23,24},
  1475. {10,11,24,25},
  1476. {10,11,25,26},
  1477. {10,11,26,27},
  1478. {10,11,27,28},
  1479. {10,11,28,29},
  1480. {10,11,29,30},
  1481. {10,11,30,31},
  1482. {10,11,31,0},
  1483. {11,12,0,1},
  1484. {11,12,1,2},
  1485. {11,12,2,3},
  1486. {11,12,3,4},
  1487. {11,12,4,5},
  1488. {11,12,5,6},
  1489. {11,12,6,7},
  1490. {11,12,7,8},
  1491. {11,12,8,9},
  1492. {11,12,9,10},
  1493. {11,12,13,14},
  1494. {11,12,14,15},
  1495. {11,12,15,16},
  1496. {11,12,16,17},
  1497. {11,12,17,18},
  1498. {11,12,18,19},
  1499. {11,12,19,20},
  1500. {11,12,20,21},
  1501. {11,12,21,22},
  1502. {11,12,22,23},
  1503. {11,12,23,24},
  1504. {11,12,24,25},
  1505. {11,12,25,26},
  1506. {11,12,26,27},
  1507. {11,12,27,28},
  1508. {11,12,28,29},
  1509. {11,12,29,30},
  1510. {11,12,30,31},
  1511. {11,12,31,0},
  1512. {12,13,0,1},
  1513. {12,13,1,2},
  1514. {12,13,2,3},
  1515. {12,13,3,4},
  1516. {12,13,4,5},
  1517. {12,13,5,6},
  1518. {12,13,6,7},
  1519. {12,13,7,8},
  1520. {12,13,8,9},
  1521. {12,13,9,10},
  1522. {12,13,10,11},
  1523. {12,13,14,15},
  1524. {12,13,15,16},
  1525. {12,13,16,17},
  1526. {12,13,17,18},
  1527. {12,13,18,19},
  1528. {12,13,19,20},
  1529. {12,13,20,21},
  1530. {12,13,21,22},
  1531. {12,13,22,23},
  1532. {12,13,23,24},
  1533. {12,13,24,25},
  1534. {12,13,25,26},
  1535. {12,13,26,27},
  1536. {12,13,27,28},
  1537. {12,13,28,29},
  1538. {12,13,29,30},
  1539. {12,13,30,31},
  1540. {12,13,31,0},
  1541. {13,14,0,1},
  1542. {13,14,1,2},
  1543. {13,14,2,3},
  1544. {13,14,3,4},
  1545. {13,14,4,5},
  1546. {13,14,5,6},
  1547. {13,14,6,7},
  1548. {13,14,7,8},
  1549. {13,14,8,9},
  1550. {13,14,9,10},
  1551. {13,14,10,11},
  1552. {13,14,11,12},
  1553. {13,14,15,16},
  1554. {13,14,16,17},
  1555. {13,14,17,18},
  1556. {13,14,18,19},
  1557. {13,14,19,20},
  1558. {13,14,20,21},
  1559. {13,14,21,22},
  1560. {13,14,22,23},
  1561. {13,14,23,24},
  1562. {13,14,24,25},
  1563. {13,14,25,26},
  1564. {13,14,26,27},
  1565. {13,14,27,28},
  1566. {13,14,28,29},
  1567. {13,14,29,30},
  1568. {13,14,30,31},
  1569. {13,14,31,0},
  1570. {14,15,0,1},
  1571. {14,15,1,2},
  1572. {14,15,2,3},
  1573. {14,15,3,4},
  1574. {14,15,4,5},
  1575. {14,15,5,6},
  1576. {14,15,6,7},
  1577. {14,15,7,8},
  1578. {14,15,8,9},
  1579. {14,15,9,10},
  1580. {14,15,10,11},
  1581. {14,15,11,12},
  1582. {14,15,12,13},
  1583. {14,15,16,17},
  1584. {14,15,17,18},
  1585. {14,15,18,19},
  1586. {14,15,19,20},
  1587. {14,15,20,21},
  1588. {14,15,21,22},
  1589. {14,15,22,23},
  1590. {14,15,23,24},
  1591. {14,15,24,25},
  1592. {14,15,25,26},
  1593. {14,15,26,27},
  1594. {14,15,27,28},
  1595. {14,15,28,29},
  1596. {14,15,29,30},
  1597. {14,15,30,31},
  1598. {14,15,31,0},
  1599. {15,16,0,1},
  1600. {15,16,1,2},
  1601. {15,16,2,3},
  1602. {15,16,3,4},
  1603. {15,16,4,5},
  1604. {15,16,5,6},
  1605. {15,16,6,7},
  1606. {15,16,7,8},
  1607. {15,16,8,9},
  1608. {15,16,9,10},
  1609. {15,16,10,11},
  1610. {15,16,11,12},
  1611. {15,16,12,13},
  1612. {15,16,13,14},
  1613. {15,16,17,18},
  1614. {15,16,18,19},
  1615. {15,16,19,20},
  1616. {15,16,20,21},
  1617. {15,16,21,22},
  1618. {15,16,22,23},
  1619. {15,16,23,24},
  1620. {15,16,24,25},
  1621. {15,16,25,26},
  1622. {15,16,26,27},
  1623. {15,16,27,28},
  1624. {15,16,28,29},
  1625. {15,16,29,30},
  1626. {15,16,30,31},
  1627. {15,16,31,0},
  1628. {16,17,0,1},
  1629. {16,17,1,2},
  1630. {16,17,2,3},
  1631. {16,17,3,4},
  1632. {16,17,4,5},
  1633. {16,17,5,6},
  1634. {16,17,6,7},
  1635. {16,17,7,8},
  1636. {16,17,8,9},
  1637. {16,17,9,10},
  1638. {16,17,10,11},
  1639. {16,17,11,12},
  1640. {16,17,12,13},
  1641. {16,17,13,14},
  1642. {16,17,14,15},
  1643. {16,17,18,19},
  1644. {16,17,19,20},
  1645. {16,17,20,21},
  1646. {16,17,21,22},
  1647. {16,17,22,23},
  1648. {16,17,23,24},
  1649. {16,17,24,25},
  1650. {16,17,25,26},
  1651. {16,17,26,27},
  1652. {16,17,27,28},
  1653. {16,17,28,29},
  1654. {16,17,29,30},
  1655. {16,17,30,31},
  1656. {16,17,31,0},
  1657. {17,18,0,1},
  1658. {17,18,1,2},
  1659. {17,18,2,3},
  1660. {17,18,3,4},
  1661. {17,18,4,5},
  1662. {17,18,5,6},
  1663. {17,18,6,7},
  1664. {17,18,7,8},
  1665. {17,18,8,9},
  1666. {17,18,9,10},
  1667. {17,18,10,11},
  1668. {17,18,11,12},
  1669. {17,18,12,13},
  1670. {17,18,13,14},
  1671. {17,18,14,15},
  1672. {17,18,15,16},
  1673. {17,18,19,20},
  1674. {17,18,20,21},
  1675. {17,18,21,22},
  1676. {17,18,22,23},
  1677. {17,18,23,24},
  1678. {17,18,24,25},
  1679. {17,18,25,26},
  1680. {17,18,26,27},
  1681. {17,18,27,28},
  1682. {17,18,28,29},
  1683. {17,18,29,30},
  1684. {17,18,30,31},
  1685. {17,18,31,0},
  1686. {18,19,0,1},
  1687. {18,19,1,2},
  1688. {18,19,2,3},
  1689. {18,19,3,4},
  1690. {18,19,4,5},
  1691. {18,19,5,6},
  1692. {18,19,6,7},
  1693. {18,19,7,8},
  1694. {18,19,8,9},
  1695. {18,19,9,10},
  1696. {18,19,10,11},
  1697. {18,19,11,12},
  1698. {18,19,12,13},
  1699. {18,19,13,14},
  1700. {18,19,14,15},
  1701. {18,19,15,16},
  1702. {18,19,16,17},
  1703. {18,19,20,21},
  1704. {18,19,21,22},
  1705. {18,19,22,23},
  1706. {18,19,23,24},
  1707. {18,19,24,25},
  1708. {18,19,25,26},
  1709. {18,19,26,27},
  1710. {18,19,27,28},
  1711. {18,19,28,29},
  1712. {18,19,29,30},
  1713. {18,19,30,31},
  1714. {18,19,31,0},
  1715. {19,20,0,1},
  1716. {19,20,1,2},
  1717. {19,20,2,3},
  1718. {19,20,3,4},
  1719. {19,20,4,5},
  1720. {19,20,5,6},
  1721. {19,20,6,7},
  1722. {19,20,7,8},
  1723. {19,20,8,9},
  1724. {19,20,9,10},
  1725. {19,20,10,11},
  1726. {19,20,11,12},
  1727. {19,20,12,13},
  1728. {19,20,13,14},
  1729. {19,20,14,15},
  1730. {19,20,15,16},
  1731. {19,20,16,17},
  1732. {19,20,17,18},
  1733. {19,20,21,22},
  1734. {19,20,22,23},
  1735. {19,20,23,24},
  1736. {19,20,24,25},
  1737. {19,20,25,26},
  1738. {19,20,26,27},
  1739. {19,20,27,28},
  1740. {19,20,28,29},
  1741. {19,20,29,30},
  1742. {19,20,30,31},
  1743. {19,20,31,0},
  1744. {20,21,0,1},
  1745. {20,21,1,2},
  1746. {20,21,2,3},
  1747. {20,21,3,4},
  1748. {20,21,4,5},
  1749. {20,21,5,6},
  1750. {20,21,6,7},
  1751. {20,21,7,8},
  1752. {20,21,8,9},
  1753. {20,21,9,10},
  1754. {20,21,10,11},
  1755. {20,21,11,12},
  1756. {20,21,12,13},
  1757. {20,21,13,14},
  1758. {20,21,14,15},
  1759. {20,21,15,16},
  1760. {20,21,16,17},
  1761. {20,21,17,18},
  1762. {20,21,18,19},
  1763. {20,21,22,23},
  1764. {20,21,23,24},
  1765. {20,21,24,25},
  1766. {20,21,25,26},
  1767. {20,21,26,27},
  1768. {20,21,27,28},
  1769. {20,21,28,29},
  1770. {20,21,29,30},
  1771. {20,21,30,31},
  1772. {20,21,31,0},
  1773. {21,22,0,1},
  1774. {21,22,1,2},
  1775. {21,22,2,3},
  1776. {21,22,3,4},
  1777. {21,22,4,5},
  1778. {21,22,5,6},
  1779. {21,22,6,7},
  1780. {21,22,7,8},
  1781. {21,22,8,9},
  1782. {21,22,9,10},
  1783. {21,22,10,11},
  1784. {21,22,11,12},
  1785. {21,22,12,13},
  1786. {21,22,13,14},
  1787. {21,22,14,15},
  1788. {21,22,15,16},
  1789. {21,22,16,17},
  1790. {21,22,17,18},
  1791. {21,22,18,19},
  1792. {21,22,19,20},
  1793. {21,22,23,24},
  1794. {21,22,24,25},
  1795. {21,22,25,26},
  1796. {21,22,26,27},
  1797. {21,22,27,28},
  1798. {21,22,28,29},
  1799. {21,22,29,30},
  1800. {21,22,30,31},
  1801. {21,22,31,0},
  1802. {22,23,0,1},
  1803. {22,23,1,2},
  1804. {22,23,2,3},
  1805. {22,23,3,4},
  1806. {22,23,4,5},
  1807. {22,23,5,6},
  1808. {22,23,6,7},
  1809. {22,23,7,8},
  1810. {22,23,8,9},
  1811. {22,23,9,10},
  1812. {22,23,10,11},
  1813. {22,23,11,12},
  1814. {22,23,12,13},
  1815. {22,23,13,14},
  1816. {22,23,14,15},
  1817. {22,23,15,16},
  1818. {22,23,16,17},
  1819. {22,23,17,18},
  1820. {22,23,18,19},
  1821. {22,23,19,20},
  1822. {22,23,20,21},
  1823. {22,23,24,25},
  1824. {22,23,25,26},
  1825. {22,23,26,27},
  1826. {22,23,27,28},
  1827. {22,23,28,29},
  1828. {22,23,29,30},
  1829. {22,23,30,31},
  1830. {22,23,31,0},
  1831. {23,24,0,1},
  1832. {23,24,1,2},
  1833. {23,24,2,3},
  1834. {23,24,3,4},
  1835. {23,24,4,5},
  1836. {23,24,5,6},
  1837. {23,24,6,7},
  1838. {23,24,7,8},
  1839. {23,24,8,9},
  1840. {23,24,9,10},
  1841. {23,24,10,11},
  1842. {23,24,11,12},
  1843. {23,24,12,13},
  1844. {23,24,13,14},
  1845. {23,24,14,15},
  1846. {23,24,15,16},
  1847. {23,24,16,17},
  1848. {23,24,17,18},
  1849. {23,24,18,19},
  1850. {23,24,19,20},
  1851. {23,24,20,21},
  1852. {23,24,21,22},
  1853. {23,24,25,26},
  1854. {23,24,26,27},
  1855. {23,24,27,28},
  1856. {23,24,28,29},
  1857. {23,24,29,30},
  1858. {23,24,30,31},
  1859. {23,24,31,0},
  1860. {24,25,0,1},
  1861. {24,25,1,2},
  1862. {24,25,2,3},
  1863. {24,25,3,4},
  1864. {24,25,4,5},
  1865. {24,25,5,6},
  1866. {24,25,6,7},
  1867. {24,25,7,8},
  1868. {24,25,8,9},
  1869. {24,25,9,10},
  1870. {24,25,10,11},
  1871. {24,25,11,12},
  1872. {24,25,12,13},
  1873. {24,25,13,14},
  1874. {24,25,14,15},
  1875. {24,25,15,16},
  1876. {24,25,16,17},
  1877. {24,25,17,18},
  1878. {24,25,18,19},
  1879. {24,25,19,20},
  1880. {24,25,20,21},
  1881. {24,25,21,22},
  1882. {24,25,22,23},
  1883. {24,25,26,27},
  1884. {24,25,27,28},
  1885. {24,25,28,29},
  1886. {24,25,29,30},
  1887. {24,25,30,31},
  1888. {24,25,31,0},
  1889. {25,26,0,1},
  1890. {25,26,1,2},
  1891. {25,26,2,3},
  1892. {25,26,3,4},
  1893. {25,26,4,5},
  1894. {25,26,5,6},
  1895. {25,26,6,7},
  1896. {25,26,7,8},
  1897. {25,26,8,9},
  1898. {25,26,9,10},
  1899. {25,26,10,11},
  1900. {25,26,11,12},
  1901. {25,26,12,13},
  1902. {25,26,13,14},
  1903. {25,26,14,15},
  1904. {25,26,15,16},
  1905. {25,26,16,17},
  1906. {25,26,17,18},
  1907. {25,26,18,19},
  1908. {25,26,19,20},
  1909. {25,26,20,21},
  1910. {25,26,21,22},
  1911. {25,26,22,23},
  1912. {25,26,23,24},
  1913. {25,26,27,28},
  1914. {25,26,28,29},
  1915. {25,26,29,30},
  1916. {25,26,30,31},
  1917. {25,26,31,0},
  1918. {26,27,0,1},
  1919. {26,27,1,2},
  1920. {26,27,2,3},
  1921. {26,27,3,4},
  1922. {26,27,4,5},
  1923. {26,27,5,6},
  1924. {26,27,6,7},
  1925. {26,27,7,8},
  1926. {26,27,8,9},
  1927. {26,27,9,10},
  1928. {26,27,10,11},
  1929. {26,27,11,12},
  1930. {26,27,12,13},
  1931. {26,27,13,14},
  1932. {26,27,14,15},
  1933. {26,27,15,16},
  1934. {26,27,16,17},
  1935. {26,27,17,18},
  1936. {26,27,18,19},
  1937. {26,27,19,20},
  1938. {26,27,20,21},
  1939. {26,27,21,22},
  1940. {26,27,22,23},
  1941. {26,27,23,24},
  1942. {26,27,24,25},
  1943. {26,27,28,29},
  1944. {26,27,29,30},
  1945. {26,27,30,31},
  1946. {26,27,31,0},
  1947. {27,28,0,1},
  1948. {27,28,1,2},
  1949. {27,28,2,3},
  1950. {27,28,3,4},
  1951. {27,28,4,5},
  1952. {27,28,5,6},
  1953. {27,28,6,7},
  1954. {27,28,7,8},
  1955. {27,28,8,9},
  1956. {27,28,9,10},
  1957. {27,28,10,11},
  1958. {27,28,11,12},
  1959. {27,28,12,13},
  1960. {27,28,13,14},
  1961. {27,28,14,15},
  1962. {27,28,15,16},
  1963. {27,28,16,17},
  1964. {27,28,17,18},
  1965. {27,28,18,19},
  1966. {27,28,19,20},
  1967. {27,28,20,21},
  1968. {27,28,21,22},
  1969. {27,28,22,23},
  1970. {27,28,23,24},
  1971. {27,28,24,25},
  1972. {27,28,25,26},
  1973. {27,28,29,30},
  1974. {27,28,30,31},
  1975. {27,28,31,0},
  1976. {28,29,0,1},
  1977. {28,29,1,2},
  1978. {28,29,2,3},
  1979. {28,29,3,4},
  1980. {28,29,4,5},
  1981. {28,29,5,6},
  1982. {28,29,6,7},
  1983. {28,29,7,8},
  1984. {28,29,8,9},
  1985. {28,29,9,10},
  1986. {28,29,10,11},
  1987. {28,29,11,12},
  1988. {28,29,12,13},
  1989. {28,29,13,14},
  1990. {28,29,14,15},
  1991. {28,29,15,16},
  1992. {28,29,16,17},
  1993. {28,29,17,18},
  1994. {28,29,18,19},
  1995. {28,29,19,20},
  1996. {28,29,20,21},
  1997. {28,29,21,22},
  1998. {28,29,22,23},
  1999. {28,29,23,24},
  2000. {28,29,24,25},
  2001. {28,29,25,26},
  2002. {28,29,26,27},
  2003. {28,29,30,31},
  2004. {28,29,31,0},
  2005. {29,30,0,1},
  2006. {29,30,1,2},
  2007. {29,30,2,3},
  2008. {29,30,3,4},
  2009. {29,30,4,5},
  2010. {29,30,5,6},
  2011. {29,30,6,7},
  2012. {29,30,7,8},
  2013. {29,30,8,9},
  2014. {29,30,9,10},
  2015. {29,30,10,11},
  2016. {29,30,11,12},
  2017. {29,30,12,13},
  2018. {29,30,13,14},
  2019. {29,30,14,15},
  2020. {29,30,15,16},
  2021. {29,30,16,17},
  2022. {29,30,17,18},
  2023. {29,30,18,19},
  2024. {29,30,19,20},
  2025. {29,30,20,21},
  2026. {29,30,21,22},
  2027. {29,30,22,23},
  2028. {29,30,23,24},
  2029. {29,30,24,25},
  2030. {29,30,25,26},
  2031. {29,30,26,27},
  2032. {29,30,27,28},
  2033. {29,30,31,0},
  2034. {30,31,0,1},
  2035. {30,31,1,2},
  2036. {30,31,2,3},
  2037. {30,31,3,4},
  2038. {30,31,4,5},
  2039. {30,31,5,6},
  2040. {30,31,6,7},
  2041. {30,31,7,8},
  2042. {30,31,8,9},
  2043. {30,31,9,10},
  2044. {30,31,10,11},
  2045. {30,31,11,12},
  2046. {30,31,12,13},
  2047. {30,31,13,14},
  2048. {30,31,14,15},
  2049. {30,31,15,16},
  2050. {30,31,16,17},
  2051. {30,31,17,18},
  2052. {30,31,18,19},
  2053. {30,31,19,20},
  2054. {30,31,20,21},
  2055. {30,31,21,22},
  2056. {30,31,22,23},
  2057. {30,31,23,24},
  2058. {30,31,24,25},
  2059. {30,31,25,26},
  2060. {30,31,26,27},
  2061. {30,31,27,28},
  2062. {30,31,28,29},
  2063. {31,0,1,2},
  2064. {31,0,2,3},
  2065. {31,0,3,4},
  2066. {31,0,4,5},
  2067. {31,0,5,6},
  2068. {31,0,6,7},
  2069. {31,0,7,8},
  2070. {31,0,8,9},
  2071. {31,0,9,10},
  2072. {31,0,10,11},
  2073. {31,0,11,12},
  2074. {31,0,12,13},
  2075. {31,0,13,14},
  2076. {31,0,14,15},
  2077. {31,0,15,16},
  2078. {31,0,16,17},
  2079. {31,0,17,18},
  2080. {31,0,18,19},
  2081. {31,0,19,20},
  2082. {31,0,20,21},
  2083. {31,0,21,22},
  2084. {31,0,22,23},
  2085. {31,0,23,24},
  2086. {31,0,24,25},
  2087. {31,0,25,26},
  2088. {31,0,26,27},
  2089. {31,0,27,28},
  2090. {31,0,28,29},
  2091. {31,0,29,30}
  2092. };
  2093. // GPIO Mappings
  2094. //
  2095. // A0, A1, A2, A3, A4, EN
  2096. //
  2097. // Send: V minus, A minus
  2098. // Receiver: V plus, A plus
  2099. //
  2100. typedef struct {
  2101. ADI_GPIO_PORT_TYPE Port;
  2102. ADI_GPIO_DATA_TYPE Pins;
  2103. } PinMap;
  2104. //
  2105. PinMap m1_configuration[5] = {
  2106. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_4}, // 4
  2107. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_3}, // 3
  2108. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_2}, // 2
  2109. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_1}, // 1
  2110. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_0} // 0
  2111. };
  2112. // Multiplexer A_plus
  2113. // P1.6,P1.7,P1.8,P1.9,P1.10,P1.11
  2114. PinMap m2_configuration[5] = {
  2115. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_10}, // 4
  2116. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_9}, // 3
  2117. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_8}, // 2
  2118. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_7}, // 1
  2119. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_6} // 0
  2120. };
  2121. // Multiplexer V_minus
  2122. // P1.12, P1.13, P1.14, P1.15, P3.13, P3.12
  2123. PinMap m3_configuration[5] = {
  2124. {ADI_GPIO_PORT_3,ADI_GPIO_PIN_13 }, // 4
  2125. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_15}, // 3
  2126. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_14}, // 2
  2127. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_13}, // 1
  2128. {ADI_GPIO_PORT_1,ADI_GPIO_PIN_12} // 0
  2129. };
  2130. // Multiplexer V_plus
  2131. // P2.11,P2.10,P2.9,P2.8,P2.7,P2.6
  2132. PinMap m4_configuration[5] = {
  2133. {ADI_GPIO_PORT_2,ADI_GPIO_PIN_7}, // 4
  2134. {ADI_GPIO_PORT_2,ADI_GPIO_PIN_8}, // 3
  2135. {ADI_GPIO_PORT_2,ADI_GPIO_PIN_9}, // 2
  2136. {ADI_GPIO_PORT_2,ADI_GPIO_PIN_10}, // 1
  2137. {ADI_GPIO_PORT_2,ADI_GPIO_PIN_11} // 0
  2138. };
  2139. // Multiplexer ADG732 Truth Table.
  2140. typedef const int16_t truth_logic[6];
  2141. // A4 A3 A2 A1 A0 Switch_Condition
  2142. const truth_logic truth_table[32] = {
  2143. {0, 0, 0, 0, 0, 0},
  2144. {0, 0, 0, 0, 1, 1},
  2145. {0, 0, 0, 1, 0, 2},
  2146. {0, 0, 0, 1, 1, 3},
  2147. {0, 0, 1, 0, 0, 4},
  2148. {0, 0, 1, 0, 1, 5},
  2149. {0, 0, 1, 1, 0, 6},
  2150. {0, 0, 1, 1, 1, 7},
  2151. {0, 1, 0, 0, 0, 8},
  2152. {0, 1, 0, 0, 1, 9},
  2153. {0, 1, 0, 1, 0, 10},
  2154. {0, 1, 0, 1, 1, 11},
  2155. {0, 1, 1, 0, 0, 12},
  2156. {0, 1, 1, 0, 1, 13},
  2157. {0, 1, 1, 1, 0, 14},
  2158. {0, 1, 1, 1, 1, 15},
  2159. {1, 0, 0, 0, 0, 16},
  2160. {1, 0, 0, 0, 1, 17},
  2161. {1, 0, 0, 1, 0, 18},
  2162. {1, 0, 0, 1, 1, 19},
  2163. {1, 0, 1, 0, 0, 20},
  2164. {1, 0, 1, 0, 1, 21},
  2165. {1, 0, 1, 1, 0, 22},
  2166. {1, 0, 1, 1, 1, 23},
  2167. {1, 1, 0, 0, 0, 24},
  2168. {1, 1, 0, 0, 1, 25},
  2169. {1, 1, 0, 1, 0, 26},
  2170. {1, 1, 0, 1, 1, 27},
  2171. {1, 1, 1, 0, 0, 28},
  2172. {1, 1, 1, 0, 1, 29},
  2173. {1, 1, 1, 1, 0, 30},
  2174. {1, 1, 1, 1, 1, 31}
  2175. };
  2176. /* C++ linkage */
  2177. #ifdef __cplusplus
  2178. }
  2179. #endif
  2180. #endif /* include guard */
  2181. /*
  2182. ** EOF
  2183. */
  2184. /*@}*/