Compare commits
654 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63310bdd03 | |||
| 1954ff8d9e | |||
| c656eebcbc | |||
| e17e78bc18 | |||
| c3235e985f | |||
| 656e0fb485 | |||
| d3dd5270dd | |||
| e588b30c8b | |||
| d3f9aec31c | |||
| ed617c88c9 | |||
| 0b8f4c2414 | |||
| b5449b7404 | |||
| a3c1241f38 | |||
| bbf60ebfed | |||
| 0e9f40bdd5 | |||
| e32897f6b5 | |||
| 6ee4b47d90 | |||
| dac19f62b2 | |||
| 8e6d112729 | |||
| 9e1dc1e3f4 | |||
| 49fb3afc01 | |||
| f3b402fce9 | |||
| ef9a38d7fc | |||
| 67275a7921 | |||
| 0ddaa02414 | |||
| 96d5735164 | |||
| ac32fb9c73 | |||
| 9acc242ff6 | |||
| d8a403c410 | |||
| f1d0acef23 | |||
| 9811572f47 | |||
| 8753e2ddc6 | |||
| f6167c25ca | |||
| cb3894712e | |||
| 995a47e200 | |||
| cde9096018 | |||
| 6c1bd24b92 | |||
| 0c129bc99b | |||
| cbe9bd8211 | |||
| 0293647d0c | |||
| 87d187c3a5 | |||
| 09fbfd9dda | |||
| 74ca631309 | |||
| 03e86e175d | |||
| 1c54525256 | |||
| d49874a666 | |||
| 6d6ba43d81 | |||
| 4914498732 | |||
| 85220734de | |||
| 7531a6638b | |||
| 4088a4d38b | |||
| 1b3d057d33 | |||
| 17e1846afa | |||
| 0407690197 | |||
| 55e8b37f13 | |||
| fb4c0a59e8 | |||
| ea3d146c86 | |||
| cddafdffff | |||
| 05e953d6e2 | |||
| 9b7e960bec | |||
| c3aa2f7178 | |||
| 5b4970d814 | |||
| 46c43afa26 | |||
| 6bcfc74d1a | |||
| 4d920209f7 | |||
| 52f8708905 | |||
| b7024363ee | |||
| 1a6d30606c | |||
| e72698dea3 | |||
| 3100dded42 | |||
| 53584f2b5b | |||
| b2d924228a | |||
| f3de02477d | |||
| 77a2bc2d8f | |||
| c56a07ead8 | |||
| 2e3ca56ece | |||
| b8588393b7 | |||
| ea33b37080 | |||
| ea7815dc64 | |||
| 2340b0e88c | |||
| d05d42415a | |||
| e34db21efd | |||
| f6a1a9fa4e | |||
| a567483ffa | |||
| 9dc0a0109a | |||
| afd9ac1223 | |||
| 30ff3a6d69 | |||
| 50781513dc | |||
| fab091d3ec | |||
| b734f2d44c | |||
| 576c6e5177 | |||
| 70a8640327 | |||
| 72d95dac61 | |||
| 84367ae2d3 | |||
| c06a9a996e | |||
| 699c6d1365 | |||
| cbad40dc5a | |||
| 53afd6dd2f | |||
| 5f12e4b10d | |||
| 28f6c39288 | |||
| ec7bd09b70 | |||
| dc6ac4cf19 | |||
| 15cde79313 | |||
| ac6767f082 | |||
| 4f7c2205b0 | |||
| f576158d38 | |||
| 47fc620923 | |||
| 897270dab4 | |||
| 3becd44444 | |||
| 4bfa35858d | |||
| d6068f8e5c | |||
| 2ea33f0269 | |||
| f9da0bbad4 | |||
| 46bd7e04cf | |||
| e3a04ad8e5 | |||
| 6cfde66c24 | |||
| f9f0aeaf87 | |||
| 1856096cf3 | |||
| eb1b4ddf30 | |||
| e960b0859a | |||
| bcebfaa777 | |||
| 5be3e2ec10 | |||
| 49f2f6b1ea | |||
| 9afe79edfb | |||
| fc67ea915e | |||
| 7b866d025a | |||
| 13864e766a | |||
| ee0ff789f3 | |||
| 7f6a871501 | |||
| d4681171b4 | |||
| 52139ec1b1 | |||
| 9b61eda6c2 | |||
| 142c8c38e1 | |||
| e1acbf5681 | |||
| 0bc5b8bfb8 | |||
| 3e8bbbeaf8 | |||
| 4c88d96928 | |||
| ffeb980a39 | |||
| b0ced97ffb | |||
| 1876714222 | |||
| 075e65604b | |||
| 7dbc090909 | |||
| c95e379cd1 | |||
| 9284cfacfc | |||
| dcced24976 | |||
| 286164a76d | |||
| 51d2e88978 | |||
| 29b73a88ae | |||
| 99f2e53b34 | |||
| 6d14af0e18 | |||
| 43282ac881 | |||
| 67a82d0cb1 | |||
| aec07f750b | |||
| 5c38dd785a | |||
| 46473fbae0 | |||
| cf876bfaf9 | |||
| 2fe991a23b | |||
| b9f8938c0e | |||
| 14129b8b3c | |||
| 502daf7204 | |||
| 3013e88dca | |||
| d37cf0f694 | |||
| 4cf062fb06 | |||
| 4a8e090ff1 | |||
| 576df09f24 | |||
| 3a01d5cc2c | |||
| 165c89e6aa | |||
| 9eaedfc0e5 | |||
| 5eba9eff3a | |||
| b985a09863 | |||
| 68aa82bbd8 | |||
| 6b1c0ca9aa | |||
| d176628edb | |||
| 8548712049 | |||
| bc819082cc | |||
| 64fb0fc78a | |||
| 0a4303dff0 | |||
| caa0bfaf8d | |||
| c6e300bfff | |||
| cf1d92d9ec | |||
| 25796a879d | |||
| f6e8385a8f | |||
| b52ea2fe1e | |||
| 2a6920a3d3 | |||
| fac1427eb6 | |||
| ed13172c92 | |||
| 07ebae4f64 | |||
| 1391ebd695 | |||
| 6cf988a54c | |||
| 76b74b53f9 | |||
| 786991d971 | |||
| c33b46521e | |||
| fc41b62329 | |||
| ab2eeb7f96 | |||
| bc3106fc26 | |||
| f2d404ed60 | |||
| 53038c0c84 | |||
| b835a0136b | |||
| e12102a8a7 | |||
| 728b9ae8bf | |||
| 9f5a6a09de | |||
| d26da674f5 | |||
| b781023863 | |||
| a42f6441fa | |||
| 2c4122bb77 | |||
| a05b81a7b4 | |||
| 2c8cc334e2 | |||
| 59786e995f | |||
| ebc1d29195 | |||
| 2d8d706141 | |||
| eb25a2e674 | |||
| 241ff38555 | |||
| 059bc76536 | |||
| 4678e304ee | |||
| db7d1e1141 | |||
| 218997b6b3 | |||
| f05c37d53e | |||
| 90767f36e5 | |||
| 81b1ff935a | |||
| 0f5f228707 | |||
| f0ea8bfcf5 | |||
| a2f0d62819 | |||
| e238d117a9 | |||
| 82dbe82bd1 | |||
| 8ba6180c8c | |||
| e2d5470b47 | |||
| 2532e703ae | |||
| 10497683c8 | |||
| 53932d4cb3 | |||
| 7b0f5ce687 | |||
| 653c2059e2 | |||
| 5c949be67c | |||
| c73ab1bbd4 | |||
| 083cbb0611 | |||
| f998c01010 | |||
| faf57cba6a | |||
| 83b70de310 | |||
| b4fb63f1e8 | |||
| 832fe1695f | |||
| d6b6b65e5f | |||
| 1698f0b544 | |||
| d10a6d16a8 | |||
| f864acfa26 | |||
| ba7703a772 | |||
| b7739ab42d | |||
| a6208f00d0 | |||
| c53a2d8872 | |||
| 9c69e16046 | |||
| cc57bc47a6 | |||
| b2b07ae05f | |||
| fec9ddcdf8 | |||
| 3eb17d14e6 | |||
| 8ca4eb3812 | |||
| 8341560686 | |||
| 39f39773b8 | |||
| a01c9b9dc0 | |||
| 124ca6ea84 | |||
| befb4f80e2 | |||
| 5a7980dca5 | |||
| 889a3d4147 | |||
| 0245adae4a | |||
| 8b94eaa6dd | |||
| 323dc2cf77 | |||
| e89cd406e4 | |||
| 8de29a213c | |||
| 571edc35aa | |||
| ee04ca568e | |||
| 67ef9adad1 | |||
| 4ec0bb12f7 | |||
| 5f5921e411 | |||
| da6a3f90f9 | |||
| 21135acf32 | |||
| b8e052de0d | |||
| cf33bcba2a | |||
| 45e7e2d5b7 | |||
| 04286e891d | |||
| 2e4720c607 | |||
| 5333cd9c98 | |||
| a116cbfa3e | |||
| bae6a4bce3 | |||
| bc10083c25 | |||
| 6f7cea2590 | |||
| f3c010ebf8 | |||
| ffbdd27df0 | |||
| 4f9fb2b8fb | |||
| f7d2b168d4 | |||
| 5a9a3754e7 | |||
| 97040855af | |||
| 77ee73a878 | |||
| cbd8f96f60 | |||
| 631396c50e | |||
| d25103373e | |||
| 8ddb66393d | |||
| f8d37fcf20 | |||
| a22253e384 | |||
| 116d4cfb76 | |||
| bd070a4ce8 | |||
| 5beb62613f | |||
| e27204bd50 | |||
| 34e9c644c5 | |||
| 74d2024731 | |||
| 7615f141ef | |||
| 38a45cdb1d | |||
| 9623751337 | |||
| dbf25c5712 | |||
| 7b2a51ee24 | |||
| bf57c10785 | |||
| 854e82a198 | |||
| 3107807268 | |||
| dff6c0a9e2 | |||
| 8480f60266 | |||
| 8808490caa | |||
| 59a4d9dafe | |||
| 1d8d987d22 | |||
| 5538e13e69 | |||
| 1b75ccb056 | |||
| 131051e227 | |||
| e0e116b1d1 | |||
| 9a9cf40c74 | |||
| 246052bf9c | |||
| 66229c2821 | |||
| 347259fe7e | |||
| d1b3aa9506 | |||
| 6cdecd9e87 | |||
| 56937a0780 | |||
| cb1ca49985 | |||
| 7e9dfbc4c2 | |||
| d86b008bb1 | |||
| ceac955327 | |||
| 64effd5a02 | |||
| c7d531f0a5 | |||
| 37caa92565 | |||
| 4c04c57728 | |||
| 9bc16f7687 | |||
| e11eae5302 | |||
| 2269a2b4d7 | |||
| 3ffa567f1b | |||
| de4d766ed5 | |||
| 7b5d46edff | |||
| 7399ddce01 | |||
| 7e16a54533 | |||
| 778495a07a | |||
| 527a90f732 | |||
| 4e01c27e8e | |||
| a71e456e81 | |||
| df1c1f9f7e | |||
| 06584e7d1c | |||
| 5ea5b16d89 | |||
| 10e2d12bc2 | |||
| 857388b204 | |||
| 78d788cab2 | |||
| 02185083f5 | |||
| aeca114c5f | |||
| 7b4f2b5828 | |||
| 7b075f40a3 | |||
| 6c68c67f0e | |||
| fd9f0ef321 | |||
| cb44628316 | |||
| 63fd8cf1df | |||
| cc39131466 | |||
| e71e064846 | |||
| 1356a8c8af | |||
| d9b6340f23 | |||
| 2709baf8e8 | |||
| 046fae3617 | |||
| 688868fb48 | |||
| 5967b6ebc6 | |||
| d9e9a2102e | |||
| 065517a7cc | |||
| 0691725819 | |||
| 5954a965dc | |||
| 788aca30ef | |||
| bda30b15b5 | |||
| 32523d6f88 | |||
| 300707871e | |||
| b21bdf57be | |||
| 3067a5eafe | |||
| ec4e48725c | |||
| 8322623699 | |||
| c588d4d377 | |||
| 9e23b67e03 | |||
| 0d4f77d25a | |||
| 0a16b06c78 | |||
| c6b6ff420d | |||
| 221c301739 | |||
| 5355e584a3 | |||
| 9fa2c0eb1a | |||
| 03a1e5a633 | |||
| 968150e9b7 | |||
| ef7484569d | |||
| 9cc483da5a | |||
| eb9609da00 | |||
| ea5c79cd77 | |||
| 4d4a0f5ce3 | |||
| cbeef5d00b | |||
| 433e9d27ec | |||
| 1e039a988a | |||
| 393051bfec | |||
| d0b51aef7a | |||
| c5e6739632 | |||
| b91fdc6d3f | |||
| d62b879a17 | |||
| 31306ee2a9 | |||
| 0346e37e50 | |||
| f004c60964 | |||
| 61c7827d93 | |||
| 4fcb7594d7 | |||
| 4d71181d78 | |||
| ed5e6d82fb | |||
| efc23e1393 | |||
| d8ce4418ae | |||
| fc5cebe638 | |||
| fb7811559b | |||
| a2e7049aa6 | |||
| f9e6fa7ad0 | |||
| e89dbd2f5c | |||
| 0b59913870 | |||
| d2e11c947a | |||
| 8c6968ec05 | |||
| b864235e5c | |||
| bd15523916 | |||
| 2f61a9ce99 | |||
| ed2edccbc1 | |||
| 59dc27dfda | |||
| 1f1b20f92f | |||
| 9a511e0fc1 | |||
| dff4082ea9 | |||
| a4e62ac39e | |||
| e119cfceb8 | |||
| 308d1c6ef3 | |||
| 89cd606529 | |||
| 0ed0c08878 | |||
| f1a3c290e9 | |||
| 47af16a2e2 | |||
| 3f885decac | |||
| fb58112ba7 | |||
| 9928f5281f | |||
| cf2944f651 | |||
| 5cfdec63e2 | |||
| 5defc984c2 | |||
| a0f7eff938 | |||
| 31a2dd0891 | |||
| 67b9a5be85 | |||
| 837bd99e86 | |||
| 507386a231 | |||
| 11b155070d | |||
| 91a9a315e4 | |||
| 85e2f6cf9d | |||
| f3301069ef | |||
| 7c1f558687 | |||
| 448a81bdf7 | |||
| 2712a2fa73 | |||
| 8151053d08 | |||
| 5e8f0af363 | |||
| 006d1c26b3 | |||
| 46f080e642 | |||
| 6088b102f8 | |||
| 7a59623930 | |||
| 4789a32fd4 | |||
| 4b6bea5f41 | |||
| da2b97dcf1 | |||
| 6aee724a7c | |||
| f1765d957c | |||
| 19e760f9cc | |||
| 04c7e8d640 | |||
| 813ef50bf5 | |||
| 8bc43f1bb0 | |||
| 50acc23eb1 | |||
| a26bad68a6 | |||
| f5796e8ac5 | |||
| c862e6790f | |||
| fb43ec6ac3 | |||
| e1aa33e6cb | |||
| fb3060a220 | |||
| be40ac25dc | |||
| 5a29b161ac | |||
| caee6602a8 | |||
| 12c4908881 | |||
| cb0b0fafd0 | |||
| 633b3424e1 | |||
| c75a147392 | |||
| 1e71de284c | |||
| 3bfadb0ea5 | |||
| a22a1aa656 | |||
| ac8f1af1cc | |||
| 42b5edd2bf | |||
| cafa70e740 | |||
| 7ecc6063ac | |||
| 1c5e586bd9 | |||
| 9861067a17 | |||
| 295abacf7c | |||
| 6b5dfcc12a | |||
| 8aab5b5aab | |||
| 776e40b639 | |||
| a97909625d | |||
| 259170af20 | |||
| b929433eef | |||
| b166235c21 | |||
| 37ad0160d0 | |||
| d40891396d | |||
| 4f31028d1a | |||
| 8727b7d2eb | |||
| 39e012de64 | |||
| 48e566dea4 | |||
| 3f617786ef | |||
| 080ca80f2b | |||
| 4875bb271a | |||
| b0ac5bb6e6 | |||
| 8b6a402d47 | |||
| aefb2cffbb | |||
| 6934d858fe | |||
| bc28dedc64 | |||
| 92b81cb47f | |||
| e9b5414ab0 | |||
| d3f6a6521a | |||
| 13efb6c32a | |||
| 18e4cac845 | |||
| f6a474e537 | |||
| 311bbdd809 | |||
| e47cf7c3db | |||
| b27718a30f | |||
| be79bec5e0 | |||
| a551eb1143 | |||
| ddc51481b8 | |||
| d8a567c607 | |||
| 776d8074b1 | |||
| e0f937be45 | |||
| 2d7bbb74aa | |||
| 03367a76cf | |||
| 8fffec3116 | |||
| d7210e3b5a | |||
| 82834f30b0 | |||
| 50fbaa5bc7 | |||
| 696f6447dc | |||
| 60734c69b4 | |||
| ddf22de09b | |||
| e169ed1d44 | |||
| 55759938da | |||
| 45de2e6825 | |||
| 4c0e7e2149 | |||
| b63989ca78 | |||
| c2df81dd3b | |||
| 7d6a0ce845 | |||
| 2c9105eb0a | |||
| 0d705b7d28 | |||
| 266e597e19 | |||
| 92d49c1f93 | |||
| c40adb3b64 | |||
| 44e5f54c50 | |||
| c642325859 | |||
| c3adc55aec | |||
| 8700625d69 | |||
| bc4dcfbe7d | |||
| 43170a4282 | |||
| 3652e19a3d | |||
| 36e6a47472 | |||
| c71c55ecf1 | |||
| 57a5b2b4f5 | |||
| 0da311941b | |||
| 7965a4cc1d | |||
| 551f9de36b | |||
| fa8f0202e9 | |||
| ee35c54dec | |||
| 031b98a6d5 | |||
| 82ab990f0b | |||
| 38774d9201 | |||
| 6845963c8b | |||
| 4e4ce66318 | |||
| 6fe44a536f | |||
| 07272963bf | |||
| 80dbc64452 | |||
| 3a8c5d843a | |||
| bf4baa8200 | |||
| bf2b1b9d3e | |||
| 03391b4fb3 | |||
| 9040e85dbb | |||
| 85021a88b0 | |||
| a5df1c227e | |||
| 8213d9fb19 | |||
| 14c424571a | |||
| 8a94a57843 | |||
| a58f787253 | |||
| 6c839b22d9 | |||
| c086de7cf4 | |||
| 3c5f4d9bb4 | |||
| f3037c7959 | |||
| 5a519d5fb5 | |||
| a16543ee57 | |||
| 9d281ce999 | |||
| d97b3ad6b0 | |||
| cad1763981 | |||
| 092c02940d | |||
| 0a19abd0e8 | |||
| 284cfe6d05 | |||
| 3298b6226b | |||
| dfcaf2d908 | |||
| d517318a67 | |||
| d0aa520329 | |||
| 9a875b8459 | |||
| 73ac2f5c90 | |||
| efcb1132de | |||
| 7492ed161d | |||
| ae7ec2e5ce | |||
| 63fde4bdbc | |||
| 32ccb8838f | |||
| 5b6fd53830 | |||
| 86eef98b13 | |||
| 3fdbfcf39f | |||
| 847ea9f3c0 | |||
| 25bd5b5ebe | |||
| 335fe6a9a4 | |||
| 6a0480613c | |||
| 300fb9a44c | |||
| 4fac2aa380 | |||
| d2ab4c1fe8 | |||
| 6048e10ab7 | |||
| 6bd94e3f73 | |||
| fc302d4c75 | |||
| 26a35a1446 | |||
| 8f2eda7281 | |||
| e26a97a32f | |||
| 5bdb0b04da | |||
| 8f8407601e | |||
| 4c6dbcf98d | |||
| 20ccd5de56 | |||
| 3c3ad8ccc7 | |||
| 1030d6625b | |||
| 326f3eb6b6 | |||
| 9dd7228eb5 | |||
| 59ac6b9909 | |||
| e24ce8e5d5 | |||
| 8720300bfc | |||
| 23fc75a236 | |||
| 80c25267cb | |||
| 81d1aff615 | |||
| 3221fe6492 | |||
| 4ca7d5b681 | |||
| 49677aa5b1 | |||
| bbfef99a65 | |||
| 05f11fd147 | |||
| f0aedf786d | |||
| a12146a479 | |||
| 410bef2e23 | |||
| 17c6a506cb | |||
| 0b9c945aee | |||
| 53ef219d6e | |||
| a14b2480db | |||
| 89368d5352 | |||
| f7903a0a31 | |||
| 56f42d21c5 | |||
| 52a8baad08 | |||
| 7acdbf6e78 | |||
| 393394be6f | |||
| b7f305e378 |
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
#path=$(pwd)
|
||||
#folder=$($path | awk -F"/" '{$NF}')
|
||||
folder=$(basename "$(pwd)")
|
||||
|
||||
if [ "$folder" == "bioprocc2650" ]; then
|
||||
year=$(date +%-y)
|
||||
month=$(date +%-m)
|
||||
day=$(date +%-d)
|
||||
hour=$(date +%-H)
|
||||
minute=$(date +%-M)
|
||||
|
||||
hash=$(git rev-parse HEAD)
|
||||
branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
sed -i "5c #define VERSION_DATE_YEAR ${year}"\
|
||||
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
|
||||
|
||||
sed -i "6c #define VERSION_DATE_MONTH ${month}"\
|
||||
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
|
||||
|
||||
sed -i "7c #define VERSION_DATE_DAY ${day}"\
|
||||
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
|
||||
|
||||
sed -i "8c #define VERSION_DATE_HOUR ${hour}"\
|
||||
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
|
||||
|
||||
sed -i "9c #define VERSION_DATE_MINUTE ${minute}"\
|
||||
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
|
||||
|
||||
sed -i "13c #define VERSION_HASH ${hash}"\
|
||||
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
|
||||
|
||||
sed -i "14c #define VERSION_GIT_BRANCH ${branch}"\
|
||||
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
|
||||
|
||||
#cat ./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
|
||||
fi
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Texas Instruments XDS100v3 USB Debug Probe" href="connections/TIXDS100v3_Dot7_Connection.xml" id="Texas Instruments XDS100v3 USB Debug Probe" xml="TIXDS100v3_Dot7_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe">
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
|
||||
<property Type="choicelist" Value="2" id="The Converter Usage">
|
||||
<choice Name="Generate 1149.7 2-pin advanced modes" value="enable">
|
||||
<property Type="choicelist" Value="1" id="The Converter 1149.7 Frequency">
|
||||
<choice Name="Overclock with user specified value" value="unused">
|
||||
<property Type="choicelist" Value="5" id="-- Choose a value from 1.0MHz to 50.0MHz"/>
|
||||
</choice>
|
||||
</property>
|
||||
<property Type="choicelist" Value="5" id="The Target Scan Format"/>
|
||||
</choice>
|
||||
</property>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="CC2640F128" href="devices/cc2640f128.xml" id="CC2640F128" xml="cc2640f128.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
|
||||
on the device and connection settings specified in your project on the Properties > General page.
|
||||
|
||||
Please note that in automatic target-configuration management, changes to the project's device and/or
|
||||
connection settings will either modify an existing or generate a new target-configuration file. Thus,
|
||||
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
|
||||
you may create your own target-configuration file for this project and manage it manually. You can
|
||||
always switch back to automatic target-configuration management by checking the "Manage the project's
|
||||
target-configuration automatically" checkbox on the project's Properties > General page.
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Texas Instruments XDS100v3 USB Debug Probe" href="connections/TIXDS100v3_Dot7_Connection.xml" id="Texas Instruments XDS100v3 USB Debug Probe" xml="TIXDS100v3_Dot7_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe">
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
|
||||
<property Type="choicelist" Value="2" id="The Converter Usage">
|
||||
<choice Name="Generate 1149.7 2-pin advanced modes" value="enable">
|
||||
<property Type="choicelist" Value="1" id="The Converter 1149.7 Frequency">
|
||||
<choice Name="Overclock with user specified value" value="unused">
|
||||
<property Type="choicelist" Value="5" id="-- Choose a value from 1.0MHz to 50.0MHz"/>
|
||||
</choice>
|
||||
</property>
|
||||
<property Type="choicelist" Value="5" id="The Target Scan Format"/>
|
||||
</choice>
|
||||
</property>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="CC2640F128" href="devices/cc2640f128.xml" id="CC2640F128" xml="cc2640f128.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
|
||||
on the device and connection settings specified in your project on the Properties > General page.
|
||||
|
||||
Please note that in automatic target-configuration management, changes to the project's device and/or
|
||||
connection settings will either modify an existing or generate a new target-configuration file. Thus,
|
||||
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
|
||||
you may create your own target-configuration file for this project and manage it manually. You can
|
||||
always switch back to automatic target-configuration management by checking the "Manage the project's
|
||||
target-configuration automatically" checkbox on the project's Properties > General page.
|
||||
+55
-55
@@ -18,8 +18,8 @@
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.rtsc.XDCtools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser;org.eclipse.cdt.core.GmakeErrorParser" id="com.ti.ccstudio.buildDefinitions.TMS470.Default.67178137" name="FlashROM" parent="com.ti.ccstudio.buildDefinitions.TMS470.Default" postbuildStep="${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}.out" prebuildStep="">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.67178137." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.1186623850" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.90032441">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.25923151" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.410623502" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1351821865">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1751124300" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC2650F128"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
@@ -34,17 +34,17 @@
|
||||
<listOptionValue builtIn="false" value="LINK_ORDER=TOOLS/ccs_linker_defines.cmd;TOOLS/cc26xx_app.cmd;"/>
|
||||
<listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1274638070" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.1583866282" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.1059282767" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.1196688968" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.457970119" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.1884400605" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.1388030727" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.1955817222" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.1322087609" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.1900105735" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.1761118836" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.277675815" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.1593934674" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.632414212" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.154623462" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.974280107" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.1783826131" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.1536570599" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.1895413316" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.322983319" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.1305400753" name="Speed vs. size trade-offs (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.1468985930" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
|
||||
<listOptionValue builtIn="false" value="C:\ti\simplelink\ble_sdk_2_02_02_25\src\examples\simple_peripheral\cc26xx\app\headstage"/>
|
||||
<listOptionValue builtIn="false" value="${SRC_EX}/examples/simple_peripheral/cc26xx/app"/>
|
||||
@@ -70,7 +70,7 @@
|
||||
<listOptionValue builtIn="false" value="${SRC_BLE_CORE}/rom"/>
|
||||
<listOptionValue builtIn="false" value="${CC26XXWARE}"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1111983062" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1897088" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="BOARD_DISPLAY_EXCLUDE_UART"/>
|
||||
<listOptionValue builtIn="false" value="POWER_SAVING"/>
|
||||
<listOptionValue builtIn="false" value="BOOSTXL_CC2650MA"/>
|
||||
@@ -86,71 +86,71 @@
|
||||
<listOptionValue builtIn="false" value="xdc_runtime_Assert_DISABLE_ALL"/>
|
||||
<listOptionValue builtIn="false" value="xdc_runtime_Log_DISABLE_ALL"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.150230280" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.2124166047" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC.1531734966" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.1843067675" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.871011287" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.863089168" name="C Dialect" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC.1454248503" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.1965115059" name="Suppress diagnostic <id> (--diag_suppress, -pds)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="48"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1095395954" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1638011093" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.654804449" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.31374450" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.1727784462" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.1267949125" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.1920170652" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.2038786257" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.811478344" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.1229809338" name="Read options from specified file (--cmd_file, -@)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="${SRC_EX}/config/build_components.opt"/>
|
||||
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/build_config.opt"/>
|
||||
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/../../ccs/config/ccs_compiler_defines.bcfg"/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1716338669" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.1116649612" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.1248249991" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.1787451610" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1540775079" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.319000695" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.270651019" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.463094612" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.90032441" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.678020131" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.714199963" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.514448618" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.371673032" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.670216381" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1351821865" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.174129193" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.567300083" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.1800982811" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.1091211742" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1479599481" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="libc.a"/>
|
||||
<listOptionValue builtIn="false" value="${CC26XXWARE}/driverlib/bin/ccs/driverlib.lib"/>
|
||||
<listOptionValue builtIn="false" value="${ROM}/common_rom_releases/03282014/common_rom.symbols"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.799498475" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.672837228" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/>
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.878791489" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.544523272" name="Suppress diagnostic <id> (--diag_suppress)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="10247-D"/>
|
||||
<listOptionValue builtIn="false" value="16002-D"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1596376977" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.1952641404" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.2105328132" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.597099306" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.2031149449" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.1635732611" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.538779003" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.2040762360" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1281207998" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.468817864" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.1679096029" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.254835397" name="Aggressively reduce size of the DWARF information (--compress_dwarf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.1848192295" name="Eliminate sections not needed in the executable (--unused_section_elimination)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.1999849945" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.25027104" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.888093741" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.809761366" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1676895422" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.2121665528" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.1080654307" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.19288898" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.11734737" name="Specify rom width (--romwidth, -romwidth=width)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.466140455" name="Specify memory width (--memwidth, -memwidth=width)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.824070691" name="Output format" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.332020998" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.669594991" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
|
||||
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1392704063" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.225737408" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_REPOS}"/>
|
||||
<listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/>
|
||||
</option>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1674192526" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M3" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.1574179765" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1927118034" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.280895421" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.1769581507" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="${CG_TOOL_ROOT}" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.216428433" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value=""${COMPILER_FLAGS}"" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.571281110" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M3" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.205178830" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1097777495" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.744121344" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.165807018" name="Compiler tools directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="${CG_TOOL_ROOT}" valueType="string"/>
|
||||
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.391961861" name="Additional compiler options (--compileOptions)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value=""${COMPILER_FLAGS}"" valueType="string"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+45
-45
@@ -15,8 +15,8 @@
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684" name="FlashROM" parent="com.ti.ccstudio.buildDefinitions.TMS470.Default" postannouncebuildStep="" postbuildStep="${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}.out;${TOOLS_BLE}/frontier/frontier.exe ccs ${PROJECT_LOC}/${ConfigName}/${ProjName}_linkInfo.xml ${ORG_PROJ_DIR}/../../ccs/config/ccs_compiler_defines.bcfg ${ORG_PROJ_DIR}/../../ccs/config/ccs_linker_defines.cmd" preannouncebuildStep="" prebuildStep=""${TOOLS_BLE}/lib_search/lib_search.exe" ${ORG_PROJ_DIR}/build_config.opt "${TOOLS_BLE}/lib_search/params_split_cc2640.xml" ${SRC_BLE_CORE}/../blelib "${ORG_PROJ_DIR}/../../ccs/config/lib_linker.cmd"">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.850849537" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.331655106">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1724835356" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.958553711" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.2088015050">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.2112506999" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC2650F128"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
@@ -26,17 +26,17 @@
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.666327966" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.3.LTS" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.1673392813" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.1688981434" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.2002014507" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.928057445" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.363491606" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.443895835" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.1375674256" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.1533411472" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.1721351354" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.1719259893" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.101349069" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.572884961" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.50794417" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.783335843" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.341974501" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.274225680" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.529764162" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.1837039616" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.1393115220" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.2112471580" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.152832201" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
|
||||
<listOptionValue builtIn="false" value="${SRC_EX}/examples/simple_peripheral/cc26xx/stack"/>
|
||||
<listOptionValue builtIn="false" value="${SRC_EX}/common/cc26xx"/>
|
||||
@@ -60,7 +60,7 @@
|
||||
<listOptionValue builtIn="false" value="${SRC_EX}/profiles/roles"/>
|
||||
<listOptionValue builtIn="false" value="${CC26XXWARE}"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1107811589" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1361895403" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="CC26XX"/>
|
||||
<listOptionValue builtIn="false" value="POWER_SAVING"/>
|
||||
<listOptionValue builtIn="false" value="CC26XXWARE"/>
|
||||
@@ -81,60 +81,60 @@
|
||||
<listOptionValue builtIn="false" value="xTESTMODES"/>
|
||||
<listOptionValue builtIn="false" value="xTEST_BLEBOARD"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.1674781048" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.1197031762" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.1555958931" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.1144396572" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="48"/>
|
||||
<listOptionValue builtIn="false" value="16004"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1813719590" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1546809951" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.2006801438" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.1274302360" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.48398547" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.12083718" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.1432753391" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.1345637669" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="${SRC_EX}/config/build_components.opt"/>
|
||||
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/build_config.opt"/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.492800473" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.768144029" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.1389861753" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.386445499" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1884548091" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.682104615" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.662317863" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.728508440" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.331655106" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.1381036144" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.168506890" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.1212672730" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.943483147" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1640345534" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.2088015050" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.1079333148" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.1347544490" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.136883143" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.1510359183" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1331488920" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="libc.a"/>
|
||||
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/../../ccs/config/lib_linker.cmd"/>
|
||||
<listOptionValue builtIn="false" value="${ROM}/ble_rom_releases/04242014/ble_rom_patch.symbols"/>
|
||||
<listOptionValue builtIn="false" value="${CC26XXWARE}/driverlib/bin/ccs/driverlib.lib"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.1254215569" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.1835383942" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/>
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.2091600131" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.821225577" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="16002-D"/>
|
||||
<listOptionValue builtIn="false" value="10247-D"/>
|
||||
<listOptionValue builtIn="false" value="10325-D"/>
|
||||
<listOptionValue builtIn="false" value="10229-D"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1553293947" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.122135915" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.170909146" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT.77470480" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT" value="startup_entry" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.24377159" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.666479043" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.799367454" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.784739363" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.1832938351" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1390204935" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.1601082213" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.351715800" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT.90863272" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT" value="startup_entry" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.1779672459" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.1701763005" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.687564793" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.1056923280" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.73723664" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.1558403974" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.486753383" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.2140626646" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.1451244882" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.1766088709" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.494132983" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.1603693219" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.1153492005" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
** Stack Frontier Generator 1.1.0 (2019-10-25 12:10:03.055000)
|
||||
** Stack Frontier Generator 1.1.0 (2016-03-28 14:11:07.308000)
|
||||
**
|
||||
** WARNING - Auto-generated file. Modifications could be lost!
|
||||
*/
|
||||
|
||||
--define=ICALL_STACK0_ADDR=0xf001
|
||||
--define=ICALL_STACK0_START=0xf000
|
||||
--define=ICALL_RAM0_START=0x20004320
|
||||
|
||||
--define=ICALL_STACK0_ADDR=0xe001
|
||||
--define=ICALL_STACK0_START=0xe000
|
||||
--define=ICALL_RAM0_START=0x20004368
|
||||
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
** Stack Frontier Generator 1.1.0 (2019-10-25 12:10:03.055000)
|
||||
** Stack Frontier Generator 1.1.0 (2016-03-28 14:11:07.308000)
|
||||
**
|
||||
** WARNING - Auto-generated file. Modifications could be lost!
|
||||
*/
|
||||
|
||||
--define=ICALL_RAM0_START=0x20004320
|
||||
--define=ICALL_STACK0_START=0xf000
|
||||
--define=ICALL_STACK0_ADDR=0xf001
|
||||
|
||||
--define=ICALL_RAM0_START=0x20004368
|
||||
--define=ICALL_STACK0_START=0xe000
|
||||
--define=ICALL_STACK0_ADDR=0xe001
|
||||
|
||||
+2
-2
@@ -4,5 +4,5 @@
|
||||
*/
|
||||
|
||||
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\host\host_pxxx.a"
|
||||
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\ctrl\cc2640\cc2640_ctrl_pxxx.a"
|
||||
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\hci_tl\cc26xx\cc26xx_hci_tl_none.a"
|
||||
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\ctrl\cc2640\cc2640_ctrl_pxxx_ext.a"
|
||||
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\hci_tl\cc26xx\cc26xx_hci_tl_none_v41_v42.a"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+246
@@ -0,0 +1,246 @@
|
||||
|
||||
#ifndef Elite15_PIN
|
||||
#define Elite_15PIN
|
||||
|
||||
#include "Elite_PIN.h"
|
||||
|
||||
static void update_latch_status (uint32_t latch_num, uint32_t elite_pin, bool highlow) {
|
||||
switch (latch_num) {
|
||||
case LOAD0: {
|
||||
switch (elite_pin) {
|
||||
case D0: {
|
||||
LH.LATCH0[0] = highlow;
|
||||
break;
|
||||
}
|
||||
case D1: {
|
||||
LH.LATCH0[1] = highlow;
|
||||
break;
|
||||
}
|
||||
case D2: {
|
||||
LH.LATCH0[2] = highlow;
|
||||
break;
|
||||
}
|
||||
case D3: {
|
||||
LH.LATCH0[3] = highlow;
|
||||
break;
|
||||
}
|
||||
case D4: {
|
||||
LH.LATCH0[4] = highlow;
|
||||
break;
|
||||
}
|
||||
case D5: {
|
||||
LH.LATCH0[5] = highlow;
|
||||
break;
|
||||
}
|
||||
case D6: {
|
||||
LH.LATCH0[6] = highlow;
|
||||
break;
|
||||
}
|
||||
case D7: {
|
||||
LH.LATCH0[7] = highlow;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LOAD1: {
|
||||
switch (elite_pin) {
|
||||
case D0: {
|
||||
LH.LATCH1[0] = highlow;
|
||||
break;
|
||||
}
|
||||
case D1: {
|
||||
LH.LATCH1[1] = highlow;
|
||||
break;
|
||||
}
|
||||
case D2: {
|
||||
LH.LATCH1[2] = highlow;
|
||||
break;
|
||||
}
|
||||
case D3: {
|
||||
LH.LATCH1[3] = highlow;
|
||||
break;
|
||||
}
|
||||
case D4: {
|
||||
LH.LATCH1[4] = highlow;
|
||||
break;
|
||||
}
|
||||
case D5: {
|
||||
LH.LATCH1[5] = highlow;
|
||||
break;
|
||||
}
|
||||
case D6: {
|
||||
LH.LATCH1[6] = highlow;
|
||||
break;
|
||||
}
|
||||
case D7: {
|
||||
LH.LATCH1[7] = highlow;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LOAD2: {
|
||||
switch (elite_pin) {
|
||||
case D0: {
|
||||
LH.LATCH2[0] = highlow;
|
||||
break;
|
||||
}
|
||||
case D1: {
|
||||
LH.LATCH2[1] = highlow;
|
||||
break;
|
||||
}
|
||||
case D2: {
|
||||
LH.LATCH2[2] = highlow;
|
||||
break;
|
||||
}
|
||||
case D3: {
|
||||
LH.LATCH2[3] = highlow;
|
||||
break;
|
||||
}
|
||||
case D4: {
|
||||
LH.LATCH2[4] = highlow;
|
||||
break;
|
||||
}
|
||||
case D5: {
|
||||
LH.LATCH2[5] = highlow;
|
||||
break;
|
||||
}
|
||||
case D6: {
|
||||
LH.LATCH2[6] = highlow;
|
||||
break;
|
||||
}
|
||||
case D7: {
|
||||
LH.LATCH2[7] = highlow;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void PIN15_setOutputValue (uint32_t latch_num, uint32_t pin_num, bool highlow) {
|
||||
ELITE15_SPI_CLOSE();
|
||||
add_elite_pin();
|
||||
update_latch_status (latch_num, pin_num, highlow);
|
||||
// PIN_setOutputValue(&ZM_rst, latch_num, 1); // Turn on latch
|
||||
|
||||
switch (latch_num) {
|
||||
case LOAD0: {
|
||||
// PIN_setOutputValue(&ZM_rst, D0, LH.LATCH0[0]);
|
||||
// PIN_setOutputValue(&ZM_rst, D1, LH.LATCH0[1]);
|
||||
// PIN_setOutputValue(&ZM_rst, D2, LH.LATCH0[2]);
|
||||
// PIN_setOutputValue(&ZM_rst, D3, LH.LATCH0[3]);
|
||||
PIN_setOutputValue(pin_handle, D4, LH.LATCH0[4]);
|
||||
PIN_setOutputValue(pin_handle, D5, LH.LATCH0[5]);
|
||||
PIN_setOutputValue(pin_handle, D6, LH.LATCH0[6]);
|
||||
PIN_setOutputValue(pin_handle, D7, LH.LATCH0[7]);
|
||||
break;
|
||||
}
|
||||
case LOAD1: {
|
||||
PIN_setOutputValue(pin_handle, D0, LH.LATCH1[0]);
|
||||
PIN_setOutputValue(pin_handle, D1, LH.LATCH1[1]);
|
||||
PIN_setOutputValue(pin_handle, D2, LH.LATCH1[2]);
|
||||
PIN_setOutputValue(pin_handle, D3, LH.LATCH1[3]);
|
||||
PIN_setOutputValue(pin_handle, D4, LH.LATCH1[4]);
|
||||
PIN_setOutputValue(pin_handle, D5, LH.LATCH1[5]);
|
||||
PIN_setOutputValue(pin_handle, D6, LH.LATCH1[6]);
|
||||
PIN_setOutputValue(pin_handle, D7, LH.LATCH1[7]);
|
||||
break;
|
||||
}
|
||||
case LOAD2: {
|
||||
PIN_setOutputValue(pin_handle, D0, LH.LATCH2[0]);
|
||||
PIN_setOutputValue(pin_handle, D1, LH.LATCH2[1]);
|
||||
PIN_setOutputValue(pin_handle, D2, LH.LATCH2[2]);
|
||||
PIN_setOutputValue(pin_handle, D3, LH.LATCH2[3]);
|
||||
PIN_setOutputValue(pin_handle, D4, LH.LATCH2[4]);
|
||||
PIN_setOutputValue(pin_handle, D5, LH.LATCH2[5]);
|
||||
PIN_setOutputValue(pin_handle, D6, LH.LATCH2[6]);
|
||||
PIN_setOutputValue(pin_handle, D7, LH.LATCH2[7]);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
PIN_setOutputValue(&ZM_rst, latch_num, 1); // Turn on latch
|
||||
CPUdelay(10);
|
||||
PIN_setOutputValue(&ZM_rst, latch_num, 0); // Turn off latch
|
||||
remove_elite_pin();
|
||||
ELITE15_SPI_HOLD();
|
||||
}
|
||||
|
||||
static void Init_Elite15_PIN () {
|
||||
InitLH();
|
||||
add_elite_pin();
|
||||
|
||||
PIN_setOutputValue(pin_handle, D0, 0);
|
||||
PIN_setOutputValue(pin_handle, D1, 0);
|
||||
PIN_setOutputValue(pin_handle, D2, 0);
|
||||
PIN_setOutputValue(pin_handle, D3, 0);
|
||||
PIN_setOutputValue(pin_handle, D4, 0);
|
||||
PIN_setOutputValue(pin_handle, D5, 0);
|
||||
PIN_setOutputValue(pin_handle, D6, 0);
|
||||
PIN_setOutputValue(pin_handle, D7, 0);
|
||||
PIN_setOutputValue(pin_handle, LOAD0, 0);
|
||||
PIN_setOutputValue(pin_handle, LOAD1, 1);
|
||||
PIN_setOutputValue(pin_handle, LOAD2, 1);
|
||||
CPUdelay(10);
|
||||
PIN_setOutputValue(pin_handle, LOAD1, 0);
|
||||
PIN_setOutputValue(pin_handle, LOAD2, 0);
|
||||
|
||||
|
||||
PIN_setOutputValue(pin_handle, D0, 0);
|
||||
PIN_setOutputValue(pin_handle, D1, 0);
|
||||
PIN_setOutputValue(pin_handle, D2, 0);
|
||||
PIN_setOutputValue(pin_handle, D3, 0);
|
||||
PIN_setOutputValue(pin_handle, D4, 1);
|
||||
PIN_setOutputValue(pin_handle, D5, 1);
|
||||
PIN_setOutputValue(pin_handle, D6, 1);
|
||||
PIN_setOutputValue(pin_handle, D7, 1);
|
||||
CPUdelay(10);
|
||||
PIN_setOutputValue(pin_handle, LOAD0, 1);
|
||||
PIN_setOutputValue(pin_handle, LOAD0, 0);
|
||||
|
||||
remove_elite_pin();
|
||||
|
||||
// InitLH();
|
||||
// add_elite_pin();
|
||||
//
|
||||
// PIN_setOutputValue(pin_handle, LOAD0, 1);
|
||||
// PIN_setOutputValue(pin_handle, LOAD1, 1);
|
||||
// PIN_setOutputValue(pin_handle, LOAD2, 1);
|
||||
// CPUdelay(10);
|
||||
// PIN_setOutputValue(pin_handle, D0, 0);
|
||||
// PIN_setOutputValue(pin_handle, D1, 0);
|
||||
// PIN_setOutputValue(pin_handle, D2, 0);
|
||||
// PIN_setOutputValue(pin_handle, D3, 0);
|
||||
// PIN_setOutputValue(pin_handle, D4, 0);
|
||||
// PIN_setOutputValue(pin_handle, D5, 0);
|
||||
// PIN_setOutputValue(pin_handle, D6, 0);
|
||||
// PIN_setOutputValue(pin_handle, D7, 0);
|
||||
// CPUdelay(10);
|
||||
// PIN_setOutputValue(pin_handle, LOAD0, 0);
|
||||
// PIN_setOutputValue(pin_handle, LOAD1, 0);
|
||||
// PIN_setOutputValue(pin_handle, LOAD2, 0);
|
||||
//
|
||||
// remove_elite_pin();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
+502
-20
@@ -6,13 +6,12 @@
|
||||
#include "EliteSPI.h"
|
||||
#include "EliteNotify.h"
|
||||
|
||||
|
||||
// Elite ADC macro
|
||||
// ADC command, Elite will use these cmd to control ADC
|
||||
#define CMD_CURRENT_MEASURE 0xC5
|
||||
#define CMD_VOLT_MEASURE 0xD5
|
||||
#define CMD_DAC_MEASURE 0xE5
|
||||
#define CMD_BATTERY_MEASURE 0xF5
|
||||
#define CMD_BATTERY_MEASURE 0xF1
|
||||
|
||||
// controller command, these are command from control box
|
||||
#define ADC_CH_CURRENT 0x00
|
||||
@@ -47,7 +46,6 @@ static void ADC_write(uint8_t ADCin) {
|
||||
spi_ADC_txbuf[0] = ADCin;
|
||||
spi_ADC_txbuf[1] = 0b11101011;
|
||||
|
||||
|
||||
ADC_SPI(2, spi_ADC_txbuf, spi_ADC_rxbuf);
|
||||
}
|
||||
|
||||
@@ -57,32 +55,110 @@ static void ADC_read(uint8_t *ADCdata){
|
||||
spi_ADC_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
ADC_SPI(SPI_ADC_SIZE, spi_ADC_txbuf, ADCdata);
|
||||
ADC_SPI(2, spi_ADC_txbuf, spi_ADC_rxbuf);
|
||||
}
|
||||
|
||||
static void ADCGainControl(uint8_t ADCLevel){
|
||||
if(ADCLevel == 0){
|
||||
// ADC gain level = 0, using 200R resister
|
||||
PIN_setOutputValue(pin_handle, Turnon10K, 0);
|
||||
PIN_setOutputValue(pin_handle, Turnon100R, 0);
|
||||
/* Elite1.5 Calibration Usage */
|
||||
static void CAL_ADC_read(uint8_t *ADCdata){
|
||||
for(int i=0 ; i<SPI_ADC_SIZE ; i++){
|
||||
spi_ADC_txbuf[i] = 0;
|
||||
spi_ADC_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
CAL_ADC_SPI(SPI_ADC_SIZE, spi_ADC_txbuf, ADCdata);
|
||||
}
|
||||
|
||||
static void CAL_ADC_write(uint8_t ADCin) {
|
||||
for(int i=0 ; i<SPI_ADC_SIZE ; i++){
|
||||
spi_ADC_txbuf[i] = 0;
|
||||
spi_ADC_rxbuf[i] = 0;
|
||||
}
|
||||
else if(ADCLevel == 1){
|
||||
// ADC gain level = 1, using 10K resister
|
||||
PIN_setOutputValue(pin_handle, Turnon10K, 1);
|
||||
PIN_setOutputValue(pin_handle, Turnon100R, 0);
|
||||
|
||||
spi_ADC_txbuf[0] = ADCin;
|
||||
spi_ADC_txbuf[1] = 0b11101011;
|
||||
|
||||
CAL_ADC_SPI(2, spi_ADC_txbuf, spi_ADC_rxbuf);
|
||||
}
|
||||
|
||||
/* Gain Control for Vin & Iin */
|
||||
static void IinADCGainControl(uint8_t IinADCLevel){
|
||||
if(IinADCLevel == 0){
|
||||
// ADC gain level = 0, using 3M resister
|
||||
PIN15_setOutputValue(Turnon_I_LARGE, 0);
|
||||
PIN15_setOutputValue(Turnon_I_MID, 0);
|
||||
PIN15_setOutputValue(Turnon_I_SMALL, 0);
|
||||
}
|
||||
else if(ADCLevel == 2){
|
||||
// ADC gain level = 2, using 100R resister
|
||||
PIN_setOutputValue(pin_handle, Turnon10K, 0);
|
||||
PIN_setOutputValue(pin_handle, Turnon100R, 1);
|
||||
else if(IinADCLevel == 1){
|
||||
// ADC gain level = 1, using 100K resister
|
||||
PIN15_setOutputValue(Turnon_I_LARGE, 0);
|
||||
PIN15_setOutputValue(Turnon_I_MID, 0);
|
||||
PIN15_setOutputValue(Turnon_I_SMALL, 1);
|
||||
}
|
||||
else if(IinADCLevel == 2){
|
||||
// ADC gain level = 2, using 3K resister
|
||||
PIN15_setOutputValue(Turnon_I_LARGE, 0);
|
||||
PIN15_setOutputValue(Turnon_I_MID, 1);
|
||||
PIN15_setOutputValue(Turnon_I_SMALL, 0);
|
||||
}
|
||||
else if(IinADCLevel == 3){
|
||||
// ADC gain level = 3, using 100R resistor
|
||||
PIN15_setOutputValue(Turnon_I_LARGE, 1);
|
||||
PIN15_setOutputValue(Turnon_I_MID, 0);
|
||||
PIN15_setOutputValue(Turnon_I_SMALL, 0);
|
||||
}
|
||||
else if(IinADCLevel == 4){
|
||||
// ADC gain level = 3, auto gain (using 100R resister)
|
||||
PIN15_setOutputValue(Turnon_I_LARGE, 1);
|
||||
PIN15_setOutputValue(Turnon_I_MID, 0);
|
||||
PIN15_setOutputValue(Turnon_I_SMALL, 0);
|
||||
}
|
||||
else{
|
||||
// default using 200R resister
|
||||
PIN_setOutputValue(pin_handle, Turnon10K, 0);
|
||||
PIN_setOutputValue(pin_handle, Turnon100R, 0);
|
||||
// default using 100R resister
|
||||
PIN15_setOutputValue(Turnon_I_LARGE, 1);
|
||||
PIN15_setOutputValue(Turnon_I_MID, 0);
|
||||
PIN15_setOutputValue(Turnon_I_SMALL, 0);
|
||||
}
|
||||
|
||||
if(IinADCLevel == 0 || IinADCLevel == 1 || IinADCLevel == 2 || IinADCLevel == 3){
|
||||
lastIinADCGainLevel = IinADCLevel;
|
||||
}else{
|
||||
lastIinADCGainLevel = 3;
|
||||
}
|
||||
}
|
||||
|
||||
static void VinADCGainControl(uint8_t VinADCLevel){
|
||||
if(VinADCLevel == 0){
|
||||
// Vin ADC gain level = 0, using 1M resister
|
||||
PIN15_setOutputValue(Turnon_V_SMALL, 0);
|
||||
PIN15_setOutputValue(Turnon_V_MID, 0);
|
||||
}
|
||||
else if(VinADCLevel == 1){
|
||||
// Vin ADC gain level = 1, using 30K resister
|
||||
PIN15_setOutputValue(Turnon_V_SMALL, 0);
|
||||
PIN15_setOutputValue(Turnon_V_MID, 1);
|
||||
}
|
||||
else if(VinADCLevel == 2){
|
||||
// Vin ADC gain level = 2, using 1K resister
|
||||
PIN15_setOutputValue(Turnon_V_SMALL, 1);
|
||||
PIN15_setOutputValue(Turnon_V_MID, 0);
|
||||
}
|
||||
else if(VinADCLevel == 3){
|
||||
// Vin ADC gain level = 3, auto gain (using 1K resister)
|
||||
PIN15_setOutputValue(Turnon_V_SMALL, 1);
|
||||
PIN15_setOutputValue(Turnon_V_MID, 0);
|
||||
}
|
||||
else{
|
||||
// default using 1K resister
|
||||
PIN15_setOutputValue(Turnon_V_SMALL, 1);
|
||||
PIN15_setOutputValue(Turnon_V_MID, 0);
|
||||
}
|
||||
|
||||
if(VinADCLevel == 0 || VinADCLevel == 1 || VinADCLevel == 2){
|
||||
lastVinADCGainLevel = VinADCLevel;
|
||||
}else{
|
||||
lastVinADCGainLevel = 2;
|
||||
}
|
||||
}
|
||||
|
||||
static void ADCChannelSelect(uint8_t ADCChannel){
|
||||
// set ADC parameter
|
||||
@@ -121,4 +197,410 @@ static void ADCChannelSelect(uint8_t ADCChannel){
|
||||
}
|
||||
}
|
||||
|
||||
static void ReadADCIin(uint8_t *buf){
|
||||
// Read data twice since the first data we get is previous data
|
||||
// IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
ADCChannelSelect(ADC_CH_CURRENT);
|
||||
ADC_read(buf);
|
||||
|
||||
ADCChannelSelect(ADC_CH_CURRENT);
|
||||
ADC_read(buf);
|
||||
}
|
||||
|
||||
static void ReadADCVin(uint8_t *buf){
|
||||
// Read data twice since the first data we get is previous data
|
||||
|
||||
// VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
ADCChannelSelect(ADC_CH_VOLT);
|
||||
ADC_read(buf);
|
||||
|
||||
ADCChannelSelect(ADC_CH_VOLT);
|
||||
ADC_read(buf);
|
||||
}
|
||||
|
||||
static void ReadADCVout(uint8_t *buf){
|
||||
// Read data twice since the first data we get is previous data
|
||||
ADCChannelSelect(ADC_CH_DAC);
|
||||
ADC_read(buf);
|
||||
|
||||
ADCChannelSelect(ADC_CH_DAC);
|
||||
ADC_read(buf);
|
||||
}
|
||||
|
||||
static void ReadADCBat(uint8_t *buf){
|
||||
// Read data twice since the first data we get is previous data
|
||||
ADCChannelSelect(ADC_CH_BAT);
|
||||
ADC_read(buf);
|
||||
|
||||
ADCChannelSelect(ADC_CH_BAT);
|
||||
ADC_read(buf);
|
||||
}
|
||||
|
||||
/* for Elite1.5-re */
|
||||
// Iin theoretical boundary <2.67, 1.89~80, 63~2600, >1900 (uA)
|
||||
/* Old boundary
|
||||
#define I_GAIN_SMALL_BOUNDARY 4000 // 4 uA = 4,000,000 pA
|
||||
#define I_GAIN_MID1_BOUNDARY1 2000 // 2 uA = 2,000,000 pA
|
||||
#define I_GAIN_MID1_BOUNDARY2 90000 // 90 uA = 90,000,000 pA
|
||||
#define I_GAIN_MID2_BOUNDARY1 70000 // 70 uA = 70,000,000 pA
|
||||
#define I_GAIN_MID2_BOUNDARY2 1800000 // 1800 uA = 1,800,000 nA
|
||||
#define I_GAIN_LARGE_BOUNDARY 950000 // 950 uA = 950,000 nA
|
||||
*/
|
||||
#define I_GAIN_SMALL_BOUNDARY 4000 // 4 uA = 4,000,000 pA
|
||||
#define I_GAIN_MID1_BOUNDARY1 2500 // 2.5 uA = 2,500,000 pA
|
||||
#define I_GAIN_MID1_BOUNDARY2 100000 // 100 uA = 100,000,000 pA
|
||||
#define I_GAIN_MID2_BOUNDARY1 85000 // 85 uA = 85,000,000 pA
|
||||
#define I_GAIN_MID2_BOUNDARY2 2050000 // 2050 uA = 2,050,000 nA
|
||||
#define I_GAIN_LARGE_BOUNDARY 1800000 // 1800 uA = 1,800,000 nA
|
||||
|
||||
// Vin theoretical boundary <7, 5~200, >100 (mV)
|
||||
#define VIN_GAIN_SMALL_BOUNDARY 7000 // 7 mV = 7,000,000 nV
|
||||
#define VIN_GAIN_MID1_BOUNDARY1 5000 // 5 mV = 5,000,000 nV
|
||||
#define VIN_GAIN_MID1_BOUNDARY2 300000 // 300 mV = 300,000,000 nV
|
||||
#define VIN_GAIN_LARGE_BOUNDARY 250000 // 250 mV = 250,000,000 nV
|
||||
|
||||
static int32_t AutoGainReadIin(uint8_t *buf){
|
||||
int32_t RealCurrent = 0;
|
||||
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
RealCurrent = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
|
||||
|
||||
return RealCurrent;
|
||||
}
|
||||
|
||||
static int32_t AutoGainReadVin(uint8_t *buf){
|
||||
int32_t RealVolt = 0;
|
||||
|
||||
ReadADCVin(spi_ADC_rxbuf);
|
||||
RealVolt = DecodeADCValue(INSTRUCTION.VinADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
|
||||
|
||||
return RealVolt;
|
||||
}
|
||||
|
||||
static void AutoGainChangeIin(int32_t RealCurrent){
|
||||
// switch to 1 level current(small) 3M
|
||||
// switch to 2 level current 100K
|
||||
// switch to 3 level current 3K
|
||||
// switch to 4 level current(large) 100R
|
||||
if(INSTRUCTION.ADCGainLevel == I_GAIN_100R){
|
||||
if(RealCurrent < I_GAIN_LARGE_BOUNDARY && RealCurrent > -1*I_GAIN_LARGE_BOUNDARY){
|
||||
// switch to 1 level current(small)
|
||||
if (RealCurrent < I_GAIN_MID1_BOUNDARY1 && RealCurrent > -1*I_GAIN_MID1_BOUNDARY1){
|
||||
I_GAIN_3M_counter++;
|
||||
if(I_GAIN_3M_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_3M;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_3M_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
// switch to 2 level current
|
||||
else if (RealCurrent < I_GAIN_MID2_BOUNDARY1 && RealCurrent > -1*I_GAIN_MID2_BOUNDARY1){
|
||||
I_GAIN_100K_counter++;
|
||||
if(I_GAIN_100K_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_100K;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_100K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
// switch to 3 level current
|
||||
else{
|
||||
I_GAIN_3K_counter++;
|
||||
if(I_GAIN_3K_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_3K;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_3K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(I_GAIN_3K_counter > 0){
|
||||
I_GAIN_3K_counter--;
|
||||
}
|
||||
if(I_GAIN_100K_counter > 0){
|
||||
I_GAIN_100K_counter--;
|
||||
}
|
||||
if(I_GAIN_3M_counter > 0){
|
||||
I_GAIN_3M_counter--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(INSTRUCTION.ADCGainLevel == I_GAIN_3K){
|
||||
// switch to 4 level current(large)
|
||||
if(RealCurrent > I_GAIN_MID2_BOUNDARY2 || RealCurrent < -1*I_GAIN_MID2_BOUNDARY2){
|
||||
I_GAIN_100R_counter++;
|
||||
if(I_GAIN_100R_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_100R;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_100R_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
else if (RealCurrent < I_GAIN_MID2_BOUNDARY1 && RealCurrent > -1*I_GAIN_MID2_BOUNDARY1){
|
||||
// switch to 1 level current(small)
|
||||
if(RealCurrent < I_GAIN_MID1_BOUNDARY1 && RealCurrent > -1*I_GAIN_MID1_BOUNDARY1){
|
||||
I_GAIN_3M_counter++;
|
||||
if(I_GAIN_3M_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_3M;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_3M_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
// switch to 2 level current
|
||||
else{
|
||||
I_GAIN_100K_counter++;
|
||||
if(I_GAIN_100K_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_100K;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_100K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(I_GAIN_100R_counter > 0){
|
||||
I_GAIN_100R_counter--;
|
||||
}
|
||||
if(I_GAIN_100K_counter > 0){
|
||||
I_GAIN_100K_counter--;
|
||||
}
|
||||
if(I_GAIN_3M_counter > 0){
|
||||
I_GAIN_3M_counter--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(INSTRUCTION.ADCGainLevel == I_GAIN_100K){
|
||||
// switch to 1 level current(small)
|
||||
if(RealCurrent < I_GAIN_MID1_BOUNDARY1 && RealCurrent > -1*I_GAIN_MID1_BOUNDARY1){
|
||||
I_GAIN_3M_counter++;
|
||||
if(I_GAIN_3M_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_3M;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_3M_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
else if (RealCurrent > I_GAIN_MID1_BOUNDARY2 || RealCurrent < -1*I_GAIN_MID1_BOUNDARY2){
|
||||
// switch to 4 level current(large)
|
||||
if(RealCurrent > I_GAIN_MID2_BOUNDARY2 || RealCurrent < -1*I_GAIN_MID2_BOUNDARY2){
|
||||
I_GAIN_100R_counter++;
|
||||
if(I_GAIN_100R_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_100R;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_100R_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
// switch to 3 level current
|
||||
else{
|
||||
I_GAIN_3K_counter++;
|
||||
if(I_GAIN_3K_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_3K;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_3K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(I_GAIN_100R_counter > 0){
|
||||
I_GAIN_100R_counter--;
|
||||
}
|
||||
if(I_GAIN_3K_counter > 0){
|
||||
I_GAIN_3K_counter--;
|
||||
}
|
||||
if(I_GAIN_3M_counter > 0){
|
||||
I_GAIN_3M_counter--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(INSTRUCTION.ADCGainLevel == I_GAIN_3M){
|
||||
if(RealCurrent > I_GAIN_SMALL_BOUNDARY || RealCurrent < -1*I_GAIN_SMALL_BOUNDARY){
|
||||
// switch to 4 level current(large)
|
||||
if(RealCurrent > I_GAIN_MID2_BOUNDARY2 || RealCurrent < -1*I_GAIN_MID2_BOUNDARY2){
|
||||
I_GAIN_100R_counter++;
|
||||
if(I_GAIN_100R_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_100R;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_100R_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
// switch to 3 level current
|
||||
else if(RealCurrent > I_GAIN_MID1_BOUNDARY2 || RealCurrent < -1*I_GAIN_MID1_BOUNDARY2){
|
||||
I_GAIN_3K_counter++;
|
||||
if(I_GAIN_3K_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_3K;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_3K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
// switch to 2 level current
|
||||
else{
|
||||
I_GAIN_100K_counter++;
|
||||
if(I_GAIN_100K_counter > 2){
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_100K;
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
I_GAIN_100K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
if(I_GAIN_100R_counter > 0){
|
||||
I_GAIN_100R_counter--;
|
||||
}
|
||||
if(I_GAIN_3K_counter > 0){
|
||||
I_GAIN_3K_counter--;
|
||||
}
|
||||
if(I_GAIN_100K_counter > 0){
|
||||
I_GAIN_100K_counter--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void AutoGainChangeVin(int32_t RealVin){
|
||||
// switch to 1 level volt(small) 1M
|
||||
// switch to 2 level volt 30K
|
||||
// switch to 3 level volt(large) 1K
|
||||
if(INSTRUCTION.VinADCGainLevel == VIN_GAIN_1M){
|
||||
if(RealVin > VIN_GAIN_SMALL_BOUNDARY || RealVin < -1*VIN_GAIN_SMALL_BOUNDARY){
|
||||
// switch to 3 level volt(large)
|
||||
if (RealVin > VIN_GAIN_MID1_BOUNDARY2 || RealVin < -1*VIN_GAIN_MID1_BOUNDARY2){
|
||||
VIN_GAIN_1K_counter++;
|
||||
if(VIN_GAIN_1K_counter > 2){
|
||||
INSTRUCTION.VinADCGainLevel = VIN_GAIN_1K;
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
VIN_GAIN_1K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
// switch to 2 level volt
|
||||
else{
|
||||
VIN_GAIN_30K_counter++;
|
||||
if(VIN_GAIN_30K_counter > 2){
|
||||
INSTRUCTION.VinADCGainLevel = VIN_GAIN_30K;
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
VIN_GAIN_30K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(VIN_GAIN_1K_counter > 0){
|
||||
VIN_GAIN_1K_counter--;
|
||||
}
|
||||
if(VIN_GAIN_30K_counter > 0){
|
||||
VIN_GAIN_30K_counter--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(INSTRUCTION.VinADCGainLevel == VIN_GAIN_30K){
|
||||
// switch to 1 level volt(small)
|
||||
if(RealVin < VIN_GAIN_MID1_BOUNDARY1 && RealVin > -1*VIN_GAIN_MID1_BOUNDARY1){
|
||||
VIN_GAIN_1M_counter++;
|
||||
if(VIN_GAIN_1M_counter > 2){
|
||||
INSTRUCTION.VinADCGainLevel = VIN_GAIN_1M;
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
VIN_GAIN_1M_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
else if (RealVin > VIN_GAIN_MID1_BOUNDARY2 || RealVin < -1*VIN_GAIN_MID1_BOUNDARY2){
|
||||
// switch to 3 level volt
|
||||
VIN_GAIN_1K_counter++;
|
||||
if(VIN_GAIN_1K_counter > 2){
|
||||
INSTRUCTION.VinADCGainLevel = VIN_GAIN_1K;
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
VIN_GAIN_1K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}else{
|
||||
if(VIN_GAIN_1K_counter > 0){
|
||||
VIN_GAIN_1K_counter--;
|
||||
}
|
||||
if(VIN_GAIN_1M_counter > 0){
|
||||
VIN_GAIN_1M_counter--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(INSTRUCTION.VinADCGainLevel == VIN_GAIN_1K){
|
||||
if(RealVin < VIN_GAIN_LARGE_BOUNDARY && RealVin > -1*VIN_GAIN_LARGE_BOUNDARY){
|
||||
// switch to 1 level volt(small)
|
||||
if (RealVin < VIN_GAIN_MID1_BOUNDARY1 && RealVin > -1*VIN_GAIN_MID1_BOUNDARY1){
|
||||
VIN_GAIN_1M_counter++;
|
||||
if(VIN_GAIN_1M_counter > 2){
|
||||
INSTRUCTION.VinADCGainLevel = VIN_GAIN_1M;
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
VIN_GAIN_1M_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
// switch to 2 level volt
|
||||
else{
|
||||
VIN_GAIN_30K_counter++;
|
||||
if(VIN_GAIN_30K_counter > 2){
|
||||
INSTRUCTION.VinADCGainLevel = VIN_GAIN_30K;
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
VIN_GAIN_30K_counter = 0;
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(VIN_GAIN_1M_counter > 0){
|
||||
VIN_GAIN_1M_counter--;
|
||||
}
|
||||
if(VIN_GAIN_30K_counter > 0){
|
||||
VIN_GAIN_30K_counter--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static uint16_t ADC_CURRENT_AVG_calibration (uint8_t ADC_channel) {
|
||||
uint32_t ADCValueTemp = 0;
|
||||
uint32_t ADCValueSUM = 0;
|
||||
uint32_t ADCValueAVG = 0;
|
||||
uint16_t ADCValueAVG_RAW = 0;
|
||||
#define avgcount 10000
|
||||
|
||||
// Red light for start acquiring data
|
||||
Elite_led_color(COLOR_RED);
|
||||
// CPUdelay(10);
|
||||
for(int i=0; i<avgcount; i++){
|
||||
CAL_ADC_write(ADC_channel);
|
||||
CAL_ADC_read(spi_ADC_rxbuf);
|
||||
CPUdelay(10);
|
||||
CAL_ADC_write(ADC_channel);
|
||||
CAL_ADC_read(spi_ADC_rxbuf);
|
||||
CPUdelay(500);
|
||||
|
||||
ADCValueTemp = 0x0000FFFF & (((uint32_t) (spi_ADC_rxbuf[0]) << 8) | ((uint32_t) (spi_ADC_rxbuf[1])));
|
||||
ADCValueSUM = ADCValueSUM + ADCValueTemp;
|
||||
}
|
||||
|
||||
ADCValueAVG = ADCValueSUM / avgcount;
|
||||
ADCValueAVG_RAW = (uint16_t) (ADCValueAVG & 0x0000FFFF);
|
||||
|
||||
// Blue light for data acquire done
|
||||
Elite_led_color(COLOR_BLUE);
|
||||
|
||||
if (ADCValueAVG_RAW > 0x7FFF) {
|
||||
ADCValueAVG_RAW = 0x0000;
|
||||
}
|
||||
|
||||
// clean data
|
||||
ADCValueAVG = 0;
|
||||
ADCValueSUM = 0;
|
||||
ADCValueTemp = 0;
|
||||
|
||||
// // Blue light for data acquire done
|
||||
// Elite_led_color(COLOR_BLUE);
|
||||
|
||||
|
||||
|
||||
return ADCValueAVG_RAW;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
|
||||
#ifndef ELITECCC
|
||||
#define ELITECCC
|
||||
|
||||
#include "EliteCCMode.h"
|
||||
|
||||
|
||||
// XXX : should we reset DAC output after STOP?
|
||||
static void CCModeReverseCurrent(CCCMode *CCC){
|
||||
if(CCC->StandBy){
|
||||
if(CT.StandByCounter == CCC->StandByTime){
|
||||
CCC->StandBy = false;
|
||||
CT.StandByCounter = 0;
|
||||
}
|
||||
else{
|
||||
CT.StandByCounter ++;
|
||||
}
|
||||
}
|
||||
else{
|
||||
// reverse charge/discharge
|
||||
if(CCC->BatteryV == CCC->VMax){
|
||||
CCC->StandBy = true;
|
||||
CCC->value = CCC->DischargeCurrent;
|
||||
}
|
||||
else if(CCC->BatteryV == CCC->VMin){
|
||||
CCC->StandBy = true;
|
||||
CCC->value = CCC->ChargeCurrent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
+62
-316
@@ -2,336 +2,82 @@
|
||||
#ifndef ELITECCMODE
|
||||
#define ELITECCMODE
|
||||
|
||||
#define CURRENT_LV_FOUR 4
|
||||
#define CURRENT_LV_THREE 3
|
||||
#define CURRENT_LV_TWO 2
|
||||
#define CURRENT_LV_ONE 1
|
||||
#define CURRENT_LV_ZERO 0
|
||||
#define Vset INSTRUCTION.Vset
|
||||
#define DELTAVOLTMAX 100000
|
||||
|
||||
/*********************************************************************
|
||||
* @struct Constant Current Code
|
||||
*
|
||||
* @brief A struct to handle CC mode command
|
||||
*/
|
||||
typedef struct _CURRENT_USER_CODE {
|
||||
/** current level range: 0-4 **/
|
||||
// current level = 0 => 0-499 nA => ADCGainLevel = 200K
|
||||
// current level = 1 => 500-999 nA => ADCGainLevel = 10K
|
||||
// current level = 2 => 0-499 uA => ADCGainLevel = 10K
|
||||
// current level = 3 => 500-999 uA => ADCGainLevel = 200R
|
||||
// current level = 4 => 0-499 mA => ADCGainLevel = 200R
|
||||
uint8_t lv;
|
||||
/* Transform setting CC into IUC
|
||||
*
|
||||
* User code in CC mode : 0 ~ 3000000
|
||||
* Real current value : -15.00000 ~ 15.00000 mA
|
||||
* => user code = 1500000 mapping to 0.00000 mA
|
||||
*/
|
||||
static void CC_Vscan(CCMode *CC){
|
||||
static int32_t Iin = 0;
|
||||
static int32_t deltaI = 0;
|
||||
static int32_t deltaV = 0;
|
||||
uint16_t divisionRate;
|
||||
|
||||
/** current value **/
|
||||
// current value divide current level into 50000 pieces
|
||||
uint16_t value;
|
||||
if(vscanReset){
|
||||
Vset = 0;
|
||||
|
||||
/** transform a current user code (IUC) to real current in pA **/
|
||||
// handle current lv 0~2
|
||||
int32_t (*_Transform2RealpA)(struct _CURRENT_USER_CODE *);
|
||||
if(CC->_charge == 0){
|
||||
CC->_Iset *= -1;
|
||||
}
|
||||
|
||||
/** transform an IUC to real current in nA **/
|
||||
// handle current lv 3~4
|
||||
int32_t (*_Transform2RealnA)(struct _CURRENT_USER_CODE *);
|
||||
Iin = CC->_measureCurrent * 20; //[50pA] nA => 50pA
|
||||
deltaI = Iin - CC->_Iset;
|
||||
|
||||
/** Measure Current **/
|
||||
int32_t _MeasureCurrent;
|
||||
if(deltaI > 20000000 || deltaI < -20000000){ //1mA
|
||||
divisionRate = 1000;
|
||||
}else{
|
||||
divisionRate = 10;
|
||||
}
|
||||
|
||||
/** MeasureCurrent operation **/
|
||||
void (*SetMeasureCurrent)(struct _CURRENT_USER_CODE *, int32_t);
|
||||
deltaV = -1 * (deltaI / divisionRate); //-5 * deltaI / 5000 //pV=> 5nV
|
||||
|
||||
int32_t (*GetMeasureCurrent)(struct _CURRENT_USER_CODE *);
|
||||
}CURRENT_USER_CODE;
|
||||
if(deltaV > DELTAVOLTMAX){ //100000 = 500uV
|
||||
deltaV = DELTAVOLTMAX;
|
||||
}else if(deltaV < (-DELTAVOLTMAX)){
|
||||
deltaV = (-DELTAVOLTMAX);
|
||||
}
|
||||
|
||||
//static CURRENT_USER_CODE CurrentUserCode;
|
||||
Vset = Vset + deltaV; //[5nV]
|
||||
|
||||
static int32_t CCModeReadCurrent(CURRENT_USER_CODE *CurrentUserCode){
|
||||
int32_t Real_Current = 0;
|
||||
CCModeReset = 0; // This flag will control DAC working
|
||||
if(Vset <= CC->_Vmin){
|
||||
Vset = CC->_Vmin;
|
||||
}else if(Vset >= CC->_Vmax){
|
||||
Vset = CC->_Vmax;
|
||||
}
|
||||
}
|
||||
|
||||
CCCurrent2IUC(CurrentUserCode);
|
||||
if(!vscanReset){
|
||||
Iin = CC->_measureCurrent * 20; //[50pA] nA => 50pA
|
||||
deltaI = Iin - CC->_Iset;
|
||||
|
||||
// if(CurrentUserCode->lv == CURRENT_LV_FOUR){
|
||||
// Real_Current = CurrentUserCode->_Transform2RealnA(CurrentUserCode);
|
||||
// }
|
||||
// else{
|
||||
// Real_Current = CurrentUserCode->_Transform2RealpA(CurrentUserCode);
|
||||
// }
|
||||
if(deltaI > 20000000 || deltaI < -20000000){ //1mA
|
||||
divisionRate = 1000;
|
||||
}else{
|
||||
divisionRate = 10;
|
||||
}
|
||||
|
||||
// set ADC gain according to constant current value
|
||||
SetCCModeGain(CurrentUserCode);
|
||||
deltaV = -1 * (deltaI / divisionRate); //-5 * deltaI / 5000 //pV=> 5nV
|
||||
|
||||
// read ADC current
|
||||
ADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
ADCChannelSelect(ADC_CH_CURRENT);
|
||||
CPUdelay(10);
|
||||
ADC_read(spi_ADC_rxbuf);
|
||||
if(deltaV > DELTAVOLTMAX){ //100000 = 500uV
|
||||
deltaV = DELTAVOLTMAX;
|
||||
}else if(deltaV < (-DELTAVOLTMAX)){
|
||||
deltaV = (-DELTAVOLTMAX);
|
||||
}
|
||||
|
||||
// decode ADC value and put it into notify buffer
|
||||
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
|
||||
CurrentUserCode->SetMeasureCurrent(CurrentUserCode, Real_Current);
|
||||
Vset = Vset + deltaV; //[5nV]
|
||||
|
||||
// Real_Current = CurrentUserCode->_Transform2RealpA(CurrentUserCode);
|
||||
// NotifyVolt[0] = (uint8_t) (Real_Current >> 24);
|
||||
// NotifyVolt[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16);
|
||||
// NotifyVolt[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8);
|
||||
// NotifyVolt[3] = (uint8_t) (Real_Current & 0x000000FF);
|
||||
//
|
||||
// NotifyCurrent[0] = (uint8_t) (Real_Current >> 24);
|
||||
// NotifyCurrent[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16);
|
||||
// NotifyCurrent[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8);
|
||||
// NotifyCurrent[3] = (uint8_t) (Real_Current & 0x000000FF);
|
||||
return Real_Current;
|
||||
if(Vset <= CC->_Vmin){
|
||||
Vset = CC->_Vmin;
|
||||
}else if(Vset >= CC->_Vmax){
|
||||
Vset = CC->_Vmax;
|
||||
}
|
||||
}
|
||||
// int32_t RealV;
|
||||
// RealV = (int32_t)(deltaV);
|
||||
// InputNotify(NOTIFY_IMPEDANCE, RealV);
|
||||
}
|
||||
|
||||
static int32_t CCModeVoltOut(CURRENT_USER_CODE *CurrentUserCode){
|
||||
int32_t MeasureCurrent = 0, IUCCurrent = 0;
|
||||
|
||||
if(CCModeReset){
|
||||
// DAC should not work now
|
||||
return 0;
|
||||
}
|
||||
|
||||
IUCCurrent = CurrentUserCode->_Transform2RealpA(CurrentUserCode);
|
||||
MeasureCurrent = CurrentUserCode->GetMeasureCurrent(CurrentUserCode) * 1000;
|
||||
|
||||
if(CurrentUserCode->lv != CURRENT_LV_FOUR && CurrentUserCode->lv != CURRENT_LV_THREE ){
|
||||
// if( IUCCurrent > MeasureCurrent){
|
||||
// INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + (IUCCurrent - MeasureCurrent)/1e5;
|
||||
// }
|
||||
// else{
|
||||
// INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + (IUCCurrent - MeasureCurrent)/1e5;
|
||||
// }
|
||||
// CCModeDACControl(IUCCurrent - MeasureCurrent);
|
||||
}
|
||||
NotifyVolt[0] = (uint8_t) (IUCCurrent >> 24);
|
||||
NotifyVolt[1] = (uint8_t) ((IUCCurrent & 0x00FF0000) >> 16);
|
||||
NotifyVolt[2] = (uint8_t) ((IUCCurrent & 0x0000FF00) >> 8);
|
||||
NotifyVolt[3] = (uint8_t) (IUCCurrent & 0x000000FF);
|
||||
|
||||
// DACCode2Real2Notify(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
|
||||
return MeasureCurrent;
|
||||
}
|
||||
|
||||
static void CCModeDACControl(int32_t IUC_Measure_Difference){
|
||||
INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + IUC_Measure_Difference;
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
|
||||
}
|
||||
|
||||
static void SetCCModeGain(CURRENT_USER_CODE *CurrentUserCode){
|
||||
switch(CurrentUserCode->lv){
|
||||
case CURRENT_LV_FOUR:{
|
||||
INSTRUCTION.ADCGainLevel = GAIN_200R;
|
||||
break;
|
||||
}
|
||||
case CURRENT_LV_THREE:{
|
||||
INSTRUCTION.ADCGainLevel = GAIN_200R;
|
||||
break;
|
||||
}
|
||||
case CURRENT_LV_TWO:{
|
||||
INSTRUCTION.ADCGainLevel = GAIN_10K;
|
||||
break;
|
||||
}
|
||||
case CURRENT_LV_ONE:{
|
||||
INSTRUCTION.ADCGainLevel = GAIN_200K;
|
||||
break;
|
||||
}
|
||||
case CURRENT_LV_ZERO:{
|
||||
INSTRUCTION.ADCGainLevel = GAIN_200K;
|
||||
break;
|
||||
}
|
||||
default :{
|
||||
INSTRUCTION.ADCGainLevel = GAIN_200R;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if(INSTRUCTION.ADCGainLevel == GAIN_200R){
|
||||
// LED_color(DARKLED, 0x0F, 0x00, 0x00);
|
||||
// }
|
||||
// else if(INSTRUCTION.ADCGainLevel == GAIN_10K){
|
||||
// LED_color(DARKLED, 0x0F, 0x00, 0x0F);
|
||||
// }
|
||||
// else if(INSTRUCTION.ADCGainLevel == GAIN_200K){
|
||||
// LED_color(DARKLED, 0x0F, 0x02, 0xFF);
|
||||
// }
|
||||
}
|
||||
|
||||
static void CCCurrent2IUC(CURRENT_USER_CODE *CurrentUserCode){
|
||||
if (INSTRUCTION.CurrentLV == CURRENT_LV_MA){
|
||||
// largest current ( 0~500 mA)
|
||||
CurrentUserCode->lv = CURRENT_LV_FOUR;
|
||||
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent);
|
||||
}
|
||||
else if (INSTRUCTION.CurrentLV == CURRENT_LV_UA){
|
||||
if(INSTRUCTION.ConstantCurrent >= 50000){
|
||||
// mid range current ( 500 uA ~ 999 uA)
|
||||
CurrentUserCode->lv = CURRENT_LV_THREE;
|
||||
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent - 50000);
|
||||
}
|
||||
else{
|
||||
// mid range current ( 0 uA ~ 499 uA)
|
||||
CurrentUserCode->lv = CURRENT_LV_TWO;
|
||||
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(INSTRUCTION.ConstantCurrent >= 50000){
|
||||
// mid range current ( 500 nA ~ 999 nA)
|
||||
CurrentUserCode->lv = CURRENT_LV_ONE;
|
||||
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent - 50000);
|
||||
}
|
||||
else{
|
||||
// mid range current ( 0 nA ~ 499 nA)
|
||||
CurrentUserCode->lv = CURRENT_LV_ZERO;
|
||||
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//static int32_t IUC2RealnA(){
|
||||
//
|
||||
//}
|
||||
//
|
||||
//static int32_t IUC2RealpA{
|
||||
//
|
||||
//}
|
||||
/*********************************************************************
|
||||
* @fn Transform2RealpA
|
||||
*
|
||||
* @brief transform an IUC into real current value in pA.
|
||||
*
|
||||
* @param self, which is an IUC
|
||||
*
|
||||
* @return an int32_t current value in pA
|
||||
*/
|
||||
static int32_t _Transform2RealpA(CURRENT_USER_CODE *self){
|
||||
int32_t IUCReal;
|
||||
/** current level range: 0-4 **/
|
||||
// current level = 0 => 0-499 nA => ADCGainLevel = 200K
|
||||
// current level = 1 => 500-999 nA => ADCGainLevel = 10K
|
||||
// current level = 2 => 0-499 uA => ADCGainLevel = 10K
|
||||
// current level = 3 => 500-999 uA => ADCGainLevel = 200R
|
||||
// current level = 4 => 0-499 mA => ADCGainLevel = 200R
|
||||
|
||||
// Saturate if current > 500 uA
|
||||
if (self->lv == CURRENT_LV_FOUR){
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
if (self->lv == CURRENT_LV_THREE){
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
// 0-499 nA
|
||||
if (self->lv == CURRENT_LV_ZERO){
|
||||
IUCReal = (int32_t) (self->value) * 10;
|
||||
}
|
||||
|
||||
// 500-999 nA
|
||||
else if (self->lv == CURRENT_LV_ONE){
|
||||
IUCReal = ((int32_t) (self->value + 50000) * 10);
|
||||
}
|
||||
|
||||
// 0-499 uA
|
||||
else if (self->lv == CURRENT_LV_TWO){
|
||||
IUCReal = (int32_t) (self->value) * 1e4;
|
||||
}
|
||||
|
||||
return IUCReal;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* @fn Transform2RealnA
|
||||
*
|
||||
* @brief transform an IUC into real current value in nA.
|
||||
*
|
||||
* @param self, which is an IUC
|
||||
*
|
||||
* @return an int32_t current value in nA
|
||||
*/
|
||||
static int32_t _Transform2RealnA(CURRENT_USER_CODE *self){
|
||||
int32_t IUCReal;
|
||||
|
||||
// Saturate if current < 500 uA
|
||||
if (self->lv == CURRENT_LV_ZERO | self->lv == CURRENT_LV_ONE | self->lv == CURRENT_LV_TWO){
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 500-999 uA
|
||||
if (self->lv == CURRENT_LV_THREE){
|
||||
IUCReal = (int32_t) (self->value + 50000) * 10;
|
||||
}
|
||||
|
||||
// 0-499 mA
|
||||
else if (self->lv == 4){
|
||||
IUCReal = (int32_t) (self->value) * 1e4;
|
||||
}
|
||||
return IUCReal;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* @fn CompareCurrent
|
||||
*
|
||||
* @brief compare an int32 current with CURRENT_USER_CODE (IUC) type current.
|
||||
*
|
||||
* @param unit is current unit (0 = pA, 1 = nA)
|
||||
* value is current value
|
||||
*
|
||||
* @return 0 if equal
|
||||
* 1 if IUC is larger
|
||||
* 2 if int32 current is larger.
|
||||
*/
|
||||
static uint8_t CompareCurrent(CURRENT_USER_CODE *self, uint8_t unit, int32_t value){
|
||||
int32_t ErrorRangeIUCReal;
|
||||
|
||||
// unit = pA
|
||||
if (unit == 0){
|
||||
if (self->_Transform2RealpA(self) > value){
|
||||
return 1;
|
||||
}
|
||||
else if (self->_Transform2RealpA(self) < value){
|
||||
return 2;
|
||||
}
|
||||
else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// unit = nA
|
||||
else if (unit == 1){
|
||||
if (self->_Transform2RealnA(self) > value){
|
||||
return 1;
|
||||
}
|
||||
else if (self->_Transform2RealnA(self) < value){
|
||||
return 2;
|
||||
}
|
||||
else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
static void SetMeasureCurrent(CURRENT_USER_CODE *self, int32_t current){
|
||||
self->_MeasureCurrent = current;
|
||||
}
|
||||
|
||||
static int32_t GetMeasureCurrent(CURRENT_USER_CODE *self){
|
||||
int32_t ret;
|
||||
ret = self->_MeasureCurrent;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static CURRENT_USER_CODE *InitCurrentUserCode(){
|
||||
CURRENT_USER_CODE *CurrentUserCode = malloc(sizeof(CURRENT_USER_CODE));
|
||||
CurrentUserCode->lv = 0;
|
||||
CurrentUserCode->value = 0;
|
||||
CurrentUserCode-> _MeasureCurrent = 0;
|
||||
CurrentUserCode->_Transform2RealnA = &_Transform2RealnA;
|
||||
CurrentUserCode->_Transform2RealpA = &_Transform2RealpA;
|
||||
CurrentUserCode->SetMeasureCurrent = &SetMeasureCurrent;
|
||||
CurrentUserCode->GetMeasureCurrent = &GetMeasureCurrent;
|
||||
return CurrentUserCode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
#ifndef ELITECV3
|
||||
#define ELITECV3
|
||||
|
||||
#define Vset INSTRUCTION.Vset
|
||||
|
||||
static uint16_t CV3Curve(CV3Mode *CV3){
|
||||
static uint16_t DACOutCode;
|
||||
static int32_t Vin;
|
||||
static int32_t Vout;
|
||||
static int32_t DeltaVout;
|
||||
|
||||
Vin = CV3->_measureVin * 200;//[5nV]
|
||||
if(DACReset){
|
||||
Vout = Vset + Vin;
|
||||
DACReset = false;
|
||||
}else{
|
||||
DeltaVout = Vset - (Vout - Vin);
|
||||
Vout = Vout + DeltaVout;
|
||||
}
|
||||
|
||||
INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
|
||||
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant);
|
||||
|
||||
int32_t RealV2;
|
||||
RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
|
||||
InputNotify(NOTIFY_VOLT, RealV2);
|
||||
|
||||
int32_t RealV;
|
||||
RealV = (int32_t)(Vout / 200);//[1uV]
|
||||
InputNotify(NOTIFY_IMPEDANCE, RealV);
|
||||
|
||||
DAC_outputV(DACOutCode);
|
||||
|
||||
return DACOutCode;
|
||||
}
|
||||
|
||||
static void CV3_Vscan(CV3Mode *CV3){
|
||||
static int16_t VminCounter;
|
||||
static int16_t VmaxCounter;
|
||||
static uint16_t CycleCounter;
|
||||
|
||||
NotifyCycleNumber = (INSTRUCTION.cycleNumber - CV3->_cycleNumber + 1);
|
||||
|
||||
if(vscanReset){
|
||||
VmaxCounter = 0;
|
||||
VminCounter = 0;
|
||||
CycleCounter = 0;
|
||||
|
||||
if(INSTRUCTION.directionInit == 1){
|
||||
CV3->_direction_up = true;
|
||||
CV3->_current_direction_up = true;
|
||||
}else{
|
||||
CV3->_direction_up = false;
|
||||
CV3->_current_direction_up = false;
|
||||
}
|
||||
|
||||
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
|
||||
if(INSTRUCTION.step <= 10){
|
||||
CV3->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
|
||||
}else{
|
||||
CV3->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
|
||||
}
|
||||
|
||||
if(CV3->_Vmin == CV3->_Vinit){
|
||||
VminCounter = -1;
|
||||
}
|
||||
if(CV3->_Vmax == CV3->_Vinit){
|
||||
VmaxCounter = -1;
|
||||
}
|
||||
|
||||
Vset = CV3->_Vinit;
|
||||
}
|
||||
|
||||
if(!vscanReset){
|
||||
if((INSTRUCTION.Vinit < INSTRUCTION.Ve1 && INSTRUCTION.Vinit < INSTRUCTION.Ve2) ||
|
||||
(INSTRUCTION.Vinit > INSTRUCTION.Ve1 && INSTRUCTION.Vinit > INSTRUCTION.Ve2)
|
||||
){
|
||||
if (CV3->_current_direction_up){
|
||||
Vset = Vset + CV3->_Vstep;
|
||||
}else{
|
||||
Vset = Vset - CV3->_Vstep;
|
||||
}
|
||||
|
||||
if(INSTRUCTION.Vinit < INSTRUCTION.Ve1 && INSTRUCTION.Vinit < INSTRUCTION.Ve2){
|
||||
if(Vset == CV3->_Vmin){
|
||||
VminCounter = -1;
|
||||
INSTRUCTION.Vinit = INSTRUCTION.Vmin;
|
||||
CV3->_Vinit = CV3->_Vmin;
|
||||
}
|
||||
}else if(INSTRUCTION.Vinit > INSTRUCTION.Ve1 && INSTRUCTION.Vinit > INSTRUCTION.Ve2){
|
||||
if(Vset == CV3->_Vmax){
|
||||
VmaxCounter = -1;
|
||||
INSTRUCTION.Vinit = INSTRUCTION.Vmax;
|
||||
CV3->_Vinit = CV3->_Vmax;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (Vset >= CV3->_Vmax){
|
||||
VmaxCounter++;
|
||||
}else if (Vset <= CV3->_Vmin){
|
||||
VminCounter++;
|
||||
}
|
||||
|
||||
if (CV3->_current_direction_up){
|
||||
Vset = Vset + CV3->_Vstep * GPT.GptimerMultiple;
|
||||
}else{
|
||||
Vset = Vset - CV3->_Vstep * GPT.GptimerMultiple;
|
||||
}
|
||||
|
||||
if(VmaxCounter != 0 && VminCounter != 0){
|
||||
if(VmaxCounter == VminCounter && CV3->_direction_up && CV3->_current_direction_up){
|
||||
if(CycleCounter != VmaxCounter){
|
||||
if(Vset >= CV3->_Vinit){
|
||||
CV3->_cycleNumber--;
|
||||
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
|
||||
}
|
||||
}
|
||||
}
|
||||
if(VmaxCounter == VminCounter && !CV3->_direction_up && !CV3->_current_direction_up){
|
||||
if(CycleCounter != VmaxCounter){
|
||||
if(Vset <= CV3->_Vinit){
|
||||
CV3->_cycleNumber--;
|
||||
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Vset >= CV3->_Vmax){
|
||||
CV3->_current_direction_up = false;
|
||||
}else if (Vset <= CV3->_Vmin){
|
||||
CV3->_current_direction_up = true;
|
||||
}
|
||||
|
||||
/*stop condition*/
|
||||
if(CV3->_cycleNumber == 0){
|
||||
// PeriodicEvent = false;
|
||||
ModeLED(POST_WORK);
|
||||
InitEliteFlag();
|
||||
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
|
||||
INSTRUCTION.sampleRate = 15;
|
||||
INSTRUCTION.charge = 0x01;
|
||||
INSTRUCTION.constantCurrent = 0x00;
|
||||
INSTRUCTION.Vmax = 0xC350;
|
||||
INSTRUCTION.Vmin = 0x0000;
|
||||
INSTRUCTION.notifyRate = 500;
|
||||
INSTRUCTION.VoViSwitch = 0x02;//read Vscan = Vout - Vin
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// int32_t RealV;
|
||||
// RealV = (int32_t)(Vset / 500);//[1uV]
|
||||
// InputNotify(NOTIFY_VOLT, RealV);
|
||||
}
|
||||
#endif
|
||||
+86
-110
@@ -2,7 +2,7 @@
|
||||
#ifndef ELITECV
|
||||
#define ELITECV
|
||||
|
||||
static uint16_t SWVCurve() {
|
||||
static uint16_t SWVCurve(WorkMode *WorkModeData) {
|
||||
static uint8_t counter;
|
||||
static uint16_t outputV;
|
||||
static uint16_t Volt;
|
||||
@@ -10,9 +10,9 @@ static uint16_t SWVCurve() {
|
||||
|
||||
// reset origin volt at the begin
|
||||
if (DACReset) {
|
||||
Volt = INSTRUCTION.VoltOrigin;
|
||||
outputV = INSTRUCTION.VoltOrigin;
|
||||
if (INSTRUCTION.VoltOrigin < INSTRUCTION.VoltFinal)
|
||||
Volt = INSTRUCTION.Ve1;
|
||||
outputV = INSTRUCTION.Ve1;
|
||||
if (INSTRUCTION.Ve1 < INSTRUCTION.Ve2)
|
||||
direction_up = true;
|
||||
else
|
||||
direction_up = false;
|
||||
@@ -32,7 +32,7 @@ static uint16_t SWVCurve() {
|
||||
// VoltValue = (ramp1*16 + ramp0/16) * 3.05;
|
||||
|
||||
// check if we reach the final volt
|
||||
if ((outputV >= INSTRUCTION.VoltFinal && direction_up) || (outputV <= INSTRUCTION.VoltFinal && !direction_up)) {
|
||||
if ((outputV >= INSTRUCTION.Ve2 && direction_up) || (outputV <= INSTRUCTION.Ve2 && !direction_up)) {
|
||||
PeriodicEvent = false;
|
||||
DACReset = true;
|
||||
}
|
||||
@@ -42,14 +42,14 @@ static uint16_t SWVCurve() {
|
||||
if (counter == PulseWidth)
|
||||
Volt = Volt + Amplitude;
|
||||
else if (counter == 2 * PulseWidth)
|
||||
Volt = Volt - (Amplitude - INSTRUCTION.Step);
|
||||
Volt = Volt - (Amplitude - INSTRUCTION.step);
|
||||
else
|
||||
Volt = Volt;
|
||||
} else {
|
||||
if (counter == PulseWidth)
|
||||
Volt = Volt - Amplitude;
|
||||
else if (counter == 2 * PulseWidth)
|
||||
Volt = Volt + (Amplitude - INSTRUCTION.Step);
|
||||
Volt = Volt + (Amplitude - INSTRUCTION.step);
|
||||
else
|
||||
Volt = Volt;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ static uint16_t SWVCurve() {
|
||||
return outputV;
|
||||
}
|
||||
|
||||
static uint16_t DPVCurve() {
|
||||
static uint16_t DPVCurve(WorkMode *WorkModeData) {
|
||||
static uint8_t counter;
|
||||
static uint16_t Volt1;
|
||||
static uint16_t Volt2;
|
||||
@@ -66,16 +66,16 @@ static uint16_t DPVCurve() {
|
||||
|
||||
// reset origin volt at the begin
|
||||
if (DACReset) {
|
||||
if (INSTRUCTION.VoltOrigin < INSTRUCTION.VoltFinal)
|
||||
if (INSTRUCTION.Ve1 < INSTRUCTION.Ve2)
|
||||
direction_up = true;
|
||||
else
|
||||
direction_up = false;
|
||||
|
||||
Volt1 = INSTRUCTION.VoltOrigin;
|
||||
Volt1 = INSTRUCTION.Ve1;
|
||||
if (direction_up)
|
||||
Volt2 = INSTRUCTION.VoltOrigin + Amplitude;
|
||||
Volt2 = INSTRUCTION.Ve1 + Amplitude;
|
||||
else
|
||||
Volt2 = INSTRUCTION.VoltOrigin - Amplitude;
|
||||
Volt2 = INSTRUCTION.Ve1 - Amplitude;
|
||||
|
||||
counter = 1;
|
||||
DACReset = false;
|
||||
@@ -99,30 +99,30 @@ static uint16_t DPVCurve() {
|
||||
// VoltValue = (ramp1*16 + ramp0/16) * 3.05;
|
||||
|
||||
// check if we reach the final volt
|
||||
if (((outputV >= INSTRUCTION.VoltFinal) && direction_up) || ((outputV <= INSTRUCTION.VoltFinal) && !direction_up)) {
|
||||
if (((outputV >= INSTRUCTION.Ve2) && direction_up) || ((outputV <= INSTRUCTION.Ve2) && !direction_up)) {
|
||||
PeriodicEvent = false;
|
||||
DACReset = true;
|
||||
}
|
||||
|
||||
// check overflow/underflow and prepare for next output
|
||||
if (direction_up) {
|
||||
if (Volt1 + INSTRUCTION.Step < Volt1)
|
||||
if (Volt1 + INSTRUCTION.step < Volt1)
|
||||
Volt1 = 0xffff;
|
||||
else
|
||||
Volt1 = Volt1 + INSTRUCTION.Step;
|
||||
if (Volt2 + INSTRUCTION.Step < Volt2)
|
||||
Volt1 = Volt1 + INSTRUCTION.step;
|
||||
if (Volt2 + INSTRUCTION.step < Volt2)
|
||||
Volt2 = 0xffff;
|
||||
else
|
||||
Volt2 = Volt2 + INSTRUCTION.Step;
|
||||
Volt2 = Volt2 + INSTRUCTION.step;
|
||||
} else {
|
||||
if (Volt1 - INSTRUCTION.Step > Volt1)
|
||||
if (Volt1 - INSTRUCTION.step > Volt1)
|
||||
Volt1 = 0x0000;
|
||||
else
|
||||
Volt1 = Volt1 - INSTRUCTION.Step;
|
||||
if (Volt2 - INSTRUCTION.Step > Volt2)
|
||||
Volt1 = Volt1 - INSTRUCTION.step;
|
||||
if (Volt2 - INSTRUCTION.step > Volt2)
|
||||
Volt2 = 0x0000;
|
||||
else
|
||||
Volt2 = Volt2 - INSTRUCTION.Step;
|
||||
Volt2 = Volt2 - INSTRUCTION.step;
|
||||
}
|
||||
|
||||
if (counter + 1 <= (PulsePeriod - PulseWidth)) {
|
||||
@@ -132,110 +132,86 @@ static uint16_t DPVCurve() {
|
||||
}
|
||||
}
|
||||
|
||||
static uint16_t CVCurve() {
|
||||
static uint16_t DACOutCode;
|
||||
static bool direction_up;
|
||||
static bool current_direction_up;
|
||||
static void CV_Vscan(CVMode *CV){
|
||||
static int16_t VminCounter;
|
||||
static int16_t VmaxCounter;
|
||||
static uint16_t CycleCounter;
|
||||
|
||||
// reset origin volt at the begin
|
||||
if (DACReset) {
|
||||
DACUserCode = INSTRUCTION.VoltOrigin;
|
||||
if (INSTRUCTION.VoltFinal > INSTRUCTION.VoltOrigin) {
|
||||
direction_up = true;
|
||||
current_direction_up = true;
|
||||
} else {
|
||||
direction_up = false;
|
||||
current_direction_up = false;
|
||||
NotifyCycleNumber = (INSTRUCTION.cycleNumber - CV->_cycleNumber + 1);
|
||||
|
||||
if(vscanReset){
|
||||
VmaxCounter = 0;
|
||||
VminCounter = 0;
|
||||
CycleCounter = 0;
|
||||
|
||||
if(INSTRUCTION.directionInit == 1){
|
||||
CV->_direction_up = true;
|
||||
CV->_current_direction_up = true;
|
||||
}else if(INSTRUCTION.directionInit == 0){
|
||||
CV->_direction_up = false;
|
||||
CV->_current_direction_up = false;
|
||||
}
|
||||
|
||||
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
|
||||
DAC_outputV(DACOutCode); // output VOLT_ORIGIN
|
||||
DACReset = false;
|
||||
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
|
||||
if(INSTRUCTION.step <= 10){
|
||||
CV->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
|
||||
}else{
|
||||
CV->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
|
||||
}
|
||||
|
||||
return DACOutCode;
|
||||
if(CV->_Vmin == CV->_Vinit){
|
||||
VminCounter = -1;
|
||||
}
|
||||
if(CV->_Vmax == CV->_Vinit){
|
||||
VmaxCounter = -1;
|
||||
}
|
||||
|
||||
Vset = CV->_Vinit;
|
||||
}
|
||||
|
||||
if (StepTimeCounter == INSTRUCTION.StepTime) {
|
||||
if(!vscanReset){
|
||||
if (Vset >= CV->_Vmax){
|
||||
VmaxCounter++;
|
||||
}else if (Vset <= CV->_Vmin){
|
||||
VminCounter++;
|
||||
}
|
||||
|
||||
//Decide next direction
|
||||
if (direction_up) {
|
||||
if (DACUserCode >= INSTRUCTION.VoltFinal) {
|
||||
current_direction_up = false; // problem occurs when origin == 0000 final == ffff!!!!!!
|
||||
} else if (DACUserCode <= INSTRUCTION.VoltOrigin) {
|
||||
current_direction_up = true;
|
||||
if (INSTRUCTION.CycleNumber == 0) {
|
||||
PeriodicEvent = false; // periodic event end
|
||||
DACReset = true;
|
||||
if (CV->_current_direction_up){
|
||||
Vset = Vset + CV->_Vstep * GPT.GptimerMultiple;
|
||||
}else{
|
||||
Vset = Vset - CV->_Vstep * GPT.GptimerMultiple;
|
||||
}
|
||||
|
||||
if(VmaxCounter != 0 && VminCounter != 0){
|
||||
if(VmaxCounter == VminCounter && CV->_direction_up && CV->_current_direction_up){
|
||||
if(CycleCounter != VmaxCounter){
|
||||
if(Vset >= CV->_Vinit){
|
||||
CV->_cycleNumber--;
|
||||
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
|
||||
}
|
||||
}
|
||||
INSTRUCTION.CycleNumber--;
|
||||
}
|
||||
} else {
|
||||
if (DACUserCode <= INSTRUCTION.VoltFinal) {
|
||||
current_direction_up = true; // problem occurs when origin == 0000 final == ffff!!!!!!
|
||||
} else if (DACUserCode >= INSTRUCTION.VoltOrigin) {
|
||||
current_direction_up = false;
|
||||
if (INSTRUCTION.CycleNumber == 0) {
|
||||
PeriodicEvent = false; // periodic event end
|
||||
DACReset = true;
|
||||
if(VmaxCounter == VminCounter && !CV->_direction_up && !CV->_current_direction_up){
|
||||
if(CycleCounter != VmaxCounter){
|
||||
if(Vset <= CV->_Vinit){
|
||||
CV->_cycleNumber--;
|
||||
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
|
||||
}
|
||||
}
|
||||
INSTRUCTION.CycleNumber--;
|
||||
}
|
||||
}
|
||||
|
||||
// Next output voltage
|
||||
if (direction_up) {
|
||||
if (current_direction_up) {
|
||||
if (DACUserCode + INSTRUCTION.Step < DACUserCode) {
|
||||
DACUserCode = 0xffff;
|
||||
}
|
||||
else if (DACUserCode + INSTRUCTION.Step > INSTRUCTION.VoltFinal) {
|
||||
DACUserCode = INSTRUCTION.VoltFinal;
|
||||
}
|
||||
else {
|
||||
DACUserCode = DACUserCode + INSTRUCTION.Step;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (DACUserCode - INSTRUCTION.Step > DACUserCode) {
|
||||
DACUserCode = 0x0000;
|
||||
}
|
||||
else if (DACUserCode + INSTRUCTION.Step < INSTRUCTION.VoltOrigin) {
|
||||
DACUserCode = INSTRUCTION.VoltOrigin;
|
||||
}
|
||||
else {
|
||||
DACUserCode = DACUserCode - INSTRUCTION.Step;
|
||||
}
|
||||
}
|
||||
if (Vset >= CV->_Vmax){
|
||||
CV->_current_direction_up = false;
|
||||
}else if (Vset <= CV->_Vmin){
|
||||
CV->_current_direction_up = true;
|
||||
}
|
||||
else {
|
||||
if (current_direction_up) {
|
||||
if (DACUserCode + INSTRUCTION.Step < DACUserCode) {
|
||||
DACUserCode = 0xffff;
|
||||
}
|
||||
else if (DACUserCode + INSTRUCTION.Step > INSTRUCTION.VoltOrigin) {
|
||||
DACUserCode = INSTRUCTION.VoltOrigin;
|
||||
}
|
||||
else {
|
||||
DACUserCode = DACUserCode + INSTRUCTION.Step;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (DACUserCode - INSTRUCTION.Step > DACUserCode) {
|
||||
DACUserCode = 0x0000; //
|
||||
}
|
||||
else if (DACUserCode + INSTRUCTION.Step < INSTRUCTION.VoltFinal) {
|
||||
DACUserCode = INSTRUCTION.VoltFinal;
|
||||
}
|
||||
else {
|
||||
DACUserCode = DACUserCode - INSTRUCTION.Step;
|
||||
}
|
||||
}
|
||||
|
||||
/*stop condition*/
|
||||
if(CV->_cycleNumber == 0){
|
||||
PeriodicEvent = false;
|
||||
ModeLED(NO_EVENT);
|
||||
}
|
||||
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
|
||||
DAC_outputV(DACOutCode);
|
||||
}
|
||||
return DACOutCode;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
#ifndef ELITECVSCAN
|
||||
#define ELITECVSCAN
|
||||
|
||||
#define Vset INSTRUCTION.Vset
|
||||
|
||||
static uint16_t CVSCANCurve(CVSCANMode *CVSCAN){
|
||||
static uint16_t DACOutCode;
|
||||
static int32_t Vin;
|
||||
static int32_t Vout;
|
||||
static int32_t DeltaVout;
|
||||
|
||||
Vin = CVSCAN->_measureVin * 200;//[5nV]
|
||||
if(DACReset){
|
||||
Vout = Vset + Vin;
|
||||
DACReset = false;
|
||||
}else{
|
||||
DeltaVout = Vset - (Vout - Vin);
|
||||
Vout = Vout + DeltaVout;
|
||||
}
|
||||
|
||||
INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
|
||||
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant);
|
||||
|
||||
int32_t RealV2;
|
||||
RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
|
||||
InputNotify(NOTIFY_VOLT, RealV2);
|
||||
|
||||
int32_t RealV;
|
||||
RealV = (int32_t)(Vout / 200);//[1uV]
|
||||
InputNotify(NOTIFY_IMPEDANCE, RealV);
|
||||
|
||||
DAC_outputV(DACOutCode);
|
||||
|
||||
return DACOutCode;
|
||||
}
|
||||
|
||||
static void CVSCAN_Vscan(CVSCANMode *CVSCAN){
|
||||
|
||||
if(vscanReset){
|
||||
Vset = CVSCAN->_Vinit;
|
||||
}
|
||||
|
||||
if(!vscanReset){
|
||||
Vset = CVSCAN->_Vinit;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+52
-52
@@ -47,75 +47,75 @@ static uint16_t DAC_outputV(uint16_t voltLV) {
|
||||
v1 = (uint8_t) ((voltLV & 0xFF00) >> 8);
|
||||
v2 = (uint8_t) (voltLV & 0x00FF);
|
||||
|
||||
|
||||
spi_DACtxbuf[0] = DACOUT;
|
||||
|
||||
spi_DACtxbuf[1] = v1;
|
||||
spi_DACtxbuf[2] = v2;
|
||||
|
||||
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
|
||||
|
||||
return voltLV;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ELITE_VERSION_BAT
|
||||
#define DACCLS 0x02 // clear DAC software
|
||||
#define DACOUT0 0x31 // DAC0 channel output
|
||||
#define DACOUT1 0x32 // DAC1 channel output
|
||||
|
||||
static uint16_t DAC_outputV(uint16_t voltLV) {
|
||||
// C = command, X = don't care, D = data
|
||||
// CCCC CCCC = command
|
||||
// DDDD DDDD = v1
|
||||
// DDDD DDDD = v2
|
||||
|
||||
// command
|
||||
// 0x02 = clear
|
||||
// 0x31 = output voltage
|
||||
|
||||
uint8_t v1, v2 = 0;
|
||||
v1 = (uint8_t) ((voltLV & 0xFF00) >> 8);
|
||||
v2 = (uint8_t) (voltLV & 0x00FF);
|
||||
|
||||
|
||||
spi_DACtxbuf[0] = DACOUT1;
|
||||
|
||||
spi_DACtxbuf[1] = v1;
|
||||
spi_DACtxbuf[2] = v2;
|
||||
|
||||
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
|
||||
return voltLV;
|
||||
static void VoutGainControl(uint8_t VOUTLevel){
|
||||
if(VOUTLevel == 0){
|
||||
// VOUT gain level = 0, using 240K resister
|
||||
PIN15_setOutputValue(Turon_VOUT_SMALL, 0);
|
||||
}
|
||||
else if(VOUTLevel == 1){
|
||||
// VOUT gain level = 1, using 15K resister
|
||||
PIN15_setOutputValue(Turon_VOUT_SMALL, 1);
|
||||
}
|
||||
else if(VOUTLevel == 2){
|
||||
// VOUT gain level = 2, using 15K resister
|
||||
PIN15_setOutputValue(Turon_VOUT_SMALL, 1);
|
||||
}
|
||||
else{
|
||||
// default using 15K resister
|
||||
PIN15_setOutputValue(Turon_VOUT_SMALL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static uint16_t DAC_outputCV(uint16_t voltLV) {
|
||||
|
||||
uint8_t v1, v2 = 0;
|
||||
v1 = (uint8_t) ((voltLV & 0xFF00) >> 8);
|
||||
v2 = (uint8_t) (voltLV & 0x00FF);
|
||||
|
||||
spi_DACtxbuf[0] = DACOUT0;
|
||||
spi_DACtxbuf[1] = v1;
|
||||
spi_DACtxbuf[2] = v2;
|
||||
|
||||
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
|
||||
return voltLV;
|
||||
static int32_t User2Real(uint16_t UserCode){
|
||||
/* transfer usercode to real voltage value (mV) */
|
||||
return (int32_t)((UserCode - 25000) / 5);
|
||||
}
|
||||
|
||||
static uint16_t DAC_outputCC(uint16_t voltLV) {
|
||||
|
||||
uint8_t v1, v2 = 0;
|
||||
v1 = (uint8_t) ((voltLV & 0xFF00) >> 8);
|
||||
v2 = (uint8_t) (voltLV & 0x00FF);
|
||||
// DAC Vout theoretical boundary <300, 100~ (mV)
|
||||
#define DAC_VOUT_GAIN_SMALL_BOUNDARY 100000 // 25500(usercode) = 100 mV
|
||||
#define DAC_VOUT_GAIN_LARGE_BOUNDARY 300000 // 26500(usercode) = 300 mV
|
||||
#define DAC_VOUT_GAIN_LARGE_BOUNDARY_USERCODE 26500 // 26500(usercode) = 300 mV
|
||||
#define DAC_VOUT_GAIN_LARGE_BOUNDARY1_USERCODE 23500 // 23500(usercode) = -300 mV
|
||||
|
||||
spi_DACtxbuf[0] = DACOUT1;
|
||||
spi_DACtxbuf[1] = v1;
|
||||
spi_DACtxbuf[2] = v2;
|
||||
static void AutoGainChangeVout(int32_t userCode){
|
||||
int32_t RealVolt = (userCode - 25000) * 200; // (userCode - 25000) / 5 * 1000 [1uV]
|
||||
// switch to 1 level volt(small) 15K
|
||||
// switch to 2 level volt(large) 240K
|
||||
|
||||
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
|
||||
return voltLV;
|
||||
if(INSTRUCTION.VoutGainLevel == VOUT_GAIN_AUTO){
|
||||
INSTRUCTION.VoutGainLevel = VOUT_GAIN_15K;
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
record_flag = false;
|
||||
}
|
||||
|
||||
if(INSTRUCTION.VoutGainLevel == VOUT_GAIN_15K){
|
||||
if(RealVolt > DAC_VOUT_GAIN_LARGE_BOUNDARY || RealVolt < -1 * DAC_VOUT_GAIN_LARGE_BOUNDARY){
|
||||
// switch to 2 level volt(large)
|
||||
INSTRUCTION.VoutGainLevel = VOUT_GAIN_240K;
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
else if(INSTRUCTION.VoutGainLevel == VOUT_GAIN_240K){
|
||||
if(RealVolt < DAC_VOUT_GAIN_SMALL_BOUNDARY && RealVolt > -1 * DAC_VOUT_GAIN_SMALL_BOUNDARY ){
|
||||
// switch to 1 level volt(small)
|
||||
INSTRUCTION.VoutGainLevel = VOUT_GAIN_15K;
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+153
-636
@@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#define BOARD_SATURN
|
||||
#define BOARD_C771
|
||||
|
||||
typedef struct _formula{
|
||||
|
||||
@@ -40,724 +40,241 @@ typedef struct _formula{
|
||||
|
||||
struct _correction{
|
||||
|
||||
Formula ADC_volt;
|
||||
Formula ADC_current[3];
|
||||
Formula DAC2RealV;
|
||||
Formula Usercode2DAC;
|
||||
Formula ADC_volt[3];
|
||||
Formula ADC_current[4];
|
||||
Formula Usercode2DAC[2];
|
||||
uint16_t Gain0Boundary[2];
|
||||
uint16_t Gain1Boundary[4];
|
||||
uint16_t Gain2Boundary[2];
|
||||
|
||||
} Correction =
|
||||
#ifdef BOARD_CLASS_LEADER
|
||||
|
||||
#ifdef BOARD_C6E1 // not well
|
||||
{
|
||||
.ADC_volt.coeff = (-6292889),
|
||||
.ADC_volt.offset = 103042367157,
|
||||
.ADC_volt[0].coeff = (-6251051),
|
||||
.ADC_volt[0].offset = 102081366120,
|
||||
|
||||
.ADC_current[0].coeff = 310073435,
|
||||
.ADC_current[0].offset = -5059684947850,
|
||||
.ADC_volt[1].coeff = (-6251051),
|
||||
.ADC_volt[1].offset = 102081366120,
|
||||
|
||||
.ADC_current[1].coeff = 655940088,
|
||||
.ADC_current[1].offset = -10703396200801,
|
||||
.ADC_volt[2].coeff = (-6251051),
|
||||
.ADC_volt[2].offset = 102081366120,
|
||||
|
||||
.ADC_current[2].coeff = 31129894,
|
||||
.ADC_current[2].offset = -507980196120,
|
||||
.ADC_current[0].coeff = 2079230,
|
||||
.ADC_current[0].offset = (-34256067906),
|
||||
|
||||
.DAC2RealV.coeff = (-18959656),
|
||||
.DAC2RealV.offset = 565743281498,
|
||||
.ADC_current[1].coeff = 64550018,
|
||||
.ADC_current[1].offset = (-1063052554820),
|
||||
|
||||
.Usercode2DAC.coeff = (-10517325),
|
||||
.Usercode2DAC.offset = 561574831511,
|
||||
.ADC_current[2].coeff = 2096336928,
|
||||
.ADC_current[2].offset = (-34514344284104),
|
||||
|
||||
.Gain0Boundary[0] = 0x5F75,
|
||||
.Gain0Boundary[1] = 0x5FB2,
|
||||
.ADC_current[3].coeff = 60200953965,
|
||||
.ADC_current[3].offset = (-991270580672004),
|
||||
|
||||
.Gain1Boundary[0] = 0x5999,
|
||||
.Gain1Boundary[1] = 0x6589
|
||||
.Usercode2DAC[0].coeff = (-10511469),
|
||||
.Usercode2DAC[0].offset = 563770560100,
|
||||
|
||||
.Usercode2DAC[1].coeff = (-10511469),
|
||||
.Usercode2DAC[1].offset = 563770560100,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BORAD_TRICERATOPS
|
||||
#ifdef BOARD_C7A1
|
||||
{
|
||||
.ADC_volt.coeff = (-6259045),
|
||||
.ADC_volt.offset = 150606390230,
|
||||
.ADC_volt[0].coeff = (6256),
|
||||
.ADC_volt[0].offset = -101532028,
|
||||
|
||||
.ADC_current[0].coeff = 30675739,
|
||||
.ADC_current[0].offset = (-736666253953),
|
||||
.ADC_volt[1].coeff = (215138),
|
||||
.ADC_volt[1].offset = -3501890770,
|
||||
|
||||
.ADC_current[1].coeff = 749057318,
|
||||
.ADC_current[1].offset = (-17984432358007),
|
||||
.ADC_volt[2].coeff = (6245014),
|
||||
.ADC_volt[2].offset = -101751226981,
|
||||
|
||||
.ADC_current[2].coeff = 31242587,
|
||||
.ADC_current[2].offset = (-750184492407),
|
||||
.ADC_current[0].coeff = 3125920,
|
||||
.ADC_current[0].offset = (-50880328288),
|
||||
|
||||
.DAC2RealV.coeff = (-18909689),
|
||||
.DAC2RealV.offset = 644251481046,
|
||||
.ADC_current[1].coeff = 71636129,
|
||||
.ADC_current[1].offset = (-1166093783868),
|
||||
|
||||
.Usercode2DAC.coeff = (-10576588),
|
||||
.Usercode2DAC.offset = 605113842000,
|
||||
.ADC_current[2].coeff = 1459555637,
|
||||
.ADC_current[2].offset = (-23757721396024),
|
||||
|
||||
.Gain0Boundary[0] = 0x5DAA,
|
||||
.Gain0Boundary[1] = 0x5DF2,
|
||||
.ADC_current[3].coeff = 30723232882,
|
||||
.ADC_current[3].offset = (-500144809348170),
|
||||
|
||||
.Gain1Boundary[0] = 0x57E8,
|
||||
.Gain1Boundary[1] = 0x63B1
|
||||
.Usercode2DAC[0].coeff = (-10543817),
|
||||
.Usercode2DAC[0].offset = 583163641972,
|
||||
|
||||
.Usercode2DAC[1].coeff = (-178077711),
|
||||
.Usercode2DAC[1].offset = 4777894559527,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BORAD_CHAO_I
|
||||
#ifdef BOARD_C6D4 // not well
|
||||
{
|
||||
.ADC_volt.coeff = (-6278082),
|
||||
.ADC_volt.offset = 151228681410,
|
||||
.ADC_volt[0].coeff = (6226),
|
||||
.ADC_volt[0].offset = -100075170,
|
||||
|
||||
.ADC_current[0].coeff = 30908391,
|
||||
.ADC_current[0].offset = (-741477595514),
|
||||
.ADC_volt[1].coeff = (215972),
|
||||
.ADC_volt[1].offset = -3484380085,
|
||||
|
||||
.ADC_current[1].coeff = 661271310,
|
||||
.ADC_current[1].offset = (-15864495597969),
|
||||
.ADC_volt[2].coeff = (6223818),
|
||||
.ADC_volt[2].offset = -100571214617,
|
||||
|
||||
.ADC_current[2].coeff = 31183513,
|
||||
.ADC_current[2].offset = (-748178468530),
|
||||
.ADC_current[0].coeff = 3136256,
|
||||
.ADC_current[0].offset = (-50747854551),
|
||||
|
||||
.DAC2RealV.coeff = (-18975108),
|
||||
.DAC2RealV.offset = 644442607989,
|
||||
.ADC_current[1].coeff = 72219340,
|
||||
.ADC_current[1].offset = (-1168719058378),
|
||||
|
||||
.Usercode2DAC.coeff = (-10540121),
|
||||
.Usercode2DAC.offset = 603128277368,
|
||||
.ADC_current[2].coeff = 1450319129,
|
||||
.ADC_current[2].offset = (-23465744053517),
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
.ADC_current[3].coeff = 30710734735,
|
||||
.ADC_current[3].offset = (-496978137538345),
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
.Usercode2DAC[0].coeff = (-10543212),
|
||||
.Usercode2DAC[0].offset = 582976692942,
|
||||
|
||||
.Usercode2DAC[1].coeff = (-178746005),
|
||||
.Usercode2DAC[1].offset = 4789272862069,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_TWENTY_ONE
|
||||
#ifdef BOARD_C771
|
||||
{
|
||||
.ADC_volt.coeff = (-6258074),
|
||||
.ADC_volt.offset = 152210580945,
|
||||
.ADC_volt[0].coeff = (6301),
|
||||
.ADC_volt[0].offset = -102184705,
|
||||
|
||||
.ADC_current[0].coeff = 30022512,
|
||||
.ADC_current[0].offset = -729552647201,
|
||||
.ADC_volt[1].coeff = (216877),
|
||||
.ADC_volt[1].offset = -3519583281,
|
||||
|
||||
.ADC_current[1].coeff = 658398533,
|
||||
.ADC_current[1].offset = -16001498741131,
|
||||
.ADC_volt[2].coeff = (6298448),
|
||||
.ADC_volt[2].offset = -102304286091,
|
||||
|
||||
.ADC_current[2].coeff = 30908351,
|
||||
.ADC_current[2].offset = -746548614824,
|
||||
.ADC_current[0].coeff = 3115431,
|
||||
.ADC_current[0].offset = (-50586460394),
|
||||
|
||||
.DAC2RealV.coeff = (-19007867),
|
||||
.DAC2RealV.offset = 646316924837,
|
||||
.ADC_current[1].coeff = 71203612,
|
||||
.ADC_current[1].offset = (-1156022105141),
|
||||
|
||||
.Usercode2DAC.coeff = (-10521952),
|
||||
.Usercode2DAC.offset = 603074812599,
|
||||
.ADC_current[2].coeff = 1451318434,
|
||||
.ADC_current[2].offset = (-23560731221983),
|
||||
|
||||
.Gain0Boundary[0] = 0x5ECD,
|
||||
.Gain0Boundary[1] = 0x5F0D,
|
||||
.ADC_current[3].coeff = 30518004246,
|
||||
.ADC_current[3].offset = (-495456618814855),
|
||||
|
||||
.Gain1Boundary[0] = 0x5900,
|
||||
.Gain1Boundary[1] = 0x64DD
|
||||
.Usercode2DAC[0].coeff = (-10568719),
|
||||
.Usercode2DAC[0].offset = 585036272447,
|
||||
|
||||
.Usercode2DAC[1].coeff = (-179441058),
|
||||
.Usercode2DAC[1].offset = 4807380622351,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_JOHN_CENA
|
||||
#ifdef BOARD_C604
|
||||
{
|
||||
.ADC_volt.coeff = (-6286465),
|
||||
.ADC_volt.offset = 151630618248,
|
||||
.ADC_volt[0].coeff = (6194),
|
||||
.ADC_volt[0].offset = -100974071,
|
||||
|
||||
.ADC_current[0].coeff = 30960625,
|
||||
.ADC_current[0].offset = -747979808432,
|
||||
.ADC_volt[1].coeff = (215506),
|
||||
.ADC_volt[1].offset = -3517864544,
|
||||
|
||||
.ADC_current[1].coeff = 652738209,
|
||||
.ADC_current[1].offset = -15767733896990,
|
||||
.ADC_volt[2].coeff = (6243728),
|
||||
.ADC_volt[2].offset = -102012564806,
|
||||
|
||||
.ADC_current[2].coeff = 30959456,
|
||||
.ADC_current[2].offset = -748026885843,
|
||||
.ADC_current[0].coeff = 3139436,
|
||||
.ADC_current[0].offset = (-51217085818),
|
||||
|
||||
.DAC2RealV.coeff = (-18880478),
|
||||
.DAC2RealV.offset = 629012735316,
|
||||
.ADC_current[1].coeff = 71622830,
|
||||
.ADC_current[1].offset = (-1168462302473),
|
||||
|
||||
.Usercode2DAC.coeff = (-10592952),
|
||||
.Usercode2DAC.offset = 604535526400,
|
||||
.ADC_current[2].coeff = 1462344785,
|
||||
.ADC_current[2].offset = (-23855062972762),
|
||||
|
||||
.Gain0Boundary[0] = 0x7653, // 20 uA
|
||||
.Gain0Boundary[1] = 0x4504, // -20 uA
|
||||
.ADC_current[3].coeff = 30689232716,
|
||||
.ADC_current[3].offset = (-500670762245868),
|
||||
|
||||
.Gain1Boundary[0] = 0x7C69, // 500 uA
|
||||
.Gain1Boundary[1] = 0x405D, // -500 uA
|
||||
.Gain1Boundary[2] = 0x5F4A, // 10 uA
|
||||
.Gain1Boundary[3] = 0x5D7D, // -10 uA
|
||||
.Usercode2DAC[0].coeff = (-10507403),
|
||||
.Usercode2DAC[0].offset = 582940058695,
|
||||
|
||||
.Gain2Boundary[0] = 0x5EC2, // 300 uA
|
||||
.Gain2Boundary[1] = 0x5E01, // -300 uA
|
||||
//.Gain0SupportRange =
|
||||
//.Gain1SupportRange[0] =
|
||||
//.Gain1SupportRange[1] =
|
||||
//.Gain2SupportRange =
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef BOARD_GENIUS
|
||||
{
|
||||
.ADC_volt.coeff = (-6236652),
|
||||
.ADC_volt.offset = 101533279052,
|
||||
|
||||
.ADC_current[0].coeff = 31094976,
|
||||
.ADC_current[0].offset = (-507114075439),
|
||||
|
||||
.ADC_current[1].coeff = 31218018,
|
||||
.ADC_current[1].offset = (-508593562044),
|
||||
|
||||
.ADC_current[2].coeff = 557826631,
|
||||
.ADC_current[2].offset = (-9088752534070),
|
||||
|
||||
.DAC2RealV.coeff = (-18990774),
|
||||
.DAC2RealV.offset = 570886531263,
|
||||
|
||||
.Usercode2DAC.coeff = (-10605006),
|
||||
.Usercode2DAC.offset = 566878948150,
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_DA_SHUN
|
||||
{
|
||||
.ADC_volt.coeff = (-6280824),
|
||||
.ADC_volt.offset = 151787055168,
|
||||
|
||||
.ADC_current[0].coeff = 25109217,
|
||||
.ADC_current[0].offset = (-606888506534),
|
||||
|
||||
.ADC_current[1].coeff = 657619639,
|
||||
.ADC_current[1].offset = (-15894373245404),
|
||||
|
||||
.ADC_current[2].coeff = 31040178,
|
||||
.ADC_current[2].offset = (-750263570000),
|
||||
|
||||
.DAC2RealV.coeff = (-18975834),
|
||||
.DAC2RealV.offset = 647359124391,
|
||||
|
||||
.Usercode2DAC.coeff = (-10539718),
|
||||
.Usercode2DAC.offset = 604829309500,
|
||||
|
||||
.Gain0Boundary[0] = 0x5E2F,
|
||||
.Gain0Boundary[1] = 0x5E96,
|
||||
|
||||
.Gain1Boundary[0] = 0x5878,
|
||||
.Gain1Boundary[1] = 0x645A
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_CHIEN_YU
|
||||
{
|
||||
.ADC_volt.coeff = (-6279056),
|
||||
.ADC_volt.offset = 150985844279,
|
||||
|
||||
.ADC_current[0].coeff = 31788227 ,
|
||||
.ADC_current[0].offset = (-765340735866),
|
||||
|
||||
.ADC_current[1].coeff = 657619858,
|
||||
.ADC_current[1].offset = (-15835988865283),
|
||||
|
||||
.ADC_current[2].coeff = 31116362,
|
||||
.ADC_current[2].offset = (-749402214847),
|
||||
|
||||
.DAC2RealV.coeff = (-18935149),
|
||||
.DAC2RealV.offset = 643063752893,
|
||||
|
||||
.Usercode2DAC.coeff = (-10567567),
|
||||
.Usercode2DAC.offset = 603991718526,
|
||||
|
||||
.Gain0Boundary[0] = 0x5DE5,
|
||||
.Gain0Boundary[1] = 0x5E30,
|
||||
|
||||
.Gain1Boundary[0] = 0x5820,
|
||||
.Gain1Boundary[1] = 0x6408
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_LITTLE_STAR
|
||||
{
|
||||
.ADC_volt.coeff = (-6224192),
|
||||
.ADC_volt.offset = 101472884698,
|
||||
|
||||
.ADC_current[0].coeff = 31293602,
|
||||
.ADC_current[0].offset = (-510187416959),
|
||||
|
||||
.ADC_current[1].coeff = 655130048,
|
||||
.ADC_current[1].offset = (-10680093830418),
|
||||
|
||||
.ADC_current[2].coeff = 31450484,
|
||||
.ADC_current[2].offset = (-512697942950),
|
||||
|
||||
.DAC2RealV.coeff = (-18690126),
|
||||
.DAC2RealV.offset = 564319610294 ,
|
||||
|
||||
.Usercode2DAC.coeff = (-10524846),
|
||||
.Usercode2DAC.offset = 561713962333,
|
||||
|
||||
.Gain0Boundary[0] = 0x5E2F,
|
||||
.Gain0Boundary[1] = 0x5E96,
|
||||
|
||||
.Gain1Boundary[0] = 0x5878,
|
||||
.Gain1Boundary[1] = 0x645A
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_517
|
||||
{
|
||||
.ADC_volt.coeff = (-6244769),
|
||||
.ADC_volt.offset = 101714685687,
|
||||
|
||||
.ADC_current[0].coeff = 30919726,
|
||||
.ADC_current[0].offset = (-503489101786),
|
||||
|
||||
.ADC_current[1].coeff = 654824495,
|
||||
.ADC_current[1].offset = (-10660542778914),
|
||||
|
||||
.ADC_current[2].coeff = 31376265,
|
||||
.ADC_current[2].offset = (-510797752348),
|
||||
|
||||
.DAC2RealV.coeff = (-18690126),
|
||||
.DAC2RealV.offset = 564319610294 ,
|
||||
|
||||
.Usercode2DAC.coeff = (-10500774),
|
||||
.Usercode2DAC.offset = 560779455904,
|
||||
|
||||
.Gain0Boundary[0] = 0x5E2F,
|
||||
.Gain0Boundary[1] = 0x5E96,
|
||||
|
||||
.Gain1Boundary[0] = 0x5878,
|
||||
.Gain1Boundary[1] = 0x645A
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_FISH_VET
|
||||
{
|
||||
.ADC_volt.coeff = (-6243954),
|
||||
.ADC_volt.offset = 101956814341,
|
||||
|
||||
.ADC_current[0].coeff = 6208753,
|
||||
.ADC_current[0].offset = (-101076436901),
|
||||
|
||||
.ADC_current[1].coeff = 68760643,
|
||||
.ADC_current[1].offset = (-1123221851971),
|
||||
|
||||
.ADC_current[2].coeff = 61882330,
|
||||
.ADC_current[2].offset = (-1010385966159),
|
||||
|
||||
.DAC2RealV.coeff = (-18690126),
|
||||
.DAC2RealV.offset = 564319610294,
|
||||
|
||||
.Usercode2DAC.coeff = (-10517326),
|
||||
.Usercode2DAC.offset = 561574831512,
|
||||
|
||||
.Gain0Boundary[0] = 0x5E2F,
|
||||
.Gain0Boundary[1] = 0x5E96,
|
||||
|
||||
.Gain1Boundary[0] = 0x5878,
|
||||
.Gain1Boundary[1] = 0x645A
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_KELLY
|
||||
{
|
||||
.ADC_volt.coeff = (-6238112),
|
||||
.ADC_volt.offset = 101628014509,
|
||||
|
||||
.ADC_current[0].coeff = 6184288,
|
||||
.ADC_current[0].offset = (-100642471661),
|
||||
|
||||
.ADC_current[1].coeff = 68602677,
|
||||
.ADC_current[1].offset = (-1117469013718),
|
||||
|
||||
.ADC_current[2].coeff = 12521267,
|
||||
.ADC_current[2].offset = (-204009192742),
|
||||
|
||||
.DAC2RealV.coeff = (-18690126),
|
||||
.DAC2RealV.offset = 564319610294,
|
||||
|
||||
.Usercode2DAC.coeff = (-10528309),
|
||||
.Usercode2DAC.offset = 561035476688,
|
||||
|
||||
.Gain0Boundary[0] = 0x5E2F,
|
||||
.Gain0Boundary[1] = 0x5E96,
|
||||
|
||||
.Gain1Boundary[0] = 0x5878,
|
||||
.Gain1Boundary[1] = 0x645A
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_BAY_BAY
|
||||
{
|
||||
.ADC_volt.coeff = (-6223734),
|
||||
.ADC_volt.offset = 101647006833,
|
||||
|
||||
.ADC_current[0].coeff = 31039179,
|
||||
.ADC_current[0].offset = (-506383432096),
|
||||
|
||||
.ADC_current[1].coeff = 647940355,
|
||||
.ADC_current[1].offset = (-10611041889224),
|
||||
|
||||
.ADC_current[2].coeff = 31094976,
|
||||
.ADC_current[2].offset = (-507114075439),
|
||||
|
||||
.DAC2RealV.coeff = (-18690126),
|
||||
.DAC2RealV.offset = 564319610294,
|
||||
|
||||
.Usercode2DAC.coeff = (-10541677),
|
||||
.Usercode2DAC.offset = 562208801371,
|
||||
|
||||
.Gain0Boundary[0] = 0x5E2F,
|
||||
.Gain0Boundary[1] = 0x5E96,
|
||||
|
||||
.Gain1Boundary[0] = 0x5878,
|
||||
.Gain1Boundary[1] = 0x645A
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_MEOWMI
|
||||
{
|
||||
.ADC_volt.coeff = (-6265015),
|
||||
.ADC_volt.offset = 101843650153,
|
||||
|
||||
.ADC_current[0].coeff = 62522034,
|
||||
.ADC_current[0].offset = (-1016702373525),
|
||||
|
||||
.ADC_current[1].coeff = 31613132,
|
||||
.ADC_current[1].offset = (-514033175600),
|
||||
|
||||
.ADC_current[2].coeff = 565897139,
|
||||
.ADC_current[2].offset = (-9201204539440),
|
||||
|
||||
.DAC2RealV.coeff = (-18990774),
|
||||
.DAC2RealV.offset = 570886531263,
|
||||
|
||||
.Usercode2DAC.coeff = (-10541427),
|
||||
.Usercode2DAC.offset = 562159124753,
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_EUROPEAN
|
||||
{
|
||||
.ADC_volt.coeff = (-6264190),
|
||||
.ADC_volt.offset = 101683809669,
|
||||
|
||||
.ADC_current[0].coeff = 31301451,
|
||||
.ADC_current[0].offset = (-508301866021),
|
||||
|
||||
.ADC_current[1].coeff = 656423459,
|
||||
.ADC_current[1].offset = (-10660544072862),
|
||||
|
||||
.ADC_current[2].coeff = 31414514,
|
||||
.ADC_current[2].offset = (-510185549182),
|
||||
|
||||
.DAC2RealV.coeff = (-18990774),
|
||||
.DAC2RealV.offset = 570886531263,
|
||||
|
||||
.Usercode2DAC.coeff = (-10513774),
|
||||
.Usercode2DAC.offset = 559795292677,
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_EARTH
|
||||
{
|
||||
.ADC_volt.coeff = (-6256660),
|
||||
.ADC_volt.offset = 101658275678,
|
||||
|
||||
.ADC_current[0].coeff = 31271240,
|
||||
.ADC_current[0].offset = (-508496329863),
|
||||
|
||||
.ADC_current[1].coeff = 659931818,
|
||||
.ADC_current[1].offset = (-10729666444387),
|
||||
|
||||
.ADC_current[2].coeff = 31485559,
|
||||
.ADC_current[2].offset = (-511907957163),
|
||||
|
||||
.DAC2RealV.coeff = (-19047143),
|
||||
.DAC2RealV.offset = 565935714286,
|
||||
|
||||
.Usercode2DAC.coeff = (-10500262),
|
||||
.Usercode2DAC.offset = 559619735831,
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_MARS
|
||||
{
|
||||
.ADC_volt.coeff = (-6270623),
|
||||
.ADC_volt.offset = 102383421553,
|
||||
|
||||
.ADC_current[0].coeff = 31187022,
|
||||
.ADC_current[0].offset = (-509159321195),
|
||||
|
||||
.ADC_current[1].coeff = 655981611,
|
||||
.ADC_current[1].offset = (-10709717111320),
|
||||
|
||||
.ADC_current[2].coeff = 31256968,
|
||||
.ADC_current[2].offset = (-510275213115),
|
||||
|
||||
.DAC2RealV.coeff = (-18937347),
|
||||
.DAC2RealV.offset = 568558163265,
|
||||
|
||||
.Usercode2DAC.coeff = (-10561141),
|
||||
.Usercode2DAC.offset = 564249134291,
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_VENUS
|
||||
{
|
||||
.ADC_volt.coeff = (-6268996),
|
||||
.ADC_volt.offset = 102204055818,
|
||||
|
||||
.ADC_current[0].coeff = 31131930,
|
||||
.ADC_current[0].offset = (-507382432547),
|
||||
|
||||
.ADC_current[1].coeff = 654620883,
|
||||
.ADC_current[1].offset = (-10668953588943),
|
||||
|
||||
.ADC_current[2].coeff = 31245260,
|
||||
.ADC_current[2].offset = (-509181085054),
|
||||
|
||||
.DAC2RealV.coeff = (-19009388),
|
||||
.DAC2RealV.offset = 567032653061,
|
||||
|
||||
.Usercode2DAC.coeff = (-10521117),
|
||||
.Usercode2DAC.offset = 561308254899,
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_MERCURY
|
||||
{
|
||||
.ADC_volt.coeff = (-6259808),
|
||||
.ADC_volt.offset = 102009860128,
|
||||
|
||||
.ADC_current[0].coeff = 31335917,
|
||||
.ADC_current[0].offset = (-511426612252),
|
||||
|
||||
.ADC_current[1].coeff = 658172815,
|
||||
.ADC_current[1].offset = (-10738251896209),
|
||||
|
||||
.ADC_current[2].coeff = 31482687000,
|
||||
.ADC_current[2].offset = (-513650531545000),
|
||||
|
||||
.DAC2RealV.coeff = (-19009388),
|
||||
.DAC2RealV.offset = 567032653061,
|
||||
|
||||
.Usercode2DAC.coeff = (-10548297),
|
||||
.Usercode2DAC.offset = 562611756757,
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_JUPITER
|
||||
{
|
||||
.ADC_volt.coeff = (-6269507),
|
||||
.ADC_volt.offset = 102248973021,
|
||||
|
||||
.ADC_current[0].coeff = 62606101,
|
||||
.ADC_current[0].offset = (-1020702772438),
|
||||
|
||||
.ADC_current[1].coeff = 31499422396,
|
||||
.ADC_current[1].offset = (-513648914536877),
|
||||
|
||||
.ADC_current[2].coeff = 567312273129,
|
||||
.ADC_current[2].offset = (-9251161237908370),
|
||||
|
||||
.DAC2RealV.coeff = (-19009388),
|
||||
.DAC2RealV.offset = 567032653061,
|
||||
|
||||
.Usercode2DAC.coeff = (-10475808),
|
||||
.Usercode2DAC.offset = 560591538462,
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_SATURN
|
||||
{
|
||||
.ADC_volt.coeff = (-6266426),
|
||||
.ADC_volt.offset = 102071252282,
|
||||
|
||||
.ADC_current[0].coeff = 62606101,
|
||||
.ADC_current[0].offset = (-1020702772438),
|
||||
|
||||
.ADC_current[1].coeff = 31581169256,
|
||||
.ADC_current[1].offset = (-514718756925423),
|
||||
|
||||
.ADC_current[2].coeff = 567519654107,
|
||||
.ADC_current[2].offset = (-9249719082466730),
|
||||
|
||||
.DAC2RealV.coeff = (-19009388),
|
||||
.DAC2RealV.offset = 567032653061,
|
||||
|
||||
.Usercode2DAC.coeff = (-10475385),
|
||||
.Usercode2DAC.offset = 558776923077,
|
||||
|
||||
.Gain0Boundary[0] = 0x5D96,
|
||||
.Gain0Boundary[1] = 0x5DD9,
|
||||
|
||||
.Gain1Boundary[0] = 0x57CD,
|
||||
.Gain1Boundary[1] = 0x639F
|
||||
.Usercode2DAC[1].coeff = (-178479878),
|
||||
.Usercode2DAC[1].offset = 4782895510276,
|
||||
};
|
||||
#endif
|
||||
|
||||
// this function turn ADC measure value (0xXXXX) into real voltage
|
||||
// unit should be mV
|
||||
static int32_t DecodeADCVolt(uint16_t ADC_measure){
|
||||
// unit should be uV
|
||||
static int32_t DecodeADCVolt(uint8_t ADCGain, uint16_t ADC_measure){
|
||||
long long ADCRealVolt = 0;
|
||||
|
||||
ADCRealVolt = (Correction.ADC_volt.coeff * ADC_measure + Correction.ADC_volt.offset);
|
||||
ADCRealVolt = ADCRealVolt / 1e7;
|
||||
ADCRealVolt = (Correction.ADC_volt[ADCGain].coeff * ADC_measure + Correction.ADC_volt[ADCGain].offset)/1e4;
|
||||
|
||||
return (int32_t) (ADCRealVolt);
|
||||
}
|
||||
|
||||
// this function turn ADC measure value (0xXXXX) into Vout voltage
|
||||
// unit should be mV
|
||||
static int32_t DecodeADCVoutVolt(uint16_t ADC_measure){
|
||||
long long ADCVoutVolt = 0;
|
||||
|
||||
ADCVoutVolt = ((-62658782380) * ADC_measure + 1020118014900000);
|
||||
ADCVoutVolt = ADCVoutVolt / 1e11;
|
||||
return (int32_t) (ADCVoutVolt);
|
||||
}
|
||||
|
||||
// this function turn ADC measure value (0xXXXX) into Battery voltage
|
||||
// unit should be mV
|
||||
static int32_t DecodeADCBatVolt(uint16_t ADC_measure){
|
||||
long long ADCBatVolt = 0;
|
||||
|
||||
ADCBatVolt = (47362594 * ADC_measure + 290422184577);
|
||||
ADCBatVolt = ADCBatVolt / 1e8;
|
||||
return (int32_t) (ADCBatVolt);
|
||||
}
|
||||
|
||||
// this function turn ADC measure value (0xXXXX) into real current
|
||||
// unit should be pA
|
||||
// unit should be nA
|
||||
static int32_t DecodeADCCurrent(uint8_t ADCGain, uint16_t ADC_measure){
|
||||
long long ADCRealCurrent = 0;
|
||||
|
||||
ADCRealCurrent = (Correction.ADC_current[ADCGain].coeff * ADC_measure + Correction.ADC_current[ADCGain].offset)/1e7;
|
||||
|
||||
// Current unit is pA;
|
||||
// If ADCGain is GAIN_200R unit is nA
|
||||
// If ADCGain is I_GAIN_100R unit is nA
|
||||
return (int32_t) (ADCRealCurrent);
|
||||
}
|
||||
|
||||
static int32_t DecodeResister(uint8_t ADCGainLevel, uint16_t CurrentMeasure, uint16_t VoltMeasure){
|
||||
long long ADCRealResister = 0, ADCRealCurrent=0, ADCRealVolt=0;
|
||||
int32_t current_32, volt_32, resister_32;
|
||||
|
||||
// get measure current
|
||||
ADCRealCurrent = (Correction.ADC_current[ADCGainLevel].coeff * CurrentMeasure + Correction.ADC_current[ADCGainLevel].offset)/1e7;
|
||||
current_32 = (int32_t) (ADCRealCurrent);
|
||||
|
||||
// get measure volt
|
||||
// This step is necessary, if the measure resister !>> 10 ohm
|
||||
ADCRealVolt = (Correction.ADC_volt.coeff * VoltMeasure + Correction.ADC_volt.offset);
|
||||
ADCRealVolt = ADCRealVolt / 1e4;
|
||||
volt_32 = (int32_t) (ADCRealVolt);
|
||||
|
||||
if (INSTRUCTION.ADCGainLevel == GAIN_200R){
|
||||
resister_32 = (int32_t) ((ADCRealVolt) / (ADCRealCurrent/1e3)); // nV / uA = mV
|
||||
}
|
||||
else{
|
||||
resister_32 = (int32_t) ((ADCRealVolt) / (ADCRealCurrent/1e6)); // nV / uA = mV
|
||||
}
|
||||
// NotifyVolt[0] = (uint8_t) (volt_32 >> 24);
|
||||
// NotifyVolt[1] = (uint8_t) ((volt_32 & 0x00FF0000) >> 16);
|
||||
// NotifyVolt[2] = (uint8_t) ((volt_32 & 0x0000FF00) >> 8);
|
||||
// NotifyVolt[3] = (uint8_t) (volt_32 & 0x000000FF);
|
||||
//
|
||||
// NotifyCurrent[0] = (uint8_t) (current_32 >> 24);
|
||||
// NotifyCurrent[1] = (uint8_t) ((current_32 & 0x00FF0000) >> 16);
|
||||
// NotifyCurrent[2] = (uint8_t) ((current_32 & 0x0000FF00) >> 8);
|
||||
// NotifyCurrent[3] = (uint8_t) (current_32 & 0x000000FF);
|
||||
|
||||
NotifyImpedance[0] = (uint8_t) (resister_32 >> 24);
|
||||
NotifyImpedance[1] = (uint8_t) ((resister_32 & 0x00FF0000) >> 16);
|
||||
NotifyImpedance[2] = (uint8_t) ((resister_32 & 0x0000FF00) >> 8);
|
||||
NotifyImpedance[3] = (uint8_t) (resister_32 & 0x000000FF);
|
||||
|
||||
return resister_32;
|
||||
}
|
||||
|
||||
// Decode ADC measure value (could be a volt or current) and put it into notify buffer
|
||||
static int32_t DecodeADCValue(uint8_t ADCGain, uint8_t ADCChannel, uint8_t *ADC_raw){
|
||||
|
||||
uint16_t ADC_measure = (uint16_t) (ADC_raw[0] << 8) | (uint16_t) (ADC_raw[1]);
|
||||
int32_t ADCRealVolt = 0, ret = 0, ADCRealCurrent = 0, ADCRealResister = 0;
|
||||
int32_t ADCRealVolt = 0, ret = 0, ADCRealCurrent = 0, ADCVoutVolt = 0, ADCBatVolt = 0;
|
||||
|
||||
// InputNotify(NOTIFY_VOLT, (uint32_t)(ADC_measure));//
|
||||
// return real volt to controller
|
||||
if(ADCChannel == ADC_CH_VOLT){
|
||||
ADCRealVolt = DecodeADCVolt(ADC_measure);
|
||||
NotifyVolt[0] = (uint8_t) (ADCRealVolt >> 24);
|
||||
NotifyVolt[1] = (uint8_t) ((ADCRealVolt & 0x00FF0000) >> 16);
|
||||
NotifyVolt[2] = (uint8_t) ((ADCRealVolt & 0x0000FF00) >> 8);
|
||||
NotifyVolt[3] = (uint8_t) (ADCRealVolt & 0x000000FF);
|
||||
ADCRealVolt = DecodeADCVolt(ADCGain, ADC_measure);
|
||||
ret = ADCRealVolt;
|
||||
}
|
||||
|
||||
// return real current to controller
|
||||
else if(ADCChannel == ADC_CH_CURRENT){
|
||||
ADCRealCurrent = DecodeADCCurrent(ADCGain, ADC_measure);
|
||||
ret = ADCRealCurrent;
|
||||
}
|
||||
|
||||
if ( (INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
|
||||
// wait 0.1 sec until circuit stable => discard first data means wait 0.1 sec
|
||||
if(DiscardIVFirstData){
|
||||
DiscardIVFirstData = 0;
|
||||
return 0;
|
||||
}
|
||||
ADCRealCurrent_long += DecodeADCCurrent(ADCGain, ADC_measure);
|
||||
avg_number++;
|
||||
|
||||
if (StepTimeCounter == INSTRUCTION.StepTime - 1) {
|
||||
DiscardIVFirstData = 1;
|
||||
ADCRealCurrent_long = ADCRealCurrent_long / avg_number;
|
||||
NotifyCurrent[0] = (uint8_t) (ADCRealCurrent_long >> 24);
|
||||
NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent_long & 0x00FF0000) >> 16);
|
||||
NotifyCurrent[2] = (uint8_t) ((ADCRealCurrent_long & 0x0000FF00) >> 8);
|
||||
NotifyCurrent[3] = (uint8_t) (ADCRealCurrent_long & 0x000000FF);
|
||||
avg_number = 0;
|
||||
ADCRealCurrent_long = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// IT curve
|
||||
else {
|
||||
ADCRealCurrent = DecodeADCCurrent(ADCGain, ADC_measure);
|
||||
NotifyCurrent[0] = (uint8_t) (ADCRealCurrent >> 24);
|
||||
NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent & 0x00FF0000) >> 16);
|
||||
NotifyCurrent[2] = (uint8_t) ((ADCRealCurrent & 0x0000FF00) >> 8);
|
||||
NotifyCurrent[3] = (uint8_t) (ADCRealCurrent & 0x000000FF);
|
||||
ret = ADCRealCurrent;
|
||||
}
|
||||
// return real VoutVolt to controller
|
||||
else if(ADCChannel == ADC_CH_DAC){
|
||||
ADCVoutVolt = DecodeADCVoutVolt(ADC_measure);
|
||||
ret = ADCVoutVolt;
|
||||
}
|
||||
|
||||
// return real Battery Volt to controller
|
||||
else if(ADCChannel == ADC_CH_BAT){
|
||||
ADCBatVolt = DecodeADCBatVolt(ADC_measure);
|
||||
ret = ADCBatVolt;
|
||||
}
|
||||
|
||||
else{
|
||||
@@ -777,7 +294,7 @@ static void ADC_overflow(uint8_t gain, uint8_t *rawdata){
|
||||
uint16_t U16Rawdata = 0;
|
||||
U16Rawdata = (((uint16_t) (rawdata[0]))<<8) | ((uint16_t) (rawdata[1]));
|
||||
|
||||
if(gain == GAIN_200K){
|
||||
if(gain == I_GAIN_3M){
|
||||
if( U16Rawdata <= Correction.Gain0Boundary[0]){
|
||||
rawdata[0] = Correction.Gain0Boundary[0] >> 4;
|
||||
rawdata[1] = (uint8_t) (Correction.Gain0Boundary[0] & 0x00FF);
|
||||
@@ -787,7 +304,7 @@ static void ADC_overflow(uint8_t gain, uint8_t *rawdata){
|
||||
rawdata[1] = (uint8_t) (Correction.Gain0Boundary[1] & 0x00FF);
|
||||
}
|
||||
}
|
||||
else if(gain == GAIN_10K){
|
||||
else if(gain == I_GAIN_100K){
|
||||
if( U16Rawdata <= Correction.Gain1Boundary[0]){
|
||||
rawdata[0] = Correction.Gain1Boundary[0] >> 4;
|
||||
rawdata[1] = (uint8_t) (Correction.Gain1Boundary[0] & 0x00FF);
|
||||
@@ -802,29 +319,29 @@ static void ADC_overflow(uint8_t gain, uint8_t *rawdata){
|
||||
// User will enter -5V~+5V in UI.
|
||||
// websever and controler use 0~50000 represent -5~+5V
|
||||
// this function should turn 0~50000 into DACcode which output the exactly voltage user want
|
||||
static uint16_t Usercode_Correction_to_DAC(uint16_t usercode)
|
||||
static uint16_t Usercode_Correction_to_DAC(uint8_t DACGain, uint16_t usercode)
|
||||
{
|
||||
long long usercode_32;
|
||||
uint16_t DACcode = 0;
|
||||
|
||||
usercode_32 = (long long)(usercode);
|
||||
|
||||
DACcode = (uint16_t) ((Correction.Usercode2DAC.coeff * usercode_32 + Correction.Usercode2DAC.offset)/1e7);
|
||||
DACcode = (uint16_t) ((Correction.Usercode2DAC[DACGain].coeff * usercode_32 + Correction.Usercode2DAC[DACGain].offset)/1e7);
|
||||
|
||||
return DACcode;
|
||||
}
|
||||
|
||||
|
||||
static int32_t DAC_to_realV(uint16_t DACcode)
|
||||
static int32_t DAC_to_realV(uint8_t DACGain, uint16_t DACcode)
|
||||
{
|
||||
int32_t RealV = 0;
|
||||
long long usercode_32;
|
||||
|
||||
usercode_32 = ((DACcode * 1e7) - Correction.Usercode2DAC.offset) / Correction.Usercode2DAC.coeff;
|
||||
usercode_32 = ((DACcode * 1e7) - Correction.Usercode2DAC[DACGain].offset) / Correction.Usercode2DAC[DACGain].coeff;
|
||||
|
||||
RealV = (int32_t) (usercode_32 / 5) - 5000;
|
||||
|
||||
// return mV
|
||||
RealV = (int32_t) ((usercode_32 / 5) - 5000) * 1000;
|
||||
// RealV = (int32_t) usercode_32;
|
||||
// return nV
|
||||
return RealV;
|
||||
}
|
||||
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
|
||||
#ifndef ELITE_FLAG_CT_INIT
|
||||
#define ELITE_FLAG_CT_INIT
|
||||
|
||||
// CT counter
|
||||
struct _CT{
|
||||
uint32_t SampleRate_counter;
|
||||
uint16_t StepTimeCounter;
|
||||
uint16_t NotifyCounter;
|
||||
uint32_t StandByCounter;
|
||||
}CT = {0};
|
||||
|
||||
// GPT counter
|
||||
struct _GPT{
|
||||
uint32_t GptimerCounter;
|
||||
uint32_t GptimerCounter0;
|
||||
uint8_t DeltaGptimerCounter;
|
||||
uint32_t SampleRateCounter;
|
||||
uint32_t NotifyCounter;
|
||||
uint32_t VscanRateCounter;
|
||||
uint32_t LeadTimeCounter;
|
||||
uint32_t BatteryADCCounter;
|
||||
uint32_t BatteryCheckCounter;
|
||||
uint32_t GptimerMultiple;
|
||||
}GPT = {0};
|
||||
|
||||
static void InitCT(){
|
||||
CT.SampleRate_counter = 1;
|
||||
CT.StepTimeCounter = 1;
|
||||
CT.NotifyCounter = 1;
|
||||
CT.StandByCounter = 0;
|
||||
}
|
||||
|
||||
static void InitGPT(){
|
||||
GPT.GptimerCounter = 0;
|
||||
GPT.GptimerCounter0 = 0;
|
||||
GPT.DeltaGptimerCounter = 0;
|
||||
GPT.SampleRateCounter = 0;
|
||||
GPT.NotifyCounter = 0;
|
||||
GPT.VscanRateCounter = 0;
|
||||
GPT.LeadTimeCounter = 0;
|
||||
GPT.BatteryADCCounter = 0;
|
||||
GPT.BatteryCheckCounter = 0;
|
||||
}
|
||||
#endif
|
||||
+1
-1
@@ -17,7 +17,7 @@ static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_In
|
||||
#define elite_gptimer_start() GPTimerCC26XX_start(gptimer_handle)
|
||||
#define elite_gptimer_stop() GPTimerCC26XX_stop(gptimer_handle)
|
||||
#define elite_gptimer_close() GPTimerCC26XX_close(gptimer_handle)
|
||||
#define CLOCK_FREQ 4000 // clock freq = 0.1 ms
|
||||
#define CLOCK_FREQ 4800 // clock freq = 0.1 ms
|
||||
|
||||
#define elite_gptimer_open() \
|
||||
do { \
|
||||
|
||||
+1
-5
@@ -8,17 +8,13 @@
|
||||
* exports/tirtos_full_2_14_02_22/docs/doxygen/html/_i2_c_c_c26_x_x_8h.html
|
||||
*
|
||||
*/
|
||||
#include <Board.h>
|
||||
|
||||
#include <ti/drivers/I2C.h>
|
||||
#include <ti/drivers/Power.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <ti/drivers/i2c/I2CCC26XX.h>
|
||||
|
||||
#include "Elite_PIN.h"
|
||||
|
||||
// I2C
|
||||
static I2C_Handle I2Chandle;
|
||||
static I2C_Params I2Cparams;
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
|
||||
#ifndef ELITEIT
|
||||
#define ELITEIT
|
||||
|
||||
static int32_t IT_Plot() {
|
||||
// read ADC current
|
||||
int32_t Real_Current = 0;
|
||||
ADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
ADCChannelSelect(ADC_CH_CURRENT);
|
||||
CPUdelay(10);
|
||||
ADC_read(spi_ADC_rxbuf);
|
||||
|
||||
// check if ADC over/under flow
|
||||
// let the output saturate if over/under flow
|
||||
// ADC_overflow(INSTRUCTION.ADCGainLevel, spi_ADC_rxbuf);
|
||||
|
||||
// decode ADC value and put it into notify buffer
|
||||
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
|
||||
|
||||
return Real_Current;
|
||||
}
|
||||
|
||||
#endif
|
||||
+33
-55
@@ -2,69 +2,47 @@
|
||||
#ifndef ELITEIV
|
||||
#define ELITEIV
|
||||
|
||||
static uint16_t VoltScan() {
|
||||
uint16_t Voltage;
|
||||
if (INSTRUCTION.VoltOrigin == INSTRUCTION.VoltFinal) {
|
||||
Voltage = Usercode_Correction_to_DAC(INSTRUCTION.VoltOrigin);
|
||||
DAC_outputV(Voltage);
|
||||
PeriodicEvent = false;
|
||||
return Voltage;
|
||||
} else if (INSTRUCTION.eliteFxn == SQUARE_WAVE_VOLTAMMETRY) {
|
||||
Voltage = SWVCurve();
|
||||
} else if (INSTRUCTION.eliteFxn == DIFFERENTIAL_PULSE_VOLTAMMETRY) {
|
||||
Voltage = DPVCurve();
|
||||
} else if (INSTRUCTION.eliteFxn == CV_CURVE) {
|
||||
Voltage = CVCurve();
|
||||
#define Vset INSTRUCTION.Vset
|
||||
|
||||
static void IV_Vscan(IVMode *IV){
|
||||
if(vscanReset){
|
||||
if(INSTRUCTION.directionInit == 1){
|
||||
IV->_direction_up = true;
|
||||
IV->_current_direction_up = true;
|
||||
}else if(INSTRUCTION.directionInit == 0){
|
||||
IV->_direction_up = false;
|
||||
IV->_current_direction_up = false;
|
||||
}
|
||||
|
||||
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
|
||||
if(INSTRUCTION.step <= 10){
|
||||
IV->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
|
||||
}else{
|
||||
IV->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
|
||||
}
|
||||
|
||||
Vset = IV->_Vinit;
|
||||
}
|
||||
|
||||
// IV plot mode
|
||||
else {
|
||||
Voltage = OneWayVoltScan();
|
||||
}
|
||||
|
||||
return Voltage;
|
||||
}
|
||||
|
||||
static uint16_t OneWayVoltScan() {
|
||||
static uint16_t DACOutCode;
|
||||
|
||||
// reset origin volt at the begin
|
||||
if (DACReset) {
|
||||
DACUserCode = INSTRUCTION.VoltOrigin;
|
||||
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
|
||||
DACReset = false;
|
||||
|
||||
// output VOLT_ORIGIN
|
||||
DAC_outputV(DACOutCode);
|
||||
return DACOutCode;
|
||||
}
|
||||
|
||||
if (StepTimeCounter == INSTRUCTION.StepTime) {
|
||||
if (INSTRUCTION.VoltOrigin < INSTRUCTION.VoltFinal) {
|
||||
// output the next output volt
|
||||
DACUserCode = DACUserCode + INSTRUCTION.Step;
|
||||
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
|
||||
DAC_outputV(DACOutCode);
|
||||
|
||||
// end IV task if we reach INSTRUCTION.VoltFinal
|
||||
if (DACUserCode >= INSTRUCTION.VoltFinal) {
|
||||
if(!vscanReset){
|
||||
if(IV->_current_direction_up){
|
||||
if(Vset >= IV->_Vmax){
|
||||
PeriodicEvent = false;
|
||||
DACReset = true;
|
||||
ModeLED(NO_EVENT);
|
||||
}
|
||||
} else {
|
||||
// output the next output volt
|
||||
DACUserCode = DACUserCode - INSTRUCTION.Step;
|
||||
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
|
||||
DAC_outputV(DACOutCode);
|
||||
|
||||
// end IV task if we reach INSTRUCTION.VoltFinal
|
||||
if (DACUserCode <= INSTRUCTION.VoltFinal) {
|
||||
}else{
|
||||
if(Vset <= IV->_Vmin){
|
||||
PeriodicEvent = false;
|
||||
DACReset = true;
|
||||
ModeLED(NO_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
if (IV->_current_direction_up){
|
||||
Vset = Vset + IV->_Vstep * GPT.GptimerMultiple;
|
||||
}else{
|
||||
Vset = Vset - IV->_Vstep * GPT.GptimerMultiple;
|
||||
}
|
||||
}
|
||||
return DACOutCode;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+121
-78
@@ -2,59 +2,99 @@
|
||||
#ifndef ELITEINSTRUCTION
|
||||
#define ELITEINSTRUCTION
|
||||
|
||||
/** ADC gain level **/
|
||||
#define GAIN_200K 0x00 // largest gain
|
||||
#define GAIN_10K 0x01
|
||||
#define GAIN_200R 0x02 // the least gain
|
||||
#define GAIN_AUTO 0x03
|
||||
/** Iin, Vin, Vout **/
|
||||
#define IIN_ADC 0x00
|
||||
#define VIN_ADC 0x01
|
||||
#define VOUT_DAC 0x02
|
||||
#define HIGH_Z 0x03
|
||||
|
||||
/** Resister meter **/
|
||||
#define RESISTER_METER_SMALL 0x00
|
||||
#define RESISTER_METER_MIDDLE1 0x01
|
||||
#define RESISTER_METER_MIDDLE2 0x02
|
||||
#define RESISTER_METER_LARGE 0x03
|
||||
/** ADC Iin gain level **/
|
||||
#define I_GAIN_3M 0x00 // largest gain
|
||||
#define I_GAIN_100K 0x01
|
||||
#define I_GAIN_3K 0x02
|
||||
#define I_GAIN_100R 0x03 // the least gain
|
||||
#define I_GAIN_AUTO 0x04
|
||||
|
||||
/** CC mode parameter **/
|
||||
// CurrentLV
|
||||
#define CURRENT_LV_NA 0x00
|
||||
#define CURRENT_LV_UA 0x01
|
||||
#define CURRENT_LV_MA 0x02
|
||||
/** ADC Vin gain level **/
|
||||
#define VIN_GAIN_1M 0x00
|
||||
#define VIN_GAIN_30K 0x01
|
||||
#define VIN_GAIN_1K 0x02
|
||||
#define VIN_GAIN_AUTO 0x03
|
||||
|
||||
/** Vout gain level **/
|
||||
#define VOUT_GAIN_240K 0x00
|
||||
#define VOUT_GAIN_15K 0x01
|
||||
#define VOUT_GAIN_AUTO 0x02
|
||||
|
||||
/* DAC reset parameter */
|
||||
#define DAC_ZERO 25000
|
||||
|
||||
// Step time macro
|
||||
#define STEPTIME_HALF_SEC 5000
|
||||
#define STEPTIME_ONE_SEC 10000
|
||||
#define STEPTIME_TWO_SEC 20000
|
||||
|
||||
/*==============================
|
||||
==== headstage instruction ====
|
||||
=============================*/
|
||||
struct HEADSTAGE_INSTRUCTION {
|
||||
/** chip ID */
|
||||
uint8_t chip_id;
|
||||
|
||||
/** Sample rate **/
|
||||
// SampleRate = SampleRateTable[SampleRateIndex]
|
||||
uint8_t SampleRateIndex;
|
||||
uint32_t SampleRate;
|
||||
uint8_t chip_id;
|
||||
uint8_t eliteFxn;
|
||||
|
||||
/** DAC parameter **/
|
||||
// volt san parameter
|
||||
uint16_t VoltOrigin;
|
||||
uint16_t VoltFinal;
|
||||
uint16_t Step;
|
||||
uint16_t StepTime;
|
||||
// constant volt
|
||||
uint8_t VsetRateIndex;
|
||||
uint32_t VsetRate;
|
||||
int32_t Vset;
|
||||
uint16_t VoltConstant;
|
||||
uint8_t directionInit;
|
||||
uint32_t step;
|
||||
uint16_t Ve1;
|
||||
uint16_t Ve2;
|
||||
int32_t Vinit;
|
||||
int32_t Vmax;
|
||||
int32_t Vmin;
|
||||
|
||||
/** ADC parameter **/
|
||||
uint8_t ADCGainLevel;
|
||||
uint8_t sampleRateIndex;
|
||||
uint32_t sampleRate;
|
||||
uint8_t VoViSwitch;
|
||||
uint8_t AutoGainEnable;
|
||||
uint8_t VinAutoGainEnable;
|
||||
uint8_t VoutAutoGainEnable;
|
||||
uint8_t ADCGainLevel;
|
||||
// voltage output gain
|
||||
uint16_t VoutGainLevel;
|
||||
uint8_t VinADCGainLevel;
|
||||
|
||||
/** Constant Current Parameter **/
|
||||
uint8_t CurrentLV; // nA? uA? mA?
|
||||
uint32_t ConstantCurrent;
|
||||
/** Notify parameter **/
|
||||
uint32_t notifyRate;
|
||||
|
||||
/** Resister Measure **/
|
||||
uint8_t ResisterMeter;
|
||||
/** mode parameter **/
|
||||
uint16_t cycleNumber;
|
||||
uint8_t charge;
|
||||
int32_t constantCurrent;
|
||||
int32_t Currentmax;
|
||||
int32_t t1;
|
||||
int32_t t2;
|
||||
int32_t t3;
|
||||
int32_t t4;
|
||||
int32_t t5;
|
||||
int32_t v1;
|
||||
int32_t v2;
|
||||
int32_t v3;
|
||||
int32_t v4;
|
||||
int32_t v5;
|
||||
int32_t t1Time;
|
||||
int32_t t2Time;
|
||||
int32_t t3Time;
|
||||
int32_t t4Time;
|
||||
int32_t t5Time;
|
||||
uint16_t loop;
|
||||
|
||||
// elite function
|
||||
uint8_t eliteFxn;
|
||||
uint16_t StepTime;
|
||||
|
||||
uint8_t CycleNumber;
|
||||
uint8_t AdcChannel;
|
||||
|
||||
} INSTRUCTION = {0};
|
||||
|
||||
@@ -68,47 +108,50 @@ struct HEADSTAGE_INSTRUCTION {
|
||||
* @return None.
|
||||
*/
|
||||
static void InitEliteInstruction(){
|
||||
INSTRUCTION.chip_id = 0;
|
||||
INSTRUCTION.SampleRateIndex = 1;
|
||||
INSTRUCTION.SampleRate = 10;
|
||||
INSTRUCTION.VoltOrigin = DAC_ZERO;
|
||||
INSTRUCTION.VoltFinal = DAC_POS_MAX;
|
||||
INSTRUCTION.Step = 0x0005; // 0x0005 = 1mV
|
||||
INSTRUCTION.StepTime = STEPTIME_HALF_SEC; // about 0.5 sec
|
||||
INSTRUCTION.VoltConstant = 24999; // is about 0V
|
||||
INSTRUCTION.ADCGainLevel = GAIN_200K;
|
||||
INSTRUCTION.ResisterMeter = RESISTER_METER_LARGE;
|
||||
INSTRUCTION.CurrentLV = 0x00;
|
||||
INSTRUCTION.ConstantCurrent = 0x00000000;
|
||||
INSTRUCTION.eliteFxn = 0; // default is a null event
|
||||
INSTRUCTION.CycleNumber = 0;
|
||||
INSTRUCTION.chip_id = 0;
|
||||
INSTRUCTION.eliteFxn = 0; //default is a null event
|
||||
INSTRUCTION.VsetRateIndex = 0;
|
||||
INSTRUCTION.VsetRate = 2;
|
||||
INSTRUCTION.Vset = 0;
|
||||
INSTRUCTION.VoltConstant = DAC_ZERO; //DAC_ZERO is about 0V
|
||||
INSTRUCTION.directionInit = 1; //0:reverse 1:forward
|
||||
INSTRUCTION.step = 0;
|
||||
INSTRUCTION.Ve1 = DAC_ZERO;
|
||||
INSTRUCTION.Ve2 = DAC_ZERO;
|
||||
INSTRUCTION.Vinit = 0;
|
||||
INSTRUCTION.Vmax = 0;
|
||||
INSTRUCTION.Vmin = 0;
|
||||
INSTRUCTION.sampleRateIndex = 1;
|
||||
INSTRUCTION.sampleRate = 100;
|
||||
INSTRUCTION.VoViSwitch = 0x01; //0:user see Vo 1: user see Vi
|
||||
INSTRUCTION.AutoGainEnable = 1;
|
||||
INSTRUCTION.VinAutoGainEnable = 1;
|
||||
INSTRUCTION.VoutAutoGainEnable = 1;
|
||||
INSTRUCTION.ADCGainLevel = I_GAIN_AUTO;
|
||||
INSTRUCTION.VoutGainLevel = VOUT_GAIN_AUTO;
|
||||
INSTRUCTION.VinADCGainLevel = VIN_GAIN_AUTO;
|
||||
INSTRUCTION.notifyRate = STEPTIME_ONE_SEC;
|
||||
INSTRUCTION.cycleNumber = 1;
|
||||
INSTRUCTION.charge = 1; //0:discharge 1:charge
|
||||
INSTRUCTION.constantCurrent = 0;
|
||||
INSTRUCTION.Currentmax = 0;
|
||||
INSTRUCTION.StepTime = STEPTIME_ONE_SEC;
|
||||
INSTRUCTION.AdcChannel = 0;
|
||||
INSTRUCTION.t1 = 0;
|
||||
INSTRUCTION.t2 = 0;
|
||||
INSTRUCTION.t3 = 0;
|
||||
INSTRUCTION.t4 = 0;
|
||||
INSTRUCTION.t5 = 0;
|
||||
INSTRUCTION.t1Time = 0;
|
||||
INSTRUCTION.t2Time = 0;
|
||||
INSTRUCTION.t3Time = 0;
|
||||
INSTRUCTION.t4Time = 0;
|
||||
INSTRUCTION.t5Time = 0;
|
||||
INSTRUCTION.v1 = DAC_ZERO;
|
||||
INSTRUCTION.v2 = DAC_ZERO;
|
||||
INSTRUCTION.v3 = DAC_ZERO;
|
||||
INSTRUCTION.v4 = DAC_ZERO;
|
||||
INSTRUCTION.v5 = DAC_ZERO;
|
||||
INSTRUCTION.loop = 1;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* @fn GetInstructionParameter
|
||||
*
|
||||
* @brief Get Constant Current mode parameter.
|
||||
*
|
||||
* @param ins - instruction including current value and unit
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
static void GetInstructionParameter(uint8 *ins){
|
||||
// CurrentLV=0 => unit is nA
|
||||
// CurrentLV=1 => unit is uA
|
||||
// CurrentLV=2 => unit is mA
|
||||
INSTRUCTION.CurrentLV = (*ins);
|
||||
|
||||
// ConstantCurrentRange=0 => current value is 0~499
|
||||
// ConstantCurrentRange=1 => current value is 500~999
|
||||
// INSTRUCTION.ConstantCurrentRange = (*ins) & 0x0F;
|
||||
|
||||
// ConstantCurrent divide ConstantCurrentRange into 50000 count (thus each count is 0.01)
|
||||
// e.g. 485.7 uA can be represent by
|
||||
// CurrentLV = 1 (unit is uA)
|
||||
// ConstantCurrentRange = 0 (current range is 0~499)
|
||||
// ConstantCurrent = 48570
|
||||
INSTRUCTION.ConstantCurrent = (uint32_t) (*(ins+1))<<24 | (uint32_t) (*(ins+2))<<16 | (uint32_t) (*(ins+3))<<8 | (uint32_t) (*(ins+4));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+19
-14
@@ -2,25 +2,31 @@
|
||||
#ifndef ELITEKEYDETECT
|
||||
#define ELITEKEYDETECT
|
||||
|
||||
#define CLOCK_ONE_SECOND 10000
|
||||
|
||||
static bool TurnOnElite(uint8_t key) {
|
||||
static uint16_t TurnOnCounter = 0;
|
||||
|
||||
if (key == 0) {
|
||||
// press 1 sec, power on LED
|
||||
// press 1 sec, power on LED, read bat power
|
||||
if (TurnOnCounter >= CLOCK_ONE_SECOND) {
|
||||
PIN_setOutputValue(pin_handle, power_enable, 1); // enable +5V, +10V, -10V
|
||||
// TurnOn10V();
|
||||
LEDPowerON();
|
||||
return true;
|
||||
headstage_battery_volt();
|
||||
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) |
|
||||
((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
|
||||
if( bat < 768 && bat > 20){
|
||||
PIN15_setOutputValue(enable_5v, 0);
|
||||
return false;
|
||||
}else{
|
||||
PIN15_setOutputValue(enable_5v, 1); // enable 5V
|
||||
TurnOn10V();
|
||||
ModeLED(BT_WAIT);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
TurnOnCounter++;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
TurnOnCounter = 0;
|
||||
PIN_setOutputValue(pin_handle, power_enable, 0); // enable 5V
|
||||
PIN15_setOutputValue(enable_5v, 0); // disable 5V
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -34,20 +40,20 @@ static void EliteKeyPress(uint8_t key) {
|
||||
// press key => bight LED
|
||||
|
||||
if (ShutDownCounter == CLOCK_ONE_SECOND) {
|
||||
KeyWorkModeLED();
|
||||
KEYLED();
|
||||
}
|
||||
|
||||
// press 3~4 sec, shutdown 2650
|
||||
else if (ShutDownCounter > (CLOCK_ONE_SECOND*3) ) {
|
||||
LED_color(DARKLED, 0xFF, 0xFF, 0x00);
|
||||
PIN_setOutputValue(pin_handle, power_enable, 0); // disable +5V, -10V, +10V
|
||||
PIN15_setOutputValue(enable_5v, 0); // disable 5V
|
||||
}
|
||||
ShutDownCounter ++;
|
||||
} else {
|
||||
if (OriginEliteFxn == INSTRUCTION.eliteFxn) { // old function == currunt instruction
|
||||
if (ShutDownCounter != 0) {
|
||||
// dark LED
|
||||
WorkModeLED();
|
||||
checkFlafLED();
|
||||
ShutDownCounter = 0;
|
||||
}
|
||||
} else { // old function != currunt instruction
|
||||
@@ -55,15 +61,14 @@ static void EliteKeyPress(uint8_t key) {
|
||||
if (ShutDownCounter != 0) {
|
||||
ShutDownCounter = 0;
|
||||
}
|
||||
// dark mode LED
|
||||
WorkModeLED();
|
||||
checkFlafLED();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TurnOn10V() {
|
||||
If10Von = true;
|
||||
PIN_setOutputValue(pin_handle, power_enable, 1);
|
||||
PIN15_setOutputValue(enable_10v, 1);
|
||||
CPUdelay(8000);
|
||||
}
|
||||
|
||||
|
||||
+144
-94
@@ -2,12 +2,10 @@
|
||||
#ifndef ELITELED
|
||||
#define ELITELED
|
||||
|
||||
#define DARKLED 0xE1
|
||||
#define LIGHTLED 0xE8
|
||||
static void LED_color(uint8_t bright, uint8_t red, uint8_t green, uint8_t blue);
|
||||
#define LEDPowerON() LED_color(DARKLED, 0x00, 0xFA, 0x00)
|
||||
#define WORKLED() LED_color(0xE2, 0x00, 0x40, 0x40)
|
||||
#define KEYLED() LED_color(LIGHTLED, 0xF0, 0xA0, 0x00)
|
||||
#define DARKLED 0xE1
|
||||
#define LIGHTLED 0xE8
|
||||
|
||||
static void WorkModeLED();
|
||||
|
||||
static void LED_color(uint8_t bright, uint8_t red, uint8_t green, uint8_t blue) {
|
||||
spi_LEDtxbuf[0] = 0x0000;
|
||||
@@ -21,52 +19,94 @@ static void LED_color(uint8_t bright, uint8_t red, uint8_t green, uint8_t blue)
|
||||
spi_LEDtxbuf[SPI_LED_SIZE - 1] = 0xffff;
|
||||
|
||||
LED_SPI(SPI_LED_SIZE, spi_LEDtxbuf, spi_LEDrxbuf);
|
||||
|
||||
}
|
||||
|
||||
static void WorkModeLED() {
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IV_CURVE: {
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
case CV_CURVE: {
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
case DIFFERENTIAL_PULSE_VOLTAMMETRY: {
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
case SQUARE_WAVE_VOLTAMMETRY: {
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
case VOLT_OUTPUT: {
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE: {
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
case VT_CURVE: {
|
||||
// WORKLED();
|
||||
break;
|
||||
}
|
||||
case IT_CURVE: {
|
||||
WORKLED();
|
||||
break;
|
||||
static void Elite_led_color(uint16_t color){
|
||||
switch (color) {
|
||||
case COLOR_RED: {
|
||||
LED_color(DARKLED, 0x50, 0x00, 0x00);
|
||||
break;
|
||||
}
|
||||
case COLOR_ORANGE: {
|
||||
LED_color(DARKLED, 0x50, 0x58, 0x09);
|
||||
break;
|
||||
}
|
||||
case COLOR_YELLOW: {
|
||||
LED_color(LIGHTLED, 0x50, 0x80, 0x00);
|
||||
break;
|
||||
}
|
||||
case COLOR_GREEN: {
|
||||
LED_color(DARKLED, 0x00, 0xFA, 0x00);
|
||||
break;
|
||||
}
|
||||
case COLOR_YELLOWGREEN: {
|
||||
LED_color(DARKLED, 0x64, 0xA6, 0x00);
|
||||
break;
|
||||
}
|
||||
case COLOR_BLUE: {
|
||||
LED_color(DARKLED, 0x00, 0x00, 0xAA);
|
||||
break;
|
||||
}
|
||||
case COLOR_CYAN: {
|
||||
LED_color(DARKLED, 0x00, 0x40, 0x40);
|
||||
break;
|
||||
}
|
||||
case COLOR_MAGENTA: {
|
||||
LED_color(DARKLED, 0x50, 0x00, 0x80);
|
||||
break;
|
||||
}
|
||||
case COLOR_PURPLE: {
|
||||
LED_color(DARKLED, 0x50, 0x00, 0xFF);
|
||||
break;
|
||||
}
|
||||
case COLOR_WHITE: {
|
||||
LED_color(DARKLED, 0x50, 0xFF, 0xFF);
|
||||
break;
|
||||
}
|
||||
case COLOR_BLACK: {
|
||||
LED_color(0x00, 0x00, 0x00, 0x00);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case VIS_RST: {
|
||||
static void ModeLED(uint16_t modeStatus) {
|
||||
btWaitLedFlag = 0;
|
||||
noEventLedFlag = 0;
|
||||
preWorkLedFlag = 0;
|
||||
workingLedFlag = 0;
|
||||
postWorkLedFlag = 0;
|
||||
|
||||
switch (modeStatus) {
|
||||
case BT_WAIT: {
|
||||
btWaitLedFlag = 1;
|
||||
BT_WAIT_LED();
|
||||
break;
|
||||
}
|
||||
case NO_EVENT: {
|
||||
noEventLedFlag = 1;
|
||||
LEDPowerON();
|
||||
break;
|
||||
}
|
||||
case ADC_TEST: {
|
||||
WORKLED();
|
||||
case PRE_WORK: {
|
||||
preWorkLedFlag = 1;
|
||||
Elite_led_color(COLOR_BLUE);
|
||||
break;
|
||||
}
|
||||
case WORKING: {
|
||||
workingLedFlag = 1;
|
||||
WorkModeLED();
|
||||
break;
|
||||
}
|
||||
case POST_WORK: {
|
||||
postWorkLedFlag = 1;
|
||||
Elite_led_color(COLOR_BLUE);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
LEDPowerON();
|
||||
break;
|
||||
@@ -74,58 +114,68 @@ static void WorkModeLED() {
|
||||
}
|
||||
}
|
||||
|
||||
static void KeyWorkModeLED() {
|
||||
KEYLED();
|
||||
/*
|
||||
switch(INSTRUCTION.eliteFxn){
|
||||
case IV_CURVE:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
case DIFFERENTIAL_PULSE_VOLTAMMETRY:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
case SQUARE_WAVE_VOLTAMMETRY:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
case VOLT_OUTPUT:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
case IT_CURVE:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
|
||||
case VIS_RST:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
case ADC_TEST:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
|
||||
default:{
|
||||
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
|
||||
break;
|
||||
}
|
||||
static void checkFlafLED() {
|
||||
if(btWaitLedFlag == 1){
|
||||
ModeLED(BT_WAIT);
|
||||
}
|
||||
else if(noEventLedFlag == 1){
|
||||
ModeLED(NO_EVENT);
|
||||
}
|
||||
else if(preWorkLedFlag == 1){
|
||||
ModeLED(PRE_WORK);
|
||||
}
|
||||
else if(workingLedFlag == 1){
|
||||
ModeLED(WORKING);
|
||||
}
|
||||
else if(postWorkLedFlag == 1){
|
||||
ModeLED(POST_WORK);
|
||||
}
|
||||
}
|
||||
|
||||
static void WorkModeLED() {
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IV_CURVE:
|
||||
case CV_CURVE:
|
||||
case DIFFERENTIAL_PULSE_VOLTAMMETRY:
|
||||
case SQUARE_WAVE_VOLTAMMETRY:
|
||||
case VOLT_OUTPUT:
|
||||
case ZT_CURVE:
|
||||
case VT_CURVE:
|
||||
case IT_CURVE:
|
||||
case ADC_TEST:
|
||||
case CYCLIC_VOLTAMMETRY:
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:
|
||||
case CONSTANT_VSCAN:{
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
// Elite_led_color(COLOR_YELLOW);
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
case CALI_ADC_MODE:{
|
||||
if(INSTRUCTION.AdcChannel == IIN_ADC){
|
||||
Elite_led_color(COLOR_RED);
|
||||
}else if(INSTRUCTION.AdcChannel == VIN_ADC){
|
||||
Elite_led_color(COLOR_ORANGE);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// case VIS_RST: {
|
||||
// LEDPowerON();
|
||||
// break;
|
||||
// }
|
||||
default: {
|
||||
WORKLED();
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
#ifndef ELITELSV
|
||||
#define ELITELSV
|
||||
|
||||
#define Vset INSTRUCTION.Vset
|
||||
|
||||
static uint16_t LSVCurve(LSVMode *LSV){
|
||||
static uint16_t DACOutCode;
|
||||
static int32_t Vin;
|
||||
static int32_t Vout;
|
||||
static int32_t DeltaVout;
|
||||
|
||||
Vin = LSV->_measureVin * 200;//[5nV]
|
||||
if(DACReset){
|
||||
Vout = Vset + Vin;
|
||||
DACReset = false;
|
||||
}else{
|
||||
DeltaVout = Vset - (Vout - Vin);
|
||||
Vout = Vout + DeltaVout;
|
||||
}
|
||||
|
||||
INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
|
||||
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant);
|
||||
|
||||
int32_t RealV2;
|
||||
RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
|
||||
InputNotify(NOTIFY_VOLT, RealV2);
|
||||
|
||||
int32_t RealV;
|
||||
RealV = (int32_t)(Vout / 200);//[1uV]
|
||||
InputNotify(NOTIFY_IMPEDANCE, RealV);
|
||||
|
||||
DAC_outputV(DACOutCode);
|
||||
//
|
||||
return DACOutCode;
|
||||
}
|
||||
|
||||
static void LSV_Vscan(LSVMode *LSV){
|
||||
|
||||
NotifyCycleNumber = (INSTRUCTION.cycleNumber - LSV->_cycleNumber + 1);
|
||||
|
||||
if(vscanReset){
|
||||
if(INSTRUCTION.directionInit == 1){
|
||||
LSV->_direction_up = true;
|
||||
LSV->_current_direction_up = true;
|
||||
}else{
|
||||
LSV->_direction_up = false;
|
||||
LSV->_current_direction_up = false;
|
||||
}
|
||||
|
||||
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
|
||||
if(INSTRUCTION.step <= 10){
|
||||
LSV->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
|
||||
}else{
|
||||
LSV->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
|
||||
}
|
||||
|
||||
Vset = LSV->_Vinit;
|
||||
}
|
||||
|
||||
if(!vscanReset){
|
||||
|
||||
if (LSV->_current_direction_up){
|
||||
Vset = Vset + LSV->_Vstep * GPT.GptimerMultiple;
|
||||
}else{
|
||||
Vset = Vset - LSV->_Vstep * GPT.GptimerMultiple;
|
||||
}
|
||||
|
||||
/*stop condition*/
|
||||
if (Vset >= LSV->_Vmax){
|
||||
ModeLED(POST_WORK);
|
||||
// PeriodicEvent = false;
|
||||
Vset = LSV->_Vmin;
|
||||
InitEliteFlag();
|
||||
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
|
||||
INSTRUCTION.sampleRate = 15;
|
||||
INSTRUCTION.charge = 0x01;
|
||||
INSTRUCTION.constantCurrent = 0x00;
|
||||
INSTRUCTION.Vmax = 0xC350;
|
||||
INSTRUCTION.Vmin = 0x0000;
|
||||
INSTRUCTION.notifyRate = 500;
|
||||
INSTRUCTION.VoViSwitch = 0x02;//read Vscan = Vout - Vin
|
||||
}else if (Vset <= LSV->_Vmin){
|
||||
ModeLED(POST_WORK);
|
||||
// PeriodicEvent = false;
|
||||
Vset = LSV->_Vmax;
|
||||
InitEliteFlag();
|
||||
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
|
||||
INSTRUCTION.sampleRate = 15;
|
||||
INSTRUCTION.charge = 0x01;
|
||||
INSTRUCTION.constantCurrent = 0x00;
|
||||
INSTRUCTION.Vmax = 0xC350;
|
||||
INSTRUCTION.Vmin = 0x0000;
|
||||
INSTRUCTION.notifyRate = 500;
|
||||
INSTRUCTION.VoViSwitch = 0x02;//read Vscan = Vout - Vin
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
|
||||
#ifndef ELITE_LATCH_INIT
|
||||
#define ELITE_LATCH_INIT
|
||||
|
||||
static void InitLH() {
|
||||
for (int i=0; i<LATCH_BUFF_SIZE; i++) {
|
||||
LH.LATCH0[i] = 0;
|
||||
LH.LATCH1[i] = 0;
|
||||
LH.LATCH2[i] = 0;
|
||||
}
|
||||
LH.LoadState = 0;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+96
-20
@@ -1,15 +1,19 @@
|
||||
|
||||
#ifndef ELITENOTIFY
|
||||
#define ELITENOTIFY
|
||||
|
||||
#include "headstage.h"
|
||||
|
||||
/**
|
||||
* notify data buffer.
|
||||
* the length equals to the characteristic 4 which value is 20 bytes.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ELITENOTIFY
|
||||
#define ELITENOTIFY
|
||||
|
||||
#include "headstage.h"
|
||||
|
||||
/*notify's input type*/
|
||||
#define NOTIFY_CURRENT 0
|
||||
#define NOTIFY_VOLT 1
|
||||
#define NOTIFY_IMPEDANCE 2
|
||||
#define NOTIFY_VOLT_BAT 3
|
||||
|
||||
#define NOT_BUF_OFFSET_INIT 8
|
||||
|
||||
@@ -17,18 +21,14 @@
|
||||
* the index where to start insert data into buffer.
|
||||
* start from 6.
|
||||
*/
|
||||
static size_t not_buf_offset = NOT_BUF_OFFSET_INIT;
|
||||
|
||||
static size_t not_buf_offset = NOT_BUF_OFFSET_INIT;
|
||||
static uint32_t not_time_stamp;
|
||||
|
||||
static uint8_t NotifyCurrent[4] = {0};
|
||||
static uint8_t NotifyVolt[4] = {0};
|
||||
static uint8_t NotifyImpedance[4] = {0};
|
||||
|
||||
/**
|
||||
* counter of notify send.
|
||||
*/
|
||||
static uint32_t notify_counter = 0;
|
||||
static uint8_t NotifyCurrent[4] = {0};
|
||||
static uint8_t NotifyVolt[4] = {0};
|
||||
static uint8_t NotifyImpedance[4] = {0};
|
||||
static uint8_t NotifyVoltBat[4] = {0};
|
||||
static uint16_t NotifyCycleNumber = 0;
|
||||
|
||||
// ****************** New Notify Format ******************************** //
|
||||
/*
|
||||
@@ -81,12 +81,14 @@ static uint32_t notify_counter = 0;
|
||||
0xFF
|
||||
|
||||
* header = device ID
|
||||
* I = current (0.001nA), V = voltage (mV),
|
||||
* Z = impedance (k ohm), T = time (ms)
|
||||
* I = current (nA), V = voltage (uV),
|
||||
* Z = impedance (ohm), T = time (ms)
|
||||
*
|
||||
*
|
||||
*/
|
||||
static void SendNotify() {
|
||||
initDATBuf();
|
||||
|
||||
not_buf[0] = INSTRUCTION.chip_id;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
@@ -103,10 +105,84 @@ static void SendNotify() {
|
||||
not_buf[15] = (not_time_stamp >> 16) & 0xff;
|
||||
not_buf[16] = (not_time_stamp >> 24) & 0xff;
|
||||
|
||||
// cyclic voltametry cycle number
|
||||
not_buf[17] = INSTRUCTION.CycleNumber;
|
||||
not_buf[17] = (NotifyCycleNumber >> 8) & 0xff;
|
||||
not_buf[18] = NotifyCycleNumber & 0xff;
|
||||
|
||||
for (int i = 19; i < BLE_DAT_BUFF_SIZE; i++){
|
||||
not_buf[i] = 0;
|
||||
}
|
||||
|
||||
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
|
||||
}
|
||||
|
||||
static void initDATBuf(){
|
||||
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++){
|
||||
not_buf[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void initINSBuf(){
|
||||
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++){
|
||||
ins_buf[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void initCISBuf(){
|
||||
for (int i = 0; i < BLE_CIS_BUFF_SIZE; i++){
|
||||
cis_buf[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void initRawDataBuf(){
|
||||
not_time_stamp = 0;
|
||||
NotifyCycleNumber = 0;
|
||||
|
||||
for (int i = 0; i < 4; i++){
|
||||
NotifyCurrent[i] = 0;
|
||||
NotifyVolt[i] = 0;
|
||||
NotifyImpedance[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void FlushNotify(){
|
||||
initRawDataBuf();
|
||||
initDATBuf();
|
||||
|
||||
not_buf[0] = INSTRUCTION.chip_id;
|
||||
|
||||
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
|
||||
}
|
||||
|
||||
static void InputNotify(int NotifyType, int32_t Data){
|
||||
|
||||
switch (NotifyType) {
|
||||
case NOTIFY_CURRENT:
|
||||
NotifyCurrent[0] = (uint8_t)((Data & 0xFF000000) >> 24);
|
||||
NotifyCurrent[1] = (uint8_t)((Data & 0x00FF0000) >> 16);
|
||||
NotifyCurrent[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
|
||||
NotifyCurrent[3] = (uint8_t)(Data & 0x000000FF);
|
||||
break;
|
||||
|
||||
case NOTIFY_IMPEDANCE:
|
||||
NotifyImpedance[0] = (uint8_t)((Data & 0xFF000000) >> 24);
|
||||
NotifyImpedance[1] = (uint8_t)((Data & 0x00FF0000) >> 16);
|
||||
NotifyImpedance[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
|
||||
NotifyImpedance[3] = (uint8_t)(Data & 0x000000FF);
|
||||
break;
|
||||
|
||||
case NOTIFY_VOLT :
|
||||
NotifyVolt[0] = (uint8_t)((Data & 0xFF000000) >> 24);
|
||||
NotifyVolt[1] = (uint8_t)((Data & 0x00FF0000) >> 16);
|
||||
NotifyVolt[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
|
||||
NotifyVolt[3] = (uint8_t)(Data & 0x000000FF);
|
||||
break;
|
||||
|
||||
case NOTIFY_VOLT_BAT :
|
||||
NotifyVoltBat[0] = (uint8_t)((Data & 0xFF000000) >> 24);
|
||||
NotifyVoltBat[1] = (uint8_t)((Data & 0x00FF0000) >> 16);
|
||||
NotifyVoltBat[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
|
||||
NotifyVoltBat[3] = (uint8_t)(Data & 0x000000FF);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+345
@@ -0,0 +1,345 @@
|
||||
#ifndef ELITEPULSE
|
||||
#define ELITEPULSE
|
||||
|
||||
#define Vset INSTRUCTION.Vset
|
||||
|
||||
//static uint16_t CV3Curve(CV3Mode *CV3){
|
||||
// static uint16_t DACOutCode;
|
||||
// static int32_t Vin;
|
||||
// static int32_t Vout;
|
||||
// static int32_t DeltaVout;
|
||||
//
|
||||
// Vin = CV3->_measureVin * 200;//[5nV]
|
||||
// if(DACReset){
|
||||
// Vout = Vset + Vin;
|
||||
// DACReset = false;
|
||||
// }else{
|
||||
// DeltaVout = Vset - (Vout - Vin);
|
||||
// Vout = Vout + DeltaVout;
|
||||
// }
|
||||
//
|
||||
// INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
|
||||
// DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.DacVoutAgcLevel, INSTRUCTION.VoltConstant);
|
||||
//
|
||||
// int32_t RealV2;
|
||||
// RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
|
||||
// InputNotify(NOTIFY_VOLT, RealV2);
|
||||
//
|
||||
// int32_t RealV;
|
||||
// RealV = (int32_t)(Vout / 200);//[1uV]
|
||||
// InputNotify(NOTIFY_IMPEDANCE, RealV);
|
||||
//
|
||||
// DAC_outputV(DACOutCode);
|
||||
//
|
||||
// return DACOutCode;
|
||||
//}
|
||||
|
||||
//static void PULSE_Vscan(PULSEMode *PULSE){
|
||||
// static uint16_t lastVolt;
|
||||
// if (vscanReset) {
|
||||
// lastVolt = INSTRUCTION.VoltConstant;
|
||||
// if (PULSE->_tflag == 0) {
|
||||
// PULSE->_tflag = PULSE->_t2;
|
||||
// PULSE->_vflag = PULSE->_v2;
|
||||
// }
|
||||
// else {
|
||||
// PULSE->_tflag = PULSE->_t1;
|
||||
// PULSE->_vflag = PULSE->_v1;
|
||||
// }
|
||||
// INSTRUCTION.VoltConstant = PULSE->_vflag;
|
||||
// if(lastVolt != INSTRUCTION.VoltConstant){
|
||||
// lastVolt = INSTRUCTION.VoltConstant;
|
||||
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
// }
|
||||
// vscanReset = false;
|
||||
// }
|
||||
//
|
||||
// if (!vscanReset) {
|
||||
// //vscan counter
|
||||
// if (GPT.VscanRateCounter >= PULSE->_tflag) {
|
||||
// GPT.VscanRateCounter -= PULSE->_tflag; //To get right time
|
||||
// }
|
||||
//
|
||||
// if (PULSE->_loop > 0 && PULSE->_cycleNumber > 0) {
|
||||
// if (PULSE->_tflag == PULSE->_t1) {
|
||||
// PULSE->_tflag = PULSE->_t2;
|
||||
// PULSE->_vflag = PULSE->_v2;
|
||||
// }
|
||||
// else if (PULSE->_tflag == PULSE->_t2) {
|
||||
// PULSE->_tflag = PULSE->_t3;
|
||||
// PULSE->_vflag = PULSE->_v3;
|
||||
// }
|
||||
// else if (PULSE->_tflag == PULSE->_t3) {
|
||||
// PULSE->_cycleNumber -- ;
|
||||
// if (PULSE->_cycleNumber == 0) {
|
||||
// PULSE->_tflag = PULSE->_t4;
|
||||
// PULSE->_vflag = PULSE->_v4;
|
||||
// }
|
||||
// else {
|
||||
// PULSE->_tflag = PULSE->_t2;
|
||||
// PULSE->_vflag = PULSE->_v2;
|
||||
// }
|
||||
// }
|
||||
// INSTRUCTION.VoltConstant = PULSE->_vflag;
|
||||
// if(lastVolt != INSTRUCTION.VoltConstant){
|
||||
// lastVolt = INSTRUCTION.VoltConstant;
|
||||
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
// }
|
||||
// }
|
||||
// else if (PULSE->_loop > 0 && PULSE->_cycleNumber <= 0) {
|
||||
// if (PULSE->_tflag == PULSE->_t1) {
|
||||
// PULSE->_tflag = PULSE->_t4;
|
||||
// PULSE->_vflag = PULSE->_v4;
|
||||
// }
|
||||
// else if (PULSE->_tflag == PULSE->_t4) {
|
||||
// PULSE->_loop -- ;
|
||||
// if (PULSE->_loop > 0) {
|
||||
// PULSE->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
// PULSE->_tflag = PULSE->_t2;
|
||||
// PULSE->_vflag = PULSE->_v2;
|
||||
// }
|
||||
// else {
|
||||
// PULSE->_tflag = PULSE->_t5;
|
||||
// PULSE->_vflag = PULSE->_v5;
|
||||
// }
|
||||
// }
|
||||
// INSTRUCTION.VoltConstant = PULSE->_vflag;
|
||||
// if(lastVolt != INSTRUCTION.VoltConstant){
|
||||
// lastVolt = INSTRUCTION.VoltConstant;
|
||||
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
// }
|
||||
// }
|
||||
// else if (PULSE->_loop <= 0) {
|
||||
// if (PULSE->_tflag == PULSE->_t5) {
|
||||
// PeriodicEvent = false;
|
||||
// ELITE15_SPI_CLOSE();
|
||||
// ModeLED(NO_EVENT);
|
||||
// }
|
||||
// }
|
||||
// InputNotify(NOTIFY_IMPEDANCE, PULSE->_vflag);
|
||||
// }
|
||||
//// int32_t RealV;
|
||||
//// RealV = (int32_t)(Vset / 500);//[1uV]
|
||||
//// InputNotify(NOTIFY_VOLT, RealV);
|
||||
//}
|
||||
|
||||
static void PULSE_Vscan(PULSEMode *PULSE)
|
||||
{
|
||||
static uint16_t lastVolt;
|
||||
|
||||
if (vscanReset) {
|
||||
if (PULSE->_tflag == 0) {
|
||||
PULSE->_tflag = PULSE->_t2;
|
||||
PULSE->_vflag = PULSE->_v2;
|
||||
}
|
||||
else {
|
||||
PULSE->_tflag = PULSE->_t1;
|
||||
PULSE->_vflag = PULSE->_v1;
|
||||
}
|
||||
|
||||
lastVolt = INSTRUCTION.VoltConstant;
|
||||
INSTRUCTION.VoltConstant = PULSE->_vflag;
|
||||
|
||||
if (lastVolt != INSTRUCTION.VoltConstant) {
|
||||
lastVolt = INSTRUCTION.VoltConstant;
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
}
|
||||
|
||||
vscanReset = false;
|
||||
}
|
||||
|
||||
if (!vscanReset) {
|
||||
if (GPT.VscanRateCounter >= PULSE->_tflag) {
|
||||
GPT.VscanRateCounter -= PULSE->_tflag; //To get right time
|
||||
}
|
||||
|
||||
if (PULSE->_loop > 0 && PULSE->_cycleNumber > 0) {
|
||||
if (PULSE->_tflag == PULSE->_t1) {
|
||||
PULSE->_tflag = PULSE->_t2;
|
||||
PULSE->_vflag = PULSE->_v2;
|
||||
}
|
||||
else if (PULSE->_tflag == PULSE->_t2) {
|
||||
PULSE->_tflag = PULSE->_t3;
|
||||
PULSE->_vflag = PULSE->_v3;
|
||||
}
|
||||
else if (PULSE->_tflag == PULSE->_t3) {
|
||||
PULSE->_cycleNumber -- ;
|
||||
if (PULSE->_cycleNumber == 0) {
|
||||
PULSE->_tflag = PULSE->_t4;
|
||||
PULSE->_vflag = PULSE->_v4;
|
||||
}
|
||||
else {
|
||||
PULSE->_tflag = PULSE->_t2;
|
||||
PULSE->_vflag = PULSE->_v2;
|
||||
}
|
||||
}
|
||||
|
||||
INSTRUCTION.VoltConstant = PULSE->_vflag;
|
||||
if (lastVolt != INSTRUCTION.VoltConstant) {
|
||||
lastVolt = INSTRUCTION.VoltConstant;
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
}
|
||||
}
|
||||
else if (PULSE->_loop > 0 && PULSE->_cycleNumber <= 0) {
|
||||
if (PULSE->_tflag == PULSE->_t1) {
|
||||
PULSE->_tflag = PULSE->_t4;
|
||||
PULSE->_vflag = PULSE->_v4;
|
||||
}
|
||||
else if (PULSE->_tflag == PULSE->_t4) {
|
||||
PULSE->_loop -- ;
|
||||
if (PULSE->_loop > 0) {
|
||||
PULSE->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
PULSE->_tflag = PULSE->_t2;
|
||||
PULSE->_vflag = PULSE->_v2;
|
||||
}
|
||||
else {
|
||||
PULSE->_tflag = PULSE->_t5;
|
||||
PULSE->_vflag = PULSE->_v5;
|
||||
}
|
||||
}
|
||||
|
||||
INSTRUCTION.VoltConstant = PULSE->_vflag;
|
||||
if (lastVolt != INSTRUCTION.VoltConstant) {
|
||||
lastVolt = INSTRUCTION.VoltConstant;
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
}
|
||||
}
|
||||
else if (PULSE->_loop <= 0) {
|
||||
if (PULSE->_tflag == PULSE->_t5) {
|
||||
PeriodicEvent = false;
|
||||
ModeLED(NO_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
InputNotify(NOTIFY_IMPEDANCE, PULSE->_vflag);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_Vscan(PULSEMode *PULSE){
|
||||
static uint16_t lastVolt;
|
||||
static uint8_t testV;
|
||||
if(firstTimeReset){
|
||||
firstTimeReset = false;
|
||||
lastVolt = INSTRUCTION.VoltConstant;
|
||||
if (PULSE->_tTime == 0) {
|
||||
PULSE->_tflag = PULSE->_t2;
|
||||
PULSE->_vflag = PULSE->_v2;
|
||||
PULSE->_tTime = PULSE->_t2Time;
|
||||
testV = 1;
|
||||
}
|
||||
else {
|
||||
PULSE->_tflag = PULSE->_t1;
|
||||
PULSE->_vflag = PULSE->_v1;
|
||||
PULSE->_tTime = PULSE->_t1Time;
|
||||
testV = 2;
|
||||
}
|
||||
INSTRUCTION.VoltConstant = PULSE->_vflag;
|
||||
if(lastVolt != INSTRUCTION.VoltConstant){
|
||||
lastVolt = INSTRUCTION.VoltConstant;
|
||||
DAC_outputV(Usercode_Correction_to_DAC(VOUT_GAIN_240K, INSTRUCTION.VoltConstant));
|
||||
DAC_outputV(Usercode_Correction_to_DAC(VOUT_GAIN_240K, INSTRUCTION.VoltConstant));
|
||||
}
|
||||
//InputNotify(NOTIFY_IMPEDANCE, testV);
|
||||
}
|
||||
else if(!firstTimeReset){
|
||||
if(GPT.VscanRateCounter >= PULSE->_tTime){
|
||||
GPT.VscanRateCounter -= PULSE->_tTime; //To get right time
|
||||
|
||||
vscan_flag = true;
|
||||
if(vscan_flag){
|
||||
|
||||
if (PULSE->_loop > 0 && PULSE->_cycleNumber > 0) {
|
||||
if (PULSE->_tflag == PULSE->_t1) {
|
||||
PULSE->_tflag = PULSE->_t2;
|
||||
PULSE->_vflag = PULSE->_v2;
|
||||
PULSE->_tTime = PULSE->_t2Time;
|
||||
testV = 3;
|
||||
}
|
||||
else if (PULSE->_tflag == PULSE->_t2) {
|
||||
PULSE->_tflag = PULSE->_t3;
|
||||
PULSE->_vflag = PULSE->_v3;
|
||||
PULSE->_tTime = PULSE->_t3Time;
|
||||
testV = 4;
|
||||
}
|
||||
else if (PULSE->_tflag == PULSE->_t3) {
|
||||
PULSE->_cycleNumber -- ;
|
||||
if (PULSE->_cycleNumber == 0) {
|
||||
PULSE->_tflag = PULSE->_t4;
|
||||
PULSE->_vflag = PULSE->_v4;
|
||||
PULSE->_tTime = PULSE->_t4Time;
|
||||
if (PULSE->_t4Time == 0) {
|
||||
PULSE->_tflag = PULSE->_t2;
|
||||
PULSE->_vflag = PULSE->_v2;
|
||||
PULSE->_tTime = PULSE->_t2Time;
|
||||
PULSE->_loop--;
|
||||
PULSE->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
if (PULSE->_loop == 0) {
|
||||
PULSE->_tflag = PULSE->_t5;
|
||||
PULSE->_vflag = PULSE->_v5;
|
||||
PULSE->_tTime = PULSE->_t5Time;
|
||||
if (PULSE->_t5Time == 0) {
|
||||
PeriodicEvent = false;
|
||||
ModeLED(NO_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
testV = 5;
|
||||
}
|
||||
else {
|
||||
PULSE->_tflag = PULSE->_t2;
|
||||
PULSE->_vflag = PULSE->_v2;
|
||||
PULSE->_tTime = PULSE->_t2Time;
|
||||
testV = 6;
|
||||
}
|
||||
}
|
||||
INSTRUCTION.VoltConstant = PULSE->_vflag;
|
||||
if(lastVolt != INSTRUCTION.VoltConstant){
|
||||
lastVolt = INSTRUCTION.VoltConstant;
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
}
|
||||
}
|
||||
else if (PULSE->_loop > 0 && PULSE->_cycleNumber <= 0) {
|
||||
if (PULSE->_tflag == PULSE->_t4) {
|
||||
PULSE->_loop -- ;
|
||||
if (PULSE->_loop > 0) {
|
||||
PULSE->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
PULSE->_tflag = PULSE->_t2;
|
||||
PULSE->_vflag = PULSE->_v2;
|
||||
PULSE->_tTime = PULSE->_t2Time;
|
||||
testV = 8;
|
||||
}
|
||||
else {
|
||||
PULSE->_tflag = PULSE->_t5;
|
||||
PULSE->_vflag = PULSE->_v5;
|
||||
PULSE->_tTime = PULSE->_t5Time;
|
||||
testV = 9;
|
||||
}
|
||||
}
|
||||
INSTRUCTION.VoltConstant = PULSE->_vflag;
|
||||
if(lastVolt != INSTRUCTION.VoltConstant){
|
||||
lastVolt = INSTRUCTION.VoltConstant;
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
|
||||
}
|
||||
}
|
||||
else if (PULSE->_loop <= 0) {
|
||||
if (PULSE->_tflag == PULSE->_t5) {
|
||||
testV = 10;
|
||||
PeriodicEvent = false;
|
||||
ModeLED(NO_EVENT);
|
||||
}
|
||||
}
|
||||
//InputNotify(NOTIFY_IMPEDANCE, testV);
|
||||
vscan_flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
+27
-81
@@ -3,27 +3,23 @@
|
||||
#define ELITERESET
|
||||
|
||||
static void reset() {
|
||||
PeriodicEvent = false;
|
||||
DACReset = true;
|
||||
CCModeReset = 1;
|
||||
InitEliteInstruction();
|
||||
SampleRate_counter = 1;
|
||||
StepTimeCounter = 1;
|
||||
DiscardIVFirstData = 1;
|
||||
avg_number = 0;
|
||||
ADCRealCurrent_long = 0;
|
||||
ADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
|
||||
ModeLED(NO_EVENT);
|
||||
InitEliteFlag();
|
||||
InitFlag();
|
||||
InitCT();
|
||||
InitGPT();
|
||||
|
||||
if (INSTRUCTION.eliteFxn == CONSTANT_CURRENT){
|
||||
INSTRUCTION.eliteFxn = 0;
|
||||
PIN15_setOutputValue(HIGH_Z_MODE, 1); // 0 => open high_z mode
|
||||
|
||||
}
|
||||
VinADCGainControl(VIN_GAIN_AUTO);
|
||||
IinADCGainControl(I_GAIN_AUTO);
|
||||
|
||||
LEDPowerON();
|
||||
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++) {
|
||||
ins_buf[i] = 0;
|
||||
}
|
||||
INSTRUCTION.VoutGainLevel = VOUT_GAIN_15K;
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, 25000));
|
||||
|
||||
initINSBuf();
|
||||
initDATBuf();
|
||||
|
||||
for (int i = 0; i < SPI_LED_SIZE; i++) {
|
||||
spi_LEDtxbuf[i] = 0;
|
||||
@@ -40,32 +36,24 @@ static void reset() {
|
||||
spi_ADC_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++) {
|
||||
not_buf[i] = 0;
|
||||
}
|
||||
|
||||
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
|
||||
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
|
||||
CPUdelay(1600);
|
||||
}
|
||||
|
||||
static void Eliteinterrupt() {
|
||||
PeriodicEvent = false;
|
||||
DACReset = true;
|
||||
CCModeReset = 1;
|
||||
InitEliteInstruction();
|
||||
StepTimeCounter = 1;
|
||||
SampleRate_counter = 1;
|
||||
DiscardIVFirstData = 1;
|
||||
avg_number = 0;
|
||||
ADCRealCurrent_long = 0;
|
||||
ADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
|
||||
ModeLED(NO_EVENT);
|
||||
InitFlag();
|
||||
InitEliteFlag();
|
||||
InitCT();
|
||||
InitGPT();
|
||||
|
||||
LEDPowerON();
|
||||
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++) {
|
||||
ins_buf[i] = 0;
|
||||
}
|
||||
PIN15_setOutputValue(HIGH_Z_MODE, 1); // 0 => open high_z mode
|
||||
|
||||
INSTRUCTION.VoutGainLevel = VOUT_GAIN_15K;
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, 25000));
|
||||
|
||||
initINSBuf();
|
||||
initDATBuf();
|
||||
|
||||
for (int i = 0; i < SPI_LED_SIZE; i++) {
|
||||
spi_LEDtxbuf[i] = 0;
|
||||
@@ -82,48 +70,6 @@ static void Eliteinterrupt() {
|
||||
spi_ADC_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++) {
|
||||
not_buf[i] = 0;
|
||||
}
|
||||
|
||||
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
|
||||
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
|
||||
CPUdelay(8000);
|
||||
}
|
||||
|
||||
static void CleanBuffer() {
|
||||
PeriodicEvent = false;
|
||||
DACReset = true;
|
||||
CCModeReset = 1;
|
||||
// InitEliteInstruction();
|
||||
SampleRate_counter = 1;
|
||||
StepTimeCounter = 1;
|
||||
DiscardIVFirstData = 1;
|
||||
avg_number = 0;
|
||||
ADCRealCurrent_long = 0;
|
||||
|
||||
for (int i = 0; i < SPI_LED_SIZE; i++) {
|
||||
spi_LEDtxbuf[i] = 0;
|
||||
spi_LEDrxbuf[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < SPI_DAC_SIZE; i++) {
|
||||
spi_DACtxbuf[i] = 0;
|
||||
spi_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < SPI_ADC_SIZE; i++) {
|
||||
spi_ADC_txbuf[i] = 0;
|
||||
spi_ADC_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++) {
|
||||
not_buf[i] = 0;
|
||||
}
|
||||
|
||||
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
|
||||
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
|
||||
CPUdelay(8000);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+54
-10
@@ -36,6 +36,8 @@ static SPI_Params spiParams1;
|
||||
static SPI_Transaction LED_transaction;
|
||||
static SPI_Transaction ADC_DAC_transaction;
|
||||
|
||||
static void ELITE15_SPI_HOLD();
|
||||
static void ELITE15_SPI_CLOSE();
|
||||
|
||||
static void Elite_SPI_init(){
|
||||
SPI_init();
|
||||
@@ -63,26 +65,68 @@ static void LED_SPI(uint8_t length, uint16_t *spi_txbuf, uint16_t *spi_rxbuf) {
|
||||
}
|
||||
|
||||
static void ADC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
|
||||
// PIN15_setOutputValue(ADC_CS, 0); // ADC_CS LOW
|
||||
PIN_setOutputValue(pin_handle, LOAD0, 1);
|
||||
PIN_setOutputValue(pin_handle, D6, 0); // ADC_CS LOW
|
||||
|
||||
ADC_DAC_transaction.count = length;
|
||||
ADC_DAC_transaction.txBuf = spi_txbuf;
|
||||
ADC_DAC_transaction.rxBuf = spi_rxbuf;
|
||||
|
||||
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
|
||||
PIN_setOutputValue(pin_handle, ADC_CS, 0); // ADC_CS LOW
|
||||
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
|
||||
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
|
||||
|
||||
PIN_setOutputValue(pin_handle, D6, 1); // ADC_CS HOGH
|
||||
update_latch_status (ADC_CS, 1);
|
||||
// PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
|
||||
}
|
||||
|
||||
static void DAC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
|
||||
ADC_DAC_transaction.count = length;
|
||||
ADC_DAC_transaction.txBuf = spi_txbuf;
|
||||
ADC_DAC_transaction.rxBuf = spi_rxbuf;
|
||||
// PIN15_setOutputValue(DAC_CS, 0); // DAC_CS LOW
|
||||
PIN_setOutputValue(pin_handle, LOAD0, 1);
|
||||
PIN_setOutputValue(pin_handle, D7, 0); // DAC_CS LOW
|
||||
|
||||
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
|
||||
PIN_setOutputValue(pin_handle, DAC_CS, 0); // DAC_CS LOW
|
||||
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
|
||||
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
|
||||
ADC_DAC_transaction.count = length;
|
||||
ADC_DAC_transaction.txBuf = spi_txbuf;
|
||||
ADC_DAC_transaction.rxBuf = spi_rxbuf;
|
||||
|
||||
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
|
||||
|
||||
PIN_setOutputValue(pin_handle, D7, 1); // DAC_CS HOGH
|
||||
update_latch_status (DAC_CS, 1);
|
||||
// PIN15_setOutputValue(DAC_CS, 1); // DAC_CS HIGH
|
||||
}
|
||||
|
||||
static void ELITE15_SPI_HOLD() {
|
||||
Elite_SPI_init();
|
||||
|
||||
PIN_setOutputValue(pin_handle, LOAD0, 1);
|
||||
PIN_setOutputValue(pin_handle, LOAD1, 0);
|
||||
PIN_setOutputValue(pin_handle, LOAD2, 0);
|
||||
}
|
||||
static void ELITE15_SPI_CLOSE() {
|
||||
PIN_setOutputValue(pin_handle, LOAD0, 0);
|
||||
PIN_setOutputValue(pin_handle, LOAD1, 0);
|
||||
PIN_setOutputValue(pin_handle, LOAD2, 0);
|
||||
|
||||
SPI_close(spiHandle0);
|
||||
SPI_close(spiHandle1);
|
||||
}
|
||||
|
||||
/* Elite1.5 Calibration SPI */
|
||||
static void CAL_ADC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
|
||||
// PIN15_setOutputValue(ADC_CS, 0); // ADC_CS LOW
|
||||
PIN_setOutputValue(pin_handle, LOAD0, 1);
|
||||
PIN_setOutputValue(pin_handle, D6, 0); // ADC_CS LOW
|
||||
|
||||
ADC_DAC_transaction.count = length;
|
||||
ADC_DAC_transaction.txBuf = spi_txbuf;
|
||||
ADC_DAC_transaction.rxBuf = spi_rxbuf;
|
||||
|
||||
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
|
||||
|
||||
PIN_setOutputValue(pin_handle, D6, 1); // ADC_CS HOGH
|
||||
update_latch_status (ADC_CS, 1);
|
||||
// PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
|
||||
}
|
||||
|
||||
#endif // ELITE_SPI
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
|
||||
#ifndef ELITEVT
|
||||
#define ELITEVT
|
||||
|
||||
static void VT_Plot() {
|
||||
// ADC gain is don't care when measuring voltage
|
||||
uint8_t ADCGain = 0;
|
||||
|
||||
// read ADC volt
|
||||
ADCChannelSelect(ADC_CH_VOLT);
|
||||
CPUdelay(10);
|
||||
ADC_read(spi_ADC_rxbuf);
|
||||
|
||||
// decode ADC value and put it into notify buffer
|
||||
DecodeADCValue(ADCGain, ADC_CH_VOLT, spi_ADC_rxbuf);
|
||||
}
|
||||
|
||||
#endif
|
||||
+625
@@ -0,0 +1,625 @@
|
||||
#ifndef ELITE_WORK_DATA
|
||||
#define ELITE_WORK_DATA
|
||||
|
||||
#define CLOCK_ONE_SECOND 10000
|
||||
|
||||
#include "EliteInstruction.h"
|
||||
|
||||
static bool Free_Work_Mode = false;
|
||||
typedef void (*InitWorkData) ();
|
||||
|
||||
/***** Template of Measure and VoltOut parameter *****/
|
||||
#define MEASURE \
|
||||
int32_t _measureCurrent; \
|
||||
int32_t _measureVin; \
|
||||
int32_t _measureVout; \
|
||||
int32_t _measureBat; \
|
||||
uint8_t _VoViSwitch
|
||||
|
||||
#define VOUT_PARA \
|
||||
int32_t _Vinit; \
|
||||
int32_t _Vmax; \
|
||||
int32_t _Vmin; \
|
||||
int32_t _Vset; \
|
||||
uint32_t _Vstep; \
|
||||
bool _direction_up; \
|
||||
bool _current_direction_up; \
|
||||
uint16_t _cycleNumber
|
||||
|
||||
// direction_up = true, if directionInit=1
|
||||
// current_direction_up = true, Vstep => positive. vice versa
|
||||
|
||||
/* CC Mode parameter
|
||||
* @ Measure : measure current value (nA)
|
||||
* @ Charge : Charge or Discharge
|
||||
* @ BatteryV : Vin measure battery voltage (mV)
|
||||
* @ value : constant current setting.
|
||||
* Current value divide current level into 3,000,001 pieces
|
||||
* 1,500,000 is zero point; 3,000,000 is 15mA
|
||||
* Current = (value - 1,500,000)/100,000 mA
|
||||
* @ Done : Done = false => Ignore Vmin condition;
|
||||
* Done will be true, if BatteryV <= Vmin last for about 12sec in discharge mode
|
||||
* @ VMax : voltage upper bound in charge mode
|
||||
* CC->value will set to zero if BatteryV >= VMax in charge mode
|
||||
* @ VMin : voltage lower bound in charge mode
|
||||
* CC->value will set to zero if BatteryV <=> VMin in charge mode
|
||||
* Note that VMax and VMin are always larger or equal to zero
|
||||
* @_Transform2RealnA : transform a current user code (IUC) to real current in nA
|
||||
*/
|
||||
#define CC_PARA \
|
||||
int32_t _measureCurrent; \
|
||||
uint8_t _VoViSwitch; \
|
||||
uint8_t Charge; \
|
||||
int32_t BatteryV; \
|
||||
int32_t value; \
|
||||
uint16_t Done; \
|
||||
uint32_t VMax; \
|
||||
uint16_t VMin; \
|
||||
int32_t _measureVin; \
|
||||
int32_t Vset; \
|
||||
int32_t Iset; \
|
||||
int32_t (*_Transform2RealnA)(struct CCModePara *)
|
||||
|
||||
#define LIMIT \
|
||||
uint32_t _LimitValue; \
|
||||
void (*SetLimitValue) (struct Limit *, uint32_t); \
|
||||
uint32_t (*GetLimitValue) (struct Limit*)
|
||||
|
||||
struct Measure{
|
||||
MEASURE;
|
||||
};
|
||||
|
||||
struct VoltOutPara{
|
||||
VOUT_PARA;
|
||||
};
|
||||
|
||||
struct Limit{
|
||||
LIMIT;
|
||||
};
|
||||
|
||||
struct CCModePara{
|
||||
CC_PARA;
|
||||
};
|
||||
/***** End of Measure and VoltOut parameter *****/
|
||||
|
||||
/**** Limit Mode ****/
|
||||
//LimitValue
|
||||
void _SetLimitValue(struct Limit *self, uint32_t LimitValue){
|
||||
self->_LimitValue = LimitValue;
|
||||
}
|
||||
uint32_t _GetLimitValue(struct Limit *self){
|
||||
return self->_LimitValue;
|
||||
}
|
||||
|
||||
|
||||
/* VoltOut Mode Data */
|
||||
typedef struct _VoltOutMode{
|
||||
uint16_t _Vset;
|
||||
}VoltOutMode;
|
||||
|
||||
VoltOutMode *InitVoltOutMode(){
|
||||
VoltOutMode *ret = malloc(sizeof(VoltOutMode));
|
||||
ret->_Vset = INSTRUCTION.VoltConstant;
|
||||
return ret;
|
||||
}
|
||||
/* End of VoltOut Mode Data */
|
||||
|
||||
/* IT Mode Data */
|
||||
typedef struct _ITMode{
|
||||
MEASURE;
|
||||
}ITMode;
|
||||
|
||||
ITMode * InitITMode(){
|
||||
ITMode *ret = malloc(sizeof(ITMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
return ret;
|
||||
}
|
||||
/* End of IT Mode Data */
|
||||
|
||||
/* VT Mode Data */
|
||||
typedef struct _VTMode{
|
||||
MEASURE;
|
||||
}VTMode;
|
||||
|
||||
VTMode * InitVTMode(){
|
||||
VTMode *ret = malloc(sizeof(VTMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
return ret;
|
||||
}
|
||||
/* End of VT Mode Data */
|
||||
|
||||
/* RT Mode Data */
|
||||
typedef struct _RTMode{
|
||||
MEASURE;
|
||||
int32_t _Vset;
|
||||
}RTMode;
|
||||
|
||||
RTMode * InitRTMode(){
|
||||
RTMode *ret = malloc(sizeof(RTMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
ret->_Vset = INSTRUCTION.VoltConstant;
|
||||
return ret;
|
||||
}
|
||||
/* End of RT Mode Data */
|
||||
|
||||
/* IV Mode Data */
|
||||
typedef struct _IVMode{
|
||||
MEASURE;
|
||||
VOUT_PARA;
|
||||
}IVMode;
|
||||
|
||||
IVMode *InitIVMode(){
|
||||
IVMode *ret = malloc(sizeof(IVMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vset = 0;
|
||||
ret->_Vstep = 0;
|
||||
ret->_direction_up = true;
|
||||
ret->_current_direction_up = true;
|
||||
ret->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
return ret;
|
||||
}
|
||||
/* End of IV Mode Data */
|
||||
|
||||
/* CV Mode(CYCLE_IV)*/
|
||||
typedef struct _CVMode{
|
||||
MEASURE;
|
||||
VOUT_PARA;
|
||||
}CVMode;
|
||||
|
||||
CVMode * InitCVMode(){
|
||||
CVMode *ret = malloc(sizeof(CVMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vset = 0;
|
||||
ret->_Vstep = 0;
|
||||
ret->_direction_up = true;
|
||||
ret->_current_direction_up = true;
|
||||
ret->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
return ret;
|
||||
}
|
||||
/*End of CV Mode*/
|
||||
|
||||
/* CC Mode(CONSTANT_CURRENT)*/
|
||||
#define CC_ZERO_POINT 0
|
||||
#define MAX_DAC_UC 50000
|
||||
#define MIN_DAC_UC 0
|
||||
/*********************************************************************
|
||||
* @fn Transform2RealnA
|
||||
*
|
||||
* @brief transform an IUC into real current value in nA.
|
||||
*
|
||||
* @param self, which is an IUC
|
||||
*
|
||||
* @return an int32_t current value in nA
|
||||
*/
|
||||
int32_t _Transform2RealnA(struct CCModePara *self){
|
||||
int32_t IUCReal;
|
||||
|
||||
// self->value : 0 ~ 1500000 (which is 0 ~ 1500000 (10nA) )
|
||||
if(self->Charge){
|
||||
IUCReal = (self->value - CC_ZERO_POINT) * 10;
|
||||
}
|
||||
else{
|
||||
IUCReal = -1 * (self->value - CC_ZERO_POINT) * 10;
|
||||
}
|
||||
return IUCReal;
|
||||
}
|
||||
|
||||
typedef struct _CCMode{
|
||||
MEASURE;
|
||||
int32_t _Vmax;
|
||||
int32_t _Vmin;
|
||||
int32_t _Vset;
|
||||
int32_t _Iset;
|
||||
uint8_t _charge;
|
||||
int32_t (*_Transform2RealnA)(struct CCModePara *);
|
||||
}CCMode;
|
||||
|
||||
CCMode * InitCCMode(){
|
||||
CCMode *ret = malloc(sizeof(CCMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vset = 0;
|
||||
ret->_Iset = INSTRUCTION.constantCurrent * 200 ; //[50pA] //controller UI 15000uA => Elite 1500000 => 1500000 * 10 * 1000 / 50 [50pA]
|
||||
ret->_charge = INSTRUCTION.charge;
|
||||
ret->_Transform2RealnA = &_Transform2RealnA;
|
||||
return ret;
|
||||
}
|
||||
/*End of CC Mode*/
|
||||
|
||||
/* CV3 Mode(CYCLIC_VOLTAMMETRY)*/
|
||||
typedef struct _CV3Mode{
|
||||
MEASURE;
|
||||
VOUT_PARA;
|
||||
}CV3Mode;
|
||||
|
||||
CV3Mode * InitCV3Mode(){
|
||||
CV3Mode *ret = malloc(sizeof(CV3Mode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vset = 0;
|
||||
ret->_Vstep = 0;
|
||||
ret->_direction_up = true;
|
||||
ret->_current_direction_up = true;
|
||||
ret->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
return ret;
|
||||
}
|
||||
/*End of CV3 Mode*/
|
||||
|
||||
/* LSV Mode(LINEAR_SWEEP_VOLTAMMETRY)*/
|
||||
typedef struct _LSVMode{
|
||||
MEASURE;
|
||||
VOUT_PARA;
|
||||
}LSVMode;
|
||||
|
||||
LSVMode * InitLSVMode(){
|
||||
LSVMode *ret = malloc(sizeof(LSVMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vset = 0;
|
||||
ret->_Vstep = 0;
|
||||
ret->_direction_up = true;
|
||||
ret->_current_direction_up = true;
|
||||
ret->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
return ret;
|
||||
}
|
||||
/*End of LSV Mode*/
|
||||
|
||||
/* CONSTANT_VSCAN Mode(CONSTANT_VSCAN)*/
|
||||
typedef struct _CVSCANMode{
|
||||
MEASURE;
|
||||
int32_t _Vinit;
|
||||
int32_t _Vset;
|
||||
}CVSCANMode;
|
||||
|
||||
CVSCANMode * InitCVSCANMode(){
|
||||
CVSCANMode *ret = malloc(sizeof(CVSCANMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vset = 0;
|
||||
return ret;
|
||||
}
|
||||
/*End of CONSTANT_VSCAN Mode*/
|
||||
|
||||
/* PULSE_MODE Mode(PULSE_MODE)*/
|
||||
typedef struct _PULSEMode{
|
||||
MEASURE;
|
||||
// int32_t _Vinit;
|
||||
int32_t _Vset;
|
||||
int32_t _t1;
|
||||
int32_t _t2;
|
||||
int32_t _t3;
|
||||
int32_t _t4;
|
||||
int32_t _t5;
|
||||
int32_t _v1;
|
||||
int32_t _v2;
|
||||
int32_t _v3;
|
||||
int32_t _v4;
|
||||
int32_t _v5;
|
||||
int32_t _tflag;
|
||||
int32_t _vflag;
|
||||
uint16_t _cycleNumber;
|
||||
uint16_t _loop;
|
||||
int32_t _t1Time;
|
||||
int32_t _t2Time;
|
||||
int32_t _t3Time;
|
||||
int32_t _t4Time;
|
||||
int32_t _t5Time;
|
||||
int32_t _tTime;
|
||||
}PULSEMode;
|
||||
|
||||
PULSEMode * InitPULSEMode(){
|
||||
PULSEMode *ret = malloc(sizeof(PULSEMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->_measureVin = 0;
|
||||
ret->_measureVout = 0;
|
||||
ret->_measureBat = 0;
|
||||
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
|
||||
// ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
|
||||
ret->_Vset = 0;
|
||||
ret->_t1 = INSTRUCTION.t1;
|
||||
ret->_t2 = INSTRUCTION.t2;
|
||||
ret->_t3 = INSTRUCTION.t3;
|
||||
ret->_t4 = INSTRUCTION.t4;
|
||||
ret->_t5 = INSTRUCTION.t5;
|
||||
ret->_v1 = INSTRUCTION.v1;
|
||||
ret->_v2 = INSTRUCTION.v2;
|
||||
ret->_v3 = INSTRUCTION.v3;
|
||||
ret->_v4 = INSTRUCTION.v4;
|
||||
ret->_v5 = INSTRUCTION.v5;
|
||||
ret->_t1Time = INSTRUCTION.t1Time;
|
||||
ret->_t2Time = INSTRUCTION.t2Time;
|
||||
ret->_t3Time = INSTRUCTION.t3Time;
|
||||
ret->_t4Time = INSTRUCTION.t4Time;
|
||||
ret->_t5Time = INSTRUCTION.t5Time;
|
||||
ret->_tTime = INSTRUCTION.t1Time;
|
||||
ret->_tflag = 1;
|
||||
ret->_vflag = INSTRUCTION.v1;
|
||||
ret->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
ret->_loop = INSTRUCTION.loop;
|
||||
return ret;
|
||||
}
|
||||
/*End of PULSE_MODE Mode*/
|
||||
|
||||
/* Cycle CC Mode */
|
||||
typedef struct _CCCMode{
|
||||
int32_t _measureCurrent;
|
||||
uint8_t _VoViSwitch;
|
||||
uint8_t Charge;
|
||||
int32_t BatteryV;
|
||||
int32_t value;
|
||||
uint16_t Done;
|
||||
uint32_t VMax;
|
||||
uint32_t VMin;
|
||||
int32_t _measureVin;
|
||||
int32_t Vset;
|
||||
int32_t Iset;
|
||||
int32_t (*_Transform2RealnA)(struct CCModePara *);
|
||||
|
||||
/* Vmax and Vmin */
|
||||
// Vmax protect battery charge
|
||||
// Vmin protect battery discharge, uint = mV
|
||||
|
||||
/* Charge/Discharge Current */
|
||||
int32_t ChargeCurrent;
|
||||
int32_t DischargeCurrent;
|
||||
uint8_t CycleNumber;
|
||||
|
||||
bool StandBy;
|
||||
uint32_t StandByTime;
|
||||
}CCCMode;
|
||||
|
||||
CCCMode * InitCCCMode(){
|
||||
CCCMode *ret = malloc(sizeof(CCCMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->Charge = 1;
|
||||
ret->BatteryV = 0;
|
||||
|
||||
ret->value = CC_ZERO_POINT;
|
||||
ret->VMax = MAX_DAC_UC; // max DAC UserCode
|
||||
ret->VMin = MIN_DAC_UC; // min DAC UserCode
|
||||
ret->ChargeCurrent = 0;
|
||||
ret->DischargeCurrent = 0;
|
||||
ret->CycleNumber = 0;
|
||||
ret->StandBy = false;
|
||||
ret->StandByTime = 0;
|
||||
ret->_Transform2RealnA = &_Transform2RealnA;
|
||||
return ret;
|
||||
}
|
||||
/* End of Cycle CC Mode */
|
||||
|
||||
/** Potential State Mode **/
|
||||
typedef struct _PS{
|
||||
// measure
|
||||
int32_t _measureCurrent;
|
||||
uint8_t _VoViSwitch;
|
||||
int32_t ReferenceVolt;
|
||||
int32_t _MeasureVolt;
|
||||
uint16_t _VoltOut;
|
||||
uint16_t _originVolt;
|
||||
uint16_t _stopVolt;
|
||||
uint16_t _step;
|
||||
uint16_t _StepTime;
|
||||
uint16_t _cycleNumber;
|
||||
}PSMode;
|
||||
|
||||
PSMode *InitPSMode(){
|
||||
PSMode *ret = malloc(sizeof(PSMode));
|
||||
ret->_measureCurrent = 0;
|
||||
ret->ReferenceVolt = 0;
|
||||
ret->_MeasureVolt = INSTRUCTION.Ve1;
|
||||
|
||||
ret->_VoltOut = DAC_ZERO; // 25000 is DAC_ZERO
|
||||
ret->_originVolt = INSTRUCTION.Ve1;
|
||||
ret->_stopVolt = INSTRUCTION.Ve2;
|
||||
ret->_step = INSTRUCTION.step;
|
||||
ret->_StepTime = INSTRUCTION.StepTime; // STEPTIME_ONE_SEC
|
||||
ret->_cycleNumber = INSTRUCTION.cycleNumber;
|
||||
return ret;
|
||||
}
|
||||
/** End of Potential State Mode **/
|
||||
|
||||
typedef union _WorkMode{
|
||||
|
||||
// Output Only
|
||||
VoltOutMode *VO;
|
||||
|
||||
// Measure only
|
||||
ITMode *IT;
|
||||
VTMode *VT;
|
||||
|
||||
// Measure + Output
|
||||
RTMode *RT;
|
||||
IVMode *IV;
|
||||
CVMode *CV;
|
||||
CCMode *CC;
|
||||
CV3Mode *CV3;
|
||||
LSVMode *LSV;
|
||||
CVSCANMode *CVSCAN;
|
||||
PSMode *PS;
|
||||
PULSEMode *PULSE;
|
||||
// CCCMode *CCC;
|
||||
}WorkMode;
|
||||
|
||||
WorkMode *CreateWorkMode(){
|
||||
WorkMode *ret = malloc(sizeof(WorkMode));
|
||||
return ret;
|
||||
}
|
||||
|
||||
void InitWorkMode(WorkMode *WM){
|
||||
switch(INSTRUCTION.eliteFxn){
|
||||
case VOLT_OUTPUT:
|
||||
case CALI_DAC_MODE:
|
||||
WM->VO = InitVoltOutMode();
|
||||
break;
|
||||
case IT_CURVE:
|
||||
WM->IT = InitITMode();
|
||||
break;
|
||||
case VT_CURVE:
|
||||
WM->VT = InitVTMode();
|
||||
break;
|
||||
case ZT_CURVE:
|
||||
WM->RT = InitRTMode();
|
||||
break;
|
||||
case IV_CURVE:
|
||||
WM->IV = InitIVMode();
|
||||
break;
|
||||
case CV_CURVE:
|
||||
WM->CV = InitCVMode();
|
||||
break;
|
||||
case CONSTANT_CURRENT:
|
||||
WM->CC = InitCCMode();
|
||||
break;
|
||||
case CYCLIC_VOLTAMMETRY:
|
||||
WM->CV3 = InitCV3Mode();
|
||||
break;
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:
|
||||
WM->LSV = InitLSVMode();
|
||||
break;
|
||||
case CONSTANT_VSCAN:
|
||||
WM->CVSCAN = InitCVSCANMode();
|
||||
break;
|
||||
case PULSE_MODE:
|
||||
WM->PULSE = InitPULSEMode();
|
||||
break;
|
||||
// case CYCLE_CONSTANT_CURRENT:
|
||||
// WM->CCC = InitCCCMode();
|
||||
// break;
|
||||
default:
|
||||
WM->VT = InitVTMode();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void FreeWorkMode(WorkMode *WM){
|
||||
switch(INSTRUCTION.eliteFxn){
|
||||
case VOLT_OUTPUT:
|
||||
case CALI_DAC_MODE:
|
||||
if(WM->VO != NULL){
|
||||
free(WM->VO);
|
||||
WM->VO = NULL;
|
||||
}
|
||||
break;
|
||||
case IT_CURVE:
|
||||
if(WM->IT != NULL){
|
||||
free(WM->IT);
|
||||
WM->IT = NULL;
|
||||
}
|
||||
break;
|
||||
case VT_CURVE:
|
||||
if(WM->VT != NULL){
|
||||
free(WM->VT);
|
||||
WM->VT = NULL;
|
||||
}
|
||||
break;
|
||||
case ZT_CURVE:
|
||||
if(WM->RT != NULL){
|
||||
free(WM->RT);
|
||||
WM->RT = NULL;
|
||||
}
|
||||
break;
|
||||
case IV_CURVE:
|
||||
if(WM->IV != NULL){
|
||||
free(WM->IV);
|
||||
WM->IV = NULL;
|
||||
}
|
||||
break;
|
||||
case CV_CURVE:
|
||||
if(WM->CV != NULL){
|
||||
free(WM->CV);
|
||||
WM->CV = NULL;
|
||||
}
|
||||
break;
|
||||
case CONSTANT_CURRENT:
|
||||
if(WM->CC != NULL){
|
||||
free(WM->CC);
|
||||
WM->CC = NULL;
|
||||
}
|
||||
break;
|
||||
case CYCLIC_VOLTAMMETRY:
|
||||
if(WM->CV3 != NULL){
|
||||
free(WM->CV3);
|
||||
WM->CV3 = NULL;
|
||||
}
|
||||
break;
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:
|
||||
if(WM->LSV != NULL){
|
||||
free(WM->LSV);
|
||||
WM->LSV = NULL;
|
||||
}
|
||||
break;
|
||||
case CONSTANT_VSCAN:
|
||||
if(WM->CVSCAN != NULL){
|
||||
free(WM->CVSCAN);
|
||||
WM->CVSCAN = NULL;
|
||||
}
|
||||
break;
|
||||
case PULSE_MODE:
|
||||
if(WM->PULSE != NULL){
|
||||
free(WM->PULSE);
|
||||
WM->PULSE = NULL;
|
||||
}
|
||||
break;
|
||||
// case CYCLE_CONSTANT_CURRENT:
|
||||
// if(WM->CCC != NULL){
|
||||
// free(WM->CCC);
|
||||
// WM->CCC = NULL;
|
||||
// }
|
||||
// break;
|
||||
default:
|
||||
if(WM->VT != NULL){
|
||||
free(WM->VT);
|
||||
WM->VT = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
+7
-60
@@ -2,73 +2,20 @@
|
||||
#ifndef ELITEZT
|
||||
#define ELITEZT
|
||||
|
||||
static void ZT_notify(int32_t impedance);
|
||||
|
||||
// output a certain voltage e.g. 2v
|
||||
// and measure the input voltage
|
||||
// => calculate the resister
|
||||
// change the output voltage step
|
||||
// => get a R-T curve (with resolution = 1 sample/volt step )
|
||||
static void ZT_Plot() {
|
||||
int32_t Real_Resister = 0;
|
||||
static uint16_t CurrentMeasure=0, VoltMeasure=0;
|
||||
uint8_t SPICurrent[SPI_ADC_SIZE]={0}, SPIVolt[SPI_ADC_SIZE]={0};
|
||||
static uint8_t VoltCurrentSwitch = 0;
|
||||
|
||||
// set ADC GAIN
|
||||
if(INSTRUCTION.ResisterMeter == RESISTER_METER_LARGE){
|
||||
INSTRUCTION.ADCGainLevel = GAIN_200R;
|
||||
}
|
||||
else if(INSTRUCTION.ResisterMeter == RESISTER_METER_MIDDLE2){
|
||||
INSTRUCTION.ADCGainLevel = GAIN_200R;
|
||||
}
|
||||
else if(INSTRUCTION.ResisterMeter == RESISTER_METER_MIDDLE1){
|
||||
INSTRUCTION.ADCGainLevel = GAIN_10K;
|
||||
}
|
||||
else{
|
||||
INSTRUCTION.ADCGainLevel = GAIN_200K;
|
||||
}
|
||||
ADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
|
||||
// Use 9-th measure value as real-measure value
|
||||
// because some value in the begin are garbage
|
||||
if(VoltCurrentSwitch < 9){
|
||||
ADCChannelSelect(ADC_CH_CURRENT);
|
||||
CPUdelay(10);
|
||||
ADC_read(SPICurrent);
|
||||
VoltCurrentSwitch ++;
|
||||
}
|
||||
else if(VoltCurrentSwitch == 9){
|
||||
// read current
|
||||
ADCChannelSelect(ADC_CH_CURRENT);
|
||||
CPUdelay(10);
|
||||
ADC_read(SPICurrent);
|
||||
CurrentMeasure = (uint16_t) (SPICurrent[0] << 8) | (uint16_t) (SPICurrent[1]);
|
||||
VoltCurrentSwitch ++;
|
||||
}
|
||||
else if(VoltCurrentSwitch <18){
|
||||
// read volt
|
||||
ADCChannelSelect(ADC_CH_VOLT);
|
||||
CPUdelay(10);
|
||||
ADC_read(SPIVolt);
|
||||
VoltCurrentSwitch++;
|
||||
}
|
||||
else if(VoltCurrentSwitch == 18){
|
||||
// read volt
|
||||
ADCChannelSelect(ADC_CH_VOLT);
|
||||
CPUdelay(10);
|
||||
ADC_read(SPIVolt);
|
||||
VoltMeasure = (uint16_t) (SPIVolt[0] << 8) | (uint16_t) (SPIVolt[1]);
|
||||
VoltCurrentSwitch++;
|
||||
}
|
||||
else{
|
||||
VoltCurrentSwitch = 0;
|
||||
static void ZT_Vscan(RTMode *RT){
|
||||
if(vscanReset){
|
||||
Vset = ((int32_t)(INSTRUCTION.VoltConstant) - 25000) * 4 * 10000; //[5nV]
|
||||
OneWayVoltScan();
|
||||
}
|
||||
|
||||
// decode ADC value and put it into notify buffer
|
||||
DecodeResister(INSTRUCTION.ADCGainLevel, CurrentMeasure, VoltMeasure);
|
||||
// Real_Resister = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
|
||||
if(!vscanReset){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+76
-81
@@ -8,54 +8,102 @@
|
||||
|
||||
/* SPI Board */
|
||||
#define Board_SPI0_MISO PIN_UNASSIGNED
|
||||
#define Board_SPI0_MOSI IOID_1
|
||||
#define Board_SPI0_CLK IOID_0
|
||||
#define Board_SPI0_MOSI D1
|
||||
#define Board_SPI0_CLK D0
|
||||
#define Board_SPI0_CS PIN_UNASSIGNED
|
||||
|
||||
#define Board_SPI1_MISO IOID_3
|
||||
#define Board_SPI1_MOSI IOID_2
|
||||
#define Board_SPI1_CLK IOID_4
|
||||
#define Board_SPI1_MISO IOID_1
|
||||
#define Board_SPI1_MOSI D3
|
||||
#define Board_SPI1_CLK D2
|
||||
#define Board_SPI1_CS PIN_UNASSIGNED
|
||||
|
||||
#define ADC_CS IOID_8
|
||||
#define DAC_CS IOID_9
|
||||
#define D0 IOID_3
|
||||
#define D1 IOID_4
|
||||
#define D2 IOID_5
|
||||
#define D3 IOID_6
|
||||
#define D4 IOID_7
|
||||
#define D5 IOID_8
|
||||
#define D6 IOID_9
|
||||
#define D7 IOID_10
|
||||
|
||||
#define Turnon100R IOID_5
|
||||
#define Turnon10K IOID_6
|
||||
#define LOAD0 IOID_13
|
||||
#define LOAD1 IOID_12
|
||||
#define LOAD2 IOID_11
|
||||
|
||||
#define ADC_CS LOAD0, D6
|
||||
#define DAC_CS LOAD0, D7
|
||||
#define ADC_DAC_SPI_MOSI LOAD0, D3
|
||||
#define ADC_DAC_SPI_CLK LOAD0, D2
|
||||
#define LED_MOSI LOAD0, D1
|
||||
#define LED_CLK LOAD0, D0
|
||||
#define MEM_HOLD LOAD0, D4
|
||||
#define MEM_CS LOAD0, D5
|
||||
|
||||
#define Turnon_I_MID LOAD2, D0
|
||||
#define Turnon_I_SMALL LOAD2, D4
|
||||
#define Turnon_I_LARGE LOAD2, D1
|
||||
#define Turnon_V_SMALL LOAD2, D2
|
||||
#define Turnon_V_MID LOAD2, D3
|
||||
#define Turon_VOUT_SMALL LOAD2, D7
|
||||
|
||||
//#define Turnon10K Turnon_I_MID
|
||||
//#define Turnon200R Turnon_I_LARGE
|
||||
|
||||
/* I2C */
|
||||
#ifdef ELITE_VERSION_1_4
|
||||
#define Board_I2C0_SCL0 IOID_7
|
||||
#define Board_I2C0_SDA0 IOID_14
|
||||
#define Board_I2C0_SCL0 PIN_UNASSIGNED
|
||||
#define Board_I2C0_SDA0 PIN_UNASSIGNED
|
||||
#endif
|
||||
|
||||
#define Board_I2C0_SCL0 IOID_7
|
||||
#define Board_I2C0_SDA0 IOID_14
|
||||
|
||||
|
||||
#define shutdown_6994 IOID_10
|
||||
#define switch_on IOID_11
|
||||
#define power_enable IOID_12
|
||||
#define current_waste IOID_13
|
||||
#define shutdown_6994 LOAD2, D6
|
||||
#define switch_on IOID_14
|
||||
#define HIGH_Z_MODE LOAD2, D5
|
||||
#define enable_10v LOAD1, D5
|
||||
#define enable_5v LOAD1, D6
|
||||
|
||||
PIN_Handle pin_handle;
|
||||
static PIN_State ZM_rst;
|
||||
|
||||
const PIN_Config BLE_IO[] = {
|
||||
//
|
||||
ADC_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // ADC_CS
|
||||
DAC_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // DAC_CS
|
||||
// D0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
// D1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
// D2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
// D3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
D4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
D5 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
D6 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
D7 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
|
||||
power_enable | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // 5V & 10V enable
|
||||
shutdown_6994 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // turn off power
|
||||
Turnon100R | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
|
||||
Turnon10K | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
|
||||
switch_on | PIN_INPUT_EN | PIN_PULLDOWN,
|
||||
current_waste | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // extreme_waste_of_current
|
||||
LOAD0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
LOAD1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
LOAD2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
|
||||
switch_on | PIN_INPUT_EN | PIN_PULLDOWN, // to sense switch
|
||||
|
||||
PIN_TERMINATE
|
||||
};
|
||||
|
||||
static void add_elite_pin() {
|
||||
// PIN_Status elite15_status;
|
||||
PIN_add(pin_handle,
|
||||
D0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL);
|
||||
PIN_add(pin_handle,
|
||||
D1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL);
|
||||
PIN_add(pin_handle,
|
||||
D2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL);
|
||||
PIN_add(pin_handle,
|
||||
D3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL);
|
||||
|
||||
// if(elite15_status != PIN_SUCCESS) {
|
||||
// LED_color(DARKLED, 0x0F, 0x0F, 0x0F);
|
||||
// }
|
||||
}
|
||||
|
||||
static void remove_elite_pin() {
|
||||
PIN_close(pin_handle);
|
||||
pin_handle = PIN_open(&ZM_rst, BLE_IO);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @def BOOSTXL_CC2650MA_SPIName
|
||||
* @brief Enum of SPI names on the CC2650 Booster Pack
|
||||
@@ -190,58 +238,5 @@ const I2C_Config I2C_config[] = {
|
||||
*/
|
||||
#endif
|
||||
|
||||
#ifdef ELITE_VERSION_BAT
|
||||
|
||||
/* Generic I2C instance identifiers */
|
||||
#define Board_I2C CC2650_MA_I2C0
|
||||
/*!
|
||||
* @def CC2650_LAUNCHXL_I2CName
|
||||
* @brief Enum of I2C names on the CC2650 dev board
|
||||
*/
|
||||
typedef enum CC2650_MA_I2CName {
|
||||
CC2650_MA_I2C0 = 0,
|
||||
|
||||
CC2650_MA_I2CCOUNT
|
||||
} CC2650_MA_I2CName;
|
||||
|
||||
/* Place into subsections to allow the TI linker to remove items properly */
|
||||
#if defined(__TI_COMPILER_VERSION__)
|
||||
#pragma DATA_SECTION(I2C_config, ".const:I2C_config")
|
||||
#pragma DATA_SECTION(i2cCC26xxHWAttrs, ".const:i2cCC26xxHWAttrs")
|
||||
#endif
|
||||
|
||||
/* Include drivers */
|
||||
#include <ti/drivers/i2c/I2CCC26XX.h>
|
||||
|
||||
/* I2C objects */
|
||||
I2CCC26XX_Object i2cCC26xxObjects[CC2650_MA_I2CCOUNT];
|
||||
|
||||
/* I2C configuration structure, describing which pins are to be used */
|
||||
const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC2650_MA_I2CCOUNT] = {
|
||||
{
|
||||
.baseAddr = I2C0_BASE,
|
||||
.powerMngrId = PowerCC26XX_PERIPH_I2C0,
|
||||
.intNum = INT_I2C_IRQ,
|
||||
.intPriority = ~0,
|
||||
.swiPriority = 0,
|
||||
.sdaPin = Board_I2C0_SDA0,
|
||||
.sclPin = Board_I2C0_SCL0,
|
||||
}
|
||||
};
|
||||
|
||||
/* I2C configuration structure */
|
||||
const I2C_Config I2C_config[] = {
|
||||
{
|
||||
.fxnTablePtr = &I2CCC26XX_fxnTable,
|
||||
.object = &i2cCC26xxObjects[0],
|
||||
.hwAttrs = &i2cCC26xxHWAttrs[0]
|
||||
},
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
/*
|
||||
* ========================== I2C end =========================================
|
||||
*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
***********************************************************
|
||||
Read battery's method
|
||||
***********************************************************
|
||||
1.ReadADCBat(spi_ADC_rxbuf)
|
||||
let "spi_ADC_rxbuf" be 8000
|
||||
8000 * 187.5uV * 2 = 3000000uV = 3V ;
|
||||
2.AONBatMonBatteryVoltageGet()
|
||||
let "AONBatMonBatteryVoltageGet()" be 768
|
||||
768 * 125 / 320 / 100 = 768 / 256 = 3V ;
|
||||
|
||||
if you want to use first method, and get value 768
|
||||
conversion: 8000 * 187.5 * 1e-6 * 2 / 125 * 320 * 100 = 768
|
||||
=> 8000 * 12 / 125 = 768
|
||||
*/
|
||||
|
||||
#ifndef HEADSTAGE_BATT_H
|
||||
#define HEADSTAGE_BATT_H
|
||||
|
||||
#include <driverlib/aon_batmon.h>
|
||||
#define MAX_BATTERY_CAPACITY 4200
|
||||
|
||||
static uint8_t headstage_battery_percent() {
|
||||
static uint8_t battery_percent = 100;
|
||||
uint8_t internal_battery_percent;
|
||||
uint32_t internal_batt_sense = AONBatMonBatteryVoltageGet();
|
||||
internal_batt_sense = (internal_batt_sense * 125) >> 5;
|
||||
internal_batt_sense = (internal_batt_sense * 100) / MAX_BATTERY_CAPACITY;
|
||||
internal_battery_percent = internal_batt_sense & 0xFF;
|
||||
if (internal_battery_percent < battery_percent) battery_percent = internal_battery_percent;
|
||||
return battery_percent;
|
||||
}
|
||||
|
||||
static void headstage_battery_volt(){
|
||||
uint32_t bat_volt = 0;
|
||||
|
||||
ReadADCBat(spi_ADC_rxbuf);
|
||||
bat_volt = (uint32_t) (spi_ADC_rxbuf[0] << 8) | (uint32_t) (spi_ADC_rxbuf[1]);
|
||||
bat_volt = bat_volt * 12 / 125; //x * 187.5 * 1e-6 * 2 / 125 * 320 * 100 ;
|
||||
InputNotify(NOTIFY_VOLT_BAT, bat_volt);
|
||||
}
|
||||
|
||||
static void EliteADCBattery(){
|
||||
static uint8_t ADCSwitch = 0;
|
||||
if(INSTRUCTION.eliteFxn == ADC_TEST){
|
||||
ADCSwitch = 0;
|
||||
}else{
|
||||
if(ADCSwitch == 0){ /**read V**/
|
||||
ReadADCBat(spi_ADC_rxbuf);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 1){ /**read V**/
|
||||
ReadADCBat(spi_ADC_rxbuf);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 2){ /**read V(buffer)**/
|
||||
headstage_battery_volt();
|
||||
batteryCheck_flag = false;
|
||||
ADCSwitch = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void measureBat(){
|
||||
GPT.DeltaGptimerCounter = GPT.GptimerCounter - GPT.GptimerCounter0;
|
||||
GPT.GptimerCounter0 = GPT.GptimerCounter;
|
||||
|
||||
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
|
||||
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
|
||||
|
||||
if(GPT.BatteryCheckCounter >= 50000){//5min=3000000, 5s=50000
|
||||
GPT.BatteryCheckCounter = 0;
|
||||
batteryCheck_flag = true;
|
||||
}
|
||||
|
||||
if(GPT.BatteryADCCounter >= 15 && batteryCheck_flag){
|
||||
GPT.BatteryADCCounter = 0; //To get the data right, ADC must be delay 1.5ms
|
||||
batteryADC_flag = true;
|
||||
if(batteryADC_flag){
|
||||
EliteADCBattery();
|
||||
batteryADC_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) |
|
||||
((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
|
||||
if( bat < 768 && bat > 20){
|
||||
PIN15_setOutputValue(enable_5v, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // HEADSTAGE_BATT_H
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
#ifndef ELITE_DEF
|
||||
#define ELITE_DEF
|
||||
|
||||
// define BT instruction
|
||||
#define INS_TYPE_RIS 0x30
|
||||
#define INS_TYPE_VIS 0xC0
|
||||
#define INS_TYPE_CIS 0x70
|
||||
|
||||
// VIS (virtual instruction)
|
||||
#define VIS_RST 0xF0
|
||||
#define VIS_ASK 0x30
|
||||
#define VIS_STI 0xC0
|
||||
#define VIS_FUH 0x90
|
||||
#define VIS_INT 0x60
|
||||
#define VIS_SHIFT_200K 0xA0
|
||||
#define VIS_SHIFT_10K 0xE0
|
||||
#define VIS_SHIFT_200R 0x80
|
||||
#define VIS_DEVICE_SHINY 0x10
|
||||
#define VIS_SHINY_DIS 0x20
|
||||
#define VIS_CC_ZERO 0x40
|
||||
|
||||
// RIS (real instruction)
|
||||
#define IV_CURVE 0x10
|
||||
#define CV_CURVE 0x20
|
||||
#define VOLT_OUTPUT 0x30
|
||||
#define ZT_CURVE 0x40
|
||||
#define VT_CURVE 0x50
|
||||
#define IT_CURVE 0x60
|
||||
#define SET_SAMPLE_RATE 0x70
|
||||
#define SET_ADC_DAC_GAIN 0x80
|
||||
#define DIFFERENTIAL_PULSE_VOLTAMMETRY 0xA0
|
||||
#define SQUARE_WAVE_VOLTAMMETRY 0xB0
|
||||
#define CYCLIC_VOLTAMMETRY 0xC0
|
||||
#define CONSTANT_CURRENT 0xD0
|
||||
#define CYCLE_CONSTANT_CURRENT 0xF0
|
||||
#define HIGH_CYCLE_CYCLIC_VOLTAMMETRY 0x01
|
||||
#define LINEAR_SWEEP_VOLTAMMETRY 0x02
|
||||
#define CONSTANT_VSCAN 0x03
|
||||
#define ADC_TEST 0x91
|
||||
#define CALI_DAC_MODE 0x93
|
||||
#define CALI_ADC_MODE 0x92
|
||||
#define PULSE_MODE 0x94
|
||||
|
||||
// CIS (control instruction)
|
||||
#define CIS_VERSION 0x40
|
||||
#define CIS_VOLT 0x10
|
||||
#define CIS_LED_TEST 0x70
|
||||
|
||||
// mode parameter
|
||||
#define STEP_TO_VSETRATE(step) step2VsetRate(step)
|
||||
#define VMAX(v1,v2) ((v1 >= v2) ? v1 : v2)
|
||||
#define VMIN(v1,v2) ((v1 < v2) ? v1 : v2)
|
||||
#define VDIRECTION(v1,v2) ((v1 > v2) ? 0 : 1)
|
||||
#define AFTER_READ_I 0
|
||||
#define AFTER_READ_V 1
|
||||
#define ReadADCVolt(x) ((x==0)? ReadADCVout(spi_ADC_rxbuf) : ReadADCVin(spi_ADC_rxbuf))
|
||||
#define PARA_1 0x01
|
||||
#define PARA_2 0x02
|
||||
|
||||
//Elite LED
|
||||
#define COLOR_BLACK 0x00
|
||||
#define COLOR_RED 0x01
|
||||
#define COLOR_ORANGE 0x02
|
||||
#define COLOR_YELLOW 0x03
|
||||
#define COLOR_GREEN 0x04
|
||||
#define COLOR_BLUE 0x05
|
||||
#define COLOR_CYAN 0x06
|
||||
#define COLOR_MAGENTA 0x07
|
||||
#define COLOR_PURPLE 0x08
|
||||
#define COLOR_WHITE 0x09
|
||||
#define COLOR_YELLOWGREEN 0x0A
|
||||
#define LEDPowerON() Elite_led_color(COLOR_GREEN)
|
||||
#define WORKLED() Elite_led_color(COLOR_CYAN)
|
||||
#define KEYLED() Elite_led_color(COLOR_YELLOW)
|
||||
#define BT_WAIT_LED() Elite_led_color(COLOR_YELLOWGREEN)
|
||||
|
||||
|
||||
#define BT_WAIT 0x01
|
||||
#define NO_EVENT 0x02
|
||||
#define PRE_WORK 0x03
|
||||
#define WORKING 0x04
|
||||
#define POST_WORK 0x05
|
||||
|
||||
|
||||
#endif
|
||||
+795
@@ -0,0 +1,795 @@
|
||||
#ifndef ELITE_MODE_ADC_DAC
|
||||
#define ELITE_MODE_ADC_DAC
|
||||
|
||||
#define Vset INSTRUCTION.Vset
|
||||
|
||||
static void readIin(WorkMode *WorkModeData);
|
||||
static int32_t readVinVout(WorkMode *WorkModeData);
|
||||
|
||||
static uint16_t OneWayVoltScan() {
|
||||
static uint16_t DACOutCode;
|
||||
static int32_t Vout;
|
||||
static int32_t DeltaVout;
|
||||
|
||||
if(DACReset){
|
||||
Vout = Vset;
|
||||
DACReset = false;
|
||||
}else{
|
||||
DeltaVout = Vset - (Vout);
|
||||
Vout = Vout + DeltaVout;
|
||||
}
|
||||
|
||||
INSTRUCTION.VoltConstant = Vout / 40000 + 25000; //5nV=>usercode
|
||||
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant);
|
||||
DAC_outputV(DACOutCode);
|
||||
|
||||
if ((INSTRUCTION.eliteFxn == IV_CURVE)||(INSTRUCTION.eliteFxn == CV_CURVE)||(INSTRUCTION.eliteFxn == CONSTANT_CURRENT)){
|
||||
int32_t RealV;
|
||||
RealV = (int32_t)(Vout / 200);//[1uV]
|
||||
InputNotify(NOTIFY_IMPEDANCE, RealV);
|
||||
}
|
||||
|
||||
|
||||
return DACOutCode;
|
||||
}
|
||||
|
||||
static void CalcuResistance(RTMode *RT, int32_t VoltData){
|
||||
/* Elite 100 = 100R
|
||||
Elite 1000 = 1KR
|
||||
Elite 10000 = 10KR
|
||||
Elite 100000 = 100KR
|
||||
Elite 1000000 = 1MR
|
||||
*/
|
||||
static int32_t resister_32 = 0;
|
||||
int32_t Vtemp;
|
||||
Vtemp = (VoltData * 1000) - (RT->_measureCurrent * 10); //V = Vin - Iin * 10
|
||||
resister_32 = Vtemp / RT->_measureCurrent; //R = V / Iin;
|
||||
InputNotify(NOTIFY_IMPEDANCE, resister_32);
|
||||
}
|
||||
|
||||
static void DACenable(WorkMode *WorkModeData, int32_t VoltData ,uint8_t afterRead){
|
||||
if(afterRead == AFTER_READ_I){
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case CONSTANT_CURRENT:{
|
||||
CC_Vscan(WorkModeData->CC);
|
||||
OneWayVoltScan();
|
||||
break;
|
||||
}
|
||||
case IV_CURVE:
|
||||
case CV_CURVE:
|
||||
case ZT_CURVE:
|
||||
case IT_CURVE:
|
||||
case VT_CURVE:
|
||||
case CYCLIC_VOLTAMMETRY:
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:
|
||||
case CONSTANT_VSCAN:
|
||||
case PULSE_MODE:{
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else if(afterRead == AFTER_READ_V){
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IV_CURVE:
|
||||
case CV_CURVE:{
|
||||
OneWayVoltScan();
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
CalcuResistance(WorkModeData->RT, VoltData);
|
||||
break;
|
||||
}
|
||||
case IT_CURVE:
|
||||
case VT_CURVE:
|
||||
case CONSTANT_CURRENT:
|
||||
case PULSE_MODE:{
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
CV3Curve(WorkModeData->CV3);
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
LSVCurve(WorkModeData->LSV);
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
CVSCANCurve(WorkModeData->CVSCAN);
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void CC_Plot(WorkMode *WorkModeData){
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IT
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->VT
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->RT
|
||||
break;
|
||||
}
|
||||
case IV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IV
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->CV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
#define CURRENT_MODE WorkModeData->CC
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->CV3
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->LSV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
#define CURRENT_MODE WorkModeData->CVSCAN
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
#define CURRENT_MODE WorkModeData->PULSE
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t ADCSwitch = 0;
|
||||
static uint8_t BatSwitch = 0;
|
||||
static int32_t VoltData = 0;
|
||||
|
||||
if(batteryCheck_flag){
|
||||
if(BatSwitch == 0){
|
||||
if(ADCSwitch == 0){ /**read Iin(buffer),read bat**/
|
||||
readIin(WorkModeData);
|
||||
if(record_flag == false){
|
||||
static int recordCount = 0;
|
||||
recordCount++;
|
||||
if(recordCount == 2){
|
||||
record_flag = true;
|
||||
recordCount = 0;
|
||||
}
|
||||
}else{
|
||||
InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
|
||||
}
|
||||
DACenable(WorkModeData, VoltData, AFTER_READ_I);
|
||||
|
||||
ReadADCBat(spi_ADC_rxbuf);
|
||||
BatSwitch++;
|
||||
}else if(ADCSwitch == 1 || ADCSwitch == 3){ /**read Bat**/
|
||||
ReadADCBat(spi_ADC_rxbuf);
|
||||
BatSwitch++;
|
||||
}else if(ADCSwitch == 2){ /**read V(buffer),read bat**/
|
||||
VoltData = readVinVout(WorkModeData);
|
||||
if(INSTRUCTION.VoViSwitch == 0x02){
|
||||
int32_t Vscan = (Vset / 200 - CURRENT_MODE->_measureVin);
|
||||
Vscan = (int32_t)(Vscan);//[1uV]
|
||||
InputNotify(NOTIFY_VOLT, Vscan);
|
||||
}else{
|
||||
InputNotify(NOTIFY_VOLT, VoltData);
|
||||
}
|
||||
DACenable(WorkModeData, VoltData, AFTER_READ_V);
|
||||
|
||||
ReadADCBat(spi_ADC_rxbuf);
|
||||
BatSwitch++;
|
||||
}
|
||||
}else if(BatSwitch == 1){
|
||||
ReadADCBat(spi_ADC_rxbuf);
|
||||
BatSwitch++;
|
||||
}else if(BatSwitch == 2){
|
||||
headstage_battery_volt();
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
batteryCheck_flag = false;
|
||||
BatSwitch = 0;
|
||||
ADCSwitch = 3;
|
||||
}
|
||||
}else{
|
||||
BatSwitch = 0;
|
||||
if(ADCSwitch == 0){ /**read Iin(buffer),read V**/
|
||||
readIin(WorkModeData);
|
||||
if(record_flag == false){
|
||||
static int recordCount = 0;
|
||||
recordCount++;
|
||||
if(recordCount == 2){
|
||||
record_flag = true;
|
||||
recordCount = 0;
|
||||
}
|
||||
}else{
|
||||
InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
|
||||
}
|
||||
DACenable(WorkModeData, VoltData, AFTER_READ_I);
|
||||
|
||||
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 1){ /**read V**/
|
||||
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 2){ /**read V(buffer),read Iin**/
|
||||
VoltData = readVinVout(WorkModeData);
|
||||
if(INSTRUCTION.VoViSwitch == 0x02){
|
||||
int32_t Vscan = (Vset / 200 - CURRENT_MODE->_measureVin);
|
||||
Vscan = (int32_t)(Vscan);//[1uV]
|
||||
InputNotify(NOTIFY_VOLT, Vscan);
|
||||
}else{
|
||||
InputNotify(NOTIFY_VOLT, VoltData);
|
||||
}
|
||||
DACenable(WorkModeData, VoltData, AFTER_READ_V);
|
||||
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 3){ /**read Iin**/
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
ADCSwitch = 0;
|
||||
}
|
||||
}
|
||||
#undef CURRENT_MODE
|
||||
}
|
||||
|
||||
static void IT_Plot(WorkMode *WorkModeData) {
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IT
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->VT
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->RT
|
||||
break;
|
||||
}
|
||||
case IV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IV
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->CV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
#define CURRENT_MODE WorkModeData->CC
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->CV3
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->LSV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
#define CURRENT_MODE WorkModeData->CVSCAN
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
#define CURRENT_MODE WorkModeData->PULSE
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t ADCSwitch = 0;
|
||||
|
||||
if(batteryCheck_flag){
|
||||
EliteADCBattery();
|
||||
if(!batteryCheck_flag){
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
ADCSwitch = 2;
|
||||
}
|
||||
}else{
|
||||
if(ADCSwitch == 0){ /**read Iin(buffer)**/
|
||||
readIin(WorkModeData);
|
||||
if(record_flag == false){
|
||||
static int recordCount = 0;
|
||||
recordCount++;
|
||||
if(recordCount == 2){
|
||||
record_flag = true;
|
||||
recordCount = 0;
|
||||
}
|
||||
}else{
|
||||
InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
|
||||
}
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 1){ /**read Iin**/
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 2){ /**read Iin**/
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
ADCSwitch = 0;
|
||||
}
|
||||
}
|
||||
#undef CURRENT_MODE
|
||||
}
|
||||
|
||||
static void VT_Plot(WorkMode *WorkModeData) {
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IT
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->VT
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->RT
|
||||
break;
|
||||
}
|
||||
case IV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IV
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->CV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
#define CURRENT_MODE WorkModeData->CC
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->CV3
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->LSV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
#define CURRENT_MODE WorkModeData->CVSCAN
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
#define CURRENT_MODE WorkModeData->PULSE
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ADC gain is don't care when measuring voltage
|
||||
// INSTRUCTION.ADCGainLevel = I_GAIN_100R;
|
||||
// IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
|
||||
static uint8_t ADCSwitch = 0;
|
||||
static int32_t VoltData;
|
||||
|
||||
if(batteryCheck_flag){
|
||||
EliteADCBattery();
|
||||
if(!batteryCheck_flag){
|
||||
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
|
||||
ADCSwitch = 2;
|
||||
}
|
||||
}else{
|
||||
if(ADCSwitch == 0){ /**read V(buffer)**/
|
||||
VoltData = readVinVout(WorkModeData);
|
||||
if(record_flag == false){
|
||||
static int recordCount = 0;
|
||||
recordCount++;
|
||||
if(recordCount == 2){
|
||||
record_flag = true;
|
||||
recordCount = 0;
|
||||
}
|
||||
}else{
|
||||
InputNotify(NOTIFY_VOLT, VoltData);
|
||||
}
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 1){ /**read V**/
|
||||
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 2){ /**read V**/
|
||||
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
|
||||
ADCSwitch = 0;
|
||||
}
|
||||
}
|
||||
#undef CURRENT_MODE
|
||||
}
|
||||
|
||||
static void readIin(WorkMode *WorkModeData){
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IT_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->IT
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->VT
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->RT
|
||||
break;
|
||||
}
|
||||
case IV_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->IV
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->CV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
#define TEMP_MODE WorkModeData->CC
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
#define TEMP_MODE WorkModeData->CV3
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
#define TEMP_MODE WorkModeData->LSV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
#define TEMP_MODE WorkModeData->CVSCAN
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
#define TEMP_MODE WorkModeData->PULSE
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(INSTRUCTION.AutoGainEnable){
|
||||
TEMP_MODE->_measureCurrent = AutoGainReadIin(spi_ADC_rxbuf);
|
||||
AutoGainChangeIin(TEMP_MODE->_measureCurrent);
|
||||
}else{
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
TEMP_MODE->_measureCurrent = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
|
||||
if(lastIinADCGainLevel != INSTRUCTION.ADCGainLevel){
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
#undef TEMP_MODE
|
||||
}
|
||||
|
||||
static int32_t readVinVout(WorkMode *WorkModeData){
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IT_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->IT
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->VT
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->RT
|
||||
break;
|
||||
}
|
||||
case IV_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->IV
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
#define TEMP_MODE WorkModeData->CV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
#define TEMP_MODE WorkModeData->CC
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
#define TEMP_MODE WorkModeData->CV3
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
#define TEMP_MODE WorkModeData->LSV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
#define TEMP_MODE WorkModeData->CVSCAN
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
#define TEMP_MODE WorkModeData->PULSE
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int32_t VoltData;
|
||||
|
||||
if(TEMP_MODE->_VoViSwitch == 0x01 || TEMP_MODE->_VoViSwitch == 0x02){
|
||||
if(INSTRUCTION.VinAutoGainEnable){
|
||||
TEMP_MODE->_measureVin = AutoGainReadVin(spi_ADC_rxbuf);
|
||||
AutoGainChangeVin(TEMP_MODE->_measureVin);
|
||||
}else{
|
||||
ReadADCVolt(TEMP_MODE->_VoViSwitch);
|
||||
TEMP_MODE->_measureVin = DecodeADCValue(INSTRUCTION.VinADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
|
||||
if(lastVinADCGainLevel != INSTRUCTION.VinADCGainLevel){
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
record_flag = false;
|
||||
}
|
||||
|
||||
}
|
||||
VoltData = TEMP_MODE->_measureVin;
|
||||
}else if(TEMP_MODE->_VoViSwitch == 0x00){
|
||||
ReadADCVolt(TEMP_MODE->_VoViSwitch);
|
||||
TEMP_MODE->_measureVout = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_DAC, spi_ADC_rxbuf);
|
||||
VoltData = TEMP_MODE->_measureVout;
|
||||
}
|
||||
#undef TEMP_MODE
|
||||
return VoltData;
|
||||
}
|
||||
|
||||
static void cali_IT_plot(WorkMode *WorkModeData) {
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IT
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->VT
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->RT
|
||||
break;
|
||||
}
|
||||
case IV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IV
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->CV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
#define CURRENT_MODE WorkModeData->CC
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->CV3
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->LSV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
#define CURRENT_MODE WorkModeData->CVSCAN
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
#define CURRENT_MODE WorkModeData->PULSE
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
#define CURRENT_MODE WorkModeData->VT
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t ADCSwitch = 0;
|
||||
int32_t ADCValueTemp = 0;
|
||||
static int32_t ADCValueSUM = 0;
|
||||
int32_t ADCValueAVG = 0;
|
||||
int16_t ADCValueAVG_RAW = 0;
|
||||
|
||||
if(ADCSwitch == 0){ /**read Iin(buffer)**/
|
||||
if(INSTRUCTION.AutoGainEnable){
|
||||
CURRENT_MODE->_measureCurrent = 0xFFFF;
|
||||
}else{
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
CURRENT_MODE->_measureCurrent = (int32_t) (spi_ADC_rxbuf[0] << 8) | (int32_t) (spi_ADC_rxbuf[1]);
|
||||
if(lastIinADCGainLevel != INSTRUCTION.ADCGainLevel){
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
record_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(record_flag == false){
|
||||
static int recordCount = 0;
|
||||
recordCount++;
|
||||
if(recordCount == 2){
|
||||
record_flag = true;
|
||||
recordCount = 0;
|
||||
}
|
||||
}else{
|
||||
static uint16_t cali_count = 0;
|
||||
if(cali_count >= 5000){
|
||||
ADCValueAVG = ADCValueSUM / cali_count;
|
||||
|
||||
InputNotify(NOTIFY_CURRENT, ADCValueAVG);
|
||||
SendNotify();
|
||||
|
||||
uint8_t CIS_buf[9] = {0};
|
||||
CIS_buf[0] = INSTRUCTION.chip_id;
|
||||
CIS_buf[1] = (uint8_t) ((ADCValueAVG & 0xFF00) >> 8);
|
||||
CIS_buf[2] = (uint8_t) (ADCValueAVG & 0x00FF);
|
||||
CIS_buf[3] = 0x00;
|
||||
CIS_buf[4] = INSTRUCTION.ADCGainLevel;
|
||||
SimpleProfile_SetParameter(BLE_CIS_BUFF_CHAR, 9, CIS_buf);
|
||||
ADCValueSUM = 0;
|
||||
cali_count = 0;
|
||||
|
||||
PeriodicEvent = false;
|
||||
ModeLED(NO_EVENT);
|
||||
|
||||
}else{
|
||||
cali_count++;
|
||||
ADCValueSUM = ADCValueSUM + CURRENT_MODE->_measureCurrent;
|
||||
// InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
|
||||
// InputNotify(NOTIFY_VOLT, ADCValueSUM);
|
||||
// InputNotify(NOTIFY_IMPEDANCE, (int32_t)cali_count);
|
||||
}
|
||||
|
||||
}
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 1){ /**read Iin**/
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 2){ /**read Iin**/
|
||||
ReadADCIin(spi_ADC_rxbuf);
|
||||
ADCSwitch = 0;
|
||||
}
|
||||
|
||||
#undef CURRENT_MODE
|
||||
}
|
||||
|
||||
static void cali_VT_plot(WorkMode *WorkModeData) {
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IT
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->VT
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->RT
|
||||
break;
|
||||
}
|
||||
case IV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->IV
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
#define CURRENT_MODE WorkModeData->CV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
#define CURRENT_MODE WorkModeData->CC
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->CV3
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
#define CURRENT_MODE WorkModeData->LSV
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
#define CURRENT_MODE WorkModeData->CVSCAN
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
#define CURRENT_MODE WorkModeData->PULSE
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
#define CURRENT_MODE WorkModeData->VT
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t ADCSwitch = 0;
|
||||
static int32_t VoltData;
|
||||
int32_t ADCValueTemp = 0;
|
||||
static int32_t ADCValueSUM = 0;
|
||||
int32_t ADCValueAVG = 0;
|
||||
int16_t ADCValueAVG_RAW = 0;
|
||||
|
||||
if(ADCSwitch == 0){ /**read Iin(buffer)**/
|
||||
if(CURRENT_MODE->_VoViSwitch == 0x01 || CURRENT_MODE->_VoViSwitch == 0x02){
|
||||
if(INSTRUCTION.VinAutoGainEnable){
|
||||
CURRENT_MODE->_measureVin = 0xFFFF;
|
||||
}else{
|
||||
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
|
||||
CURRENT_MODE->_measureVin = (int32_t) (spi_ADC_rxbuf[0] << 8) | (int32_t) (spi_ADC_rxbuf[1]);
|
||||
if(lastVinADCGainLevel != INSTRUCTION.VinADCGainLevel){
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
record_flag = false;
|
||||
}
|
||||
|
||||
}
|
||||
VoltData = CURRENT_MODE->_measureVin;
|
||||
}
|
||||
// else if(CURRENT_MODE->_VoViSwitch == 0x00){
|
||||
// ReadADCVolt(CURRENT_MODE->_VoViSwitch);
|
||||
// CURRENT_MODE->_measureVout = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_DAC, spi_ADC_rxbuf);
|
||||
// VoltData = CURRENT_MODE->_measureVout;
|
||||
// }
|
||||
|
||||
if(record_flag == false){
|
||||
static int recordCount = 0;
|
||||
recordCount++;
|
||||
if(recordCount == 2){
|
||||
record_flag = true;
|
||||
recordCount = 0;
|
||||
}
|
||||
}else{
|
||||
static uint16_t cali_count = 0;
|
||||
if(cali_count >= 1000){
|
||||
ADCValueAVG = ADCValueSUM / cali_count;
|
||||
|
||||
InputNotify(NOTIFY_VOLT, ADCValueAVG);
|
||||
SendNotify();
|
||||
|
||||
uint8_t CIS_buf[9] = {0};
|
||||
CIS_buf[0] = INSTRUCTION.chip_id;
|
||||
CIS_buf[1] = (uint8_t) ((ADCValueAVG & 0xFF00) >> 8);
|
||||
CIS_buf[2] = (uint8_t) (ADCValueAVG & 0x00FF);
|
||||
CIS_buf[3] = 0x00;
|
||||
CIS_buf[4] = INSTRUCTION.VinADCGainLevel;
|
||||
SimpleProfile_SetParameter(BLE_CIS_BUFF_CHAR, 9, CIS_buf);
|
||||
ADCValueSUM = 0;
|
||||
cali_count = 0;
|
||||
|
||||
PeriodicEvent = false;
|
||||
ModeLED(NO_EVENT);
|
||||
}else{
|
||||
cali_count++;
|
||||
ADCValueSUM = ADCValueSUM + CURRENT_MODE->_measureVin;
|
||||
InputNotify(NOTIFY_VOLT, CURRENT_MODE->_measureVin);
|
||||
InputNotify(NOTIFY_CURRENT, ADCValueSUM);
|
||||
InputNotify(NOTIFY_IMPEDANCE, (int32_t)cali_count);
|
||||
}
|
||||
|
||||
}
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 1){ /**read v**/
|
||||
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 2){ /**read v**/
|
||||
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
|
||||
ADCSwitch = 0;
|
||||
}
|
||||
|
||||
#undef CURRENT_MODE
|
||||
}
|
||||
|
||||
#endif
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
#ifndef HEADSTAGE_POWER_H
|
||||
#define HEADSTAGE_POWER_H
|
||||
|
||||
#include <ti/drivers/Power.h>
|
||||
#include <ti/drivers/power/PowerCC26XX.h>
|
||||
|
||||
#define headstage_power_shutdown() Power_shutdown(NULL, 0)
|
||||
|
||||
#endif // HEADSTAGE_POWER_H
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#ifndef VERSION_DATE
|
||||
#define VERSION_DATE
|
||||
|
||||
#define VERSION_DATE_YEAR 20
|
||||
#define VERSION_DATE_MONTH 11
|
||||
#define VERSION_DATE_DAY 26
|
||||
#define VERSION_DATE_HOUR 22
|
||||
#define VERSION_DATE_MINUTE 48
|
||||
|
||||
// this is NOT the version hash !!
|
||||
// it's the last version hash
|
||||
#define VERSION_HASH 8808490caa465cc94d14896de28763a5e5c4672b
|
||||
#define VERSION_GIT_BRANCH Elite_OBJ_0.2mv
|
||||
#endif
|
||||
+771
-442
File diff suppressed because it is too large
Load Diff
+388
-137
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* impedance_meter.h
|
||||
*
|
||||
* Created on: 2019�~1��15��
|
||||
* Created on: 2019/01/15
|
||||
* Author: benny
|
||||
*/
|
||||
#ifndef HEADSTAGE_H
|
||||
@@ -19,8 +19,10 @@
|
||||
// header
|
||||
#include <ti/drivers/PIN.h>
|
||||
#include "board.h"
|
||||
#include "EliteWorkData.h"
|
||||
#include <driverlib/aon_batmon.h>
|
||||
|
||||
static void SimpleBLEPeripheral_performPeriodicTask(CURRENT_USER_CODE *CurrentUserCode);
|
||||
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData);
|
||||
|
||||
static void SimpleBLEPeripheral_clockHandler(UArg arg) {
|
||||
// Store the event.
|
||||
@@ -33,6 +35,7 @@ static void SimpleBLEPeripheral_clockHandler(UArg arg) {
|
||||
static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) {
|
||||
events |= SBP_PERIODIC_EVT;
|
||||
Semaphore_post(semaphore);
|
||||
GPT.GptimerCounter++;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,22 +46,21 @@ static void ZM_init() {
|
||||
|
||||
// initialize
|
||||
pin_handle = PIN_open(&ZM_rst, BLE_IO);
|
||||
Init_Elite15_PIN();
|
||||
ELITE15_SPI_HOLD();
|
||||
|
||||
PIN_setOutputValue(pin_handle, shutdown_6994, 1); // OFF = 1 => turn off 6994
|
||||
|
||||
|
||||
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
|
||||
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
|
||||
PIN15_setOutputValue(shutdown_6994, 1); // OFF = 1 => turn off 6994
|
||||
PIN15_setOutputValue(enable_10v, 0); // enable 10V
|
||||
PIN15_setOutputValue(HIGH_Z_MODE, 1); // HIGH Z MODE // 1 => close high_z mode
|
||||
|
||||
InitEliteInstruction();
|
||||
ADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
elite_gptimer_open();
|
||||
|
||||
// PIN_setOutputValue(pin_handle, Turnon100R, 0);
|
||||
// PIN_setOutputValue(pin_handle, Turnon10K, 0);
|
||||
|
||||
// PIN_registerIntCb(pin_handle, switch_on_callback);
|
||||
PIN_setInterrupt(pin_handle, switch_on | PIN_IRQ_POSEDGE);
|
||||
// PIN_registerIntCb(pin_handle, switch_on_callback);
|
||||
// PIN_setInterrupt(pin_handle, switch_on | PIN_IRQ_POSEDGE);
|
||||
}
|
||||
|
||||
static void ZM_update_instruction_callback(uint8_t ins_type, uint8_t chip_ID, uint8_t *ins) {}
|
||||
@@ -66,7 +68,7 @@ static void ZM_update_instruction_callback(uint8_t ins_type, uint8_t chip_ID, ui
|
||||
|
||||
static void DACCode2Real2Notify(uint16_t DACcode) {
|
||||
int32_t RealV;
|
||||
RealV = DAC_to_realV(DACcode);
|
||||
RealV = DAC_to_realV(INSTRUCTION.VoutGainLevel, DACcode);
|
||||
|
||||
NotifyVolt[0] = (uint8_t)((RealV & 0xFF000000) >> 24);
|
||||
NotifyVolt[1] = (uint8_t)((RealV & 0x00FF0000) >> 16);
|
||||
@@ -74,13 +76,24 @@ static void DACCode2Real2Notify(uint16_t DACcode) {
|
||||
NotifyVolt[3] = (uint8_t)(RealV & 0x000000FF);
|
||||
}
|
||||
|
||||
#define IsPeriodicMode() ( \
|
||||
(INSTRUCTION.eliteFxn == IV_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == CV_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == IT_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == VT_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == ZT_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == CONSTANT_CURRENT) \
|
||||
#define IsPeriodicMode() ( \
|
||||
(INSTRUCTION.eliteFxn == IV_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == CV_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == IT_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == VT_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == ZT_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == CONSTANT_CURRENT) || \
|
||||
(INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY) || \
|
||||
(INSTRUCTION.eliteFxn == LINEAR_SWEEP_VOLTAMMETRY) || \
|
||||
(INSTRUCTION.eliteFxn == CONSTANT_VSCAN) || \
|
||||
(INSTRUCTION.eliteFxn == CALI_ADC_MODE) \
|
||||
)
|
||||
|
||||
#define Ve1MatchVe2Mode() ( \
|
||||
(INSTRUCTION.eliteFxn == IV_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == CV_CURVE) || \
|
||||
(INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY) || \
|
||||
(INSTRUCTION.eliteFxn == LINEAR_SWEEP_VOLTAMMETRY) \
|
||||
)
|
||||
|
||||
/*********************************************************************
|
||||
@@ -92,153 +105,391 @@ static void DACCode2Real2Notify(uint16_t DACcode) {
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
static void SimpleBLEPeripheral_performPeriodicTask(CURRENT_USER_CODE *CurrentUserCode) {
|
||||
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData) {
|
||||
if ( IsPeriodicMode() ){
|
||||
|
||||
if (StepTimeCounter == INSTRUCTION.StepTime){
|
||||
StepTimeCounter = 1;
|
||||
}
|
||||
else{
|
||||
StepTimeCounter++;
|
||||
}
|
||||
|
||||
if (SampleRate_counter == INSTRUCTION.SampleRate){
|
||||
SampleRate_counter = 1;
|
||||
}
|
||||
else{
|
||||
SampleRate_counter++;
|
||||
}
|
||||
|
||||
/** Periodic Event **/
|
||||
// Default working mode is DAC out -> ADC read -> send notify
|
||||
// We will need a flag to control DAC, if we want to exchange to ADC -> DAC -> notify
|
||||
// This flag can be named by FxnNameReset
|
||||
// Default working flow is vscan -> ADC read -> send notify
|
||||
// We will need a flag to control vscan, ADC and notify
|
||||
|
||||
// In IV, CV, and func-gen mode, DAC will output voltage
|
||||
// else DAC do nothing.
|
||||
EliteDACControl(CurrentUserCode);
|
||||
GPT.DeltaGptimerCounter = GPT.GptimerCounter - GPT.GptimerCounter0;
|
||||
GPT.GptimerCounter0 = GPT.GptimerCounter;
|
||||
|
||||
// Control ADC to sample rate
|
||||
EliteADCControl(CurrentUserCode);
|
||||
|
||||
// Notify control, check if we need to send notify
|
||||
EliteNotifyControl();
|
||||
}
|
||||
}
|
||||
|
||||
static void EliteDACControl(CURRENT_USER_CODE *CurrentUserCode) {
|
||||
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
|
||||
// output a certain voltage and put it into NotifyVolt
|
||||
DACCode2Real2Notify(VoltScan());
|
||||
}
|
||||
else if (INSTRUCTION.eliteFxn == ZT_CURVE){
|
||||
if(INSTRUCTION.ResisterMeter == RESISTER_METER_SMALL){
|
||||
// output 1V
|
||||
if (DACReset) {
|
||||
INSTRUCTION.VoltConstant = 24999 + 5000;
|
||||
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
|
||||
DACReset = false;
|
||||
if(EliteWorkReset){
|
||||
InitEliteGPtimer();
|
||||
EliteWorkReset = false;
|
||||
batteryADC_flag = false;
|
||||
record_flag = true;
|
||||
firstTimeReset = true;
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
if( Ve1MatchVe2Mode() ){
|
||||
if (INSTRUCTION.Ve1 == INSTRUCTION.Ve2) {
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.Ve1));
|
||||
PeriodicEvent = false;
|
||||
ModeLED(NO_EVENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
// output 1V
|
||||
if (DACReset) {
|
||||
INSTRUCTION.VoltConstant = 24999 + 5000;
|
||||
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
|
||||
DACReset = false;
|
||||
|
||||
|
||||
GPT.LeadTimeCounter = GPT.LeadTimeCounter + GPT.DeltaGptimerCounter;
|
||||
if(leadTimeReset && GPT.LeadTimeCounter <= 2000){
|
||||
vscanReset = true;
|
||||
}else{
|
||||
if(notifyFirst_flag){
|
||||
GPT.NotifyCounter = INSTRUCTION.notifyRate - 20;
|
||||
notifyFirst_flag = false;
|
||||
}
|
||||
vscanReset = false;
|
||||
leadTimeReset = false;
|
||||
}
|
||||
|
||||
//vscan counter
|
||||
GPT.VscanRateCounter = GPT.VscanRateCounter + GPT.DeltaGptimerCounter;
|
||||
if(GPT.VscanRateCounter >= INSTRUCTION.VsetRate){
|
||||
if(GPT.VscanRateCounter >= INSTRUCTION.VsetRate * 2){
|
||||
GPT.GptimerMultiple = GPT.VscanRateCounter / INSTRUCTION.VsetRate;
|
||||
}else{
|
||||
GPT.GptimerMultiple = 1;
|
||||
}
|
||||
GPT.VscanRateCounter -= INSTRUCTION.VsetRate * GPT.GptimerMultiple; //To get right time
|
||||
vscan_flag = true;
|
||||
if(vscan_flag){
|
||||
EliteVscanControl(WorkModeData);
|
||||
vscan_flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(INSTRUCTION.eliteFxn == CONSTANT_CURRENT){
|
||||
if (DACReset) {
|
||||
// DAC_outputV(Usercode_Correction_to_DAC(CurrentUserCode->value));
|
||||
DACReset = false;
|
||||
}
|
||||
CCModeVoltOut(CurrentUserCode);
|
||||
// DAC_outputV(Usercode_Correction_to_DAC(CurrentUserCode->value));
|
||||
}
|
||||
|
||||
//battery counter
|
||||
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
|
||||
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
|
||||
if(GPT.BatteryCheckCounter >= 50000){
|
||||
GPT.BatteryCheckCounter -= 50000; //To get right time
|
||||
batteryCheck_flag = true;
|
||||
}
|
||||
|
||||
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) | ((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
|
||||
if( bat < 768 && bat > 20){
|
||||
PIN15_setOutputValue(enable_5v, 0);
|
||||
}
|
||||
|
||||
//ADC counter
|
||||
GPT.SampleRateCounter = GPT.SampleRateCounter + GPT.DeltaGptimerCounter;
|
||||
if(GPT.SampleRateCounter >= INSTRUCTION.sampleRate){
|
||||
GPT.SampleRateCounter = 0; //To get right data, ADC must be delay 1.5ms
|
||||
ADC_flag = true;
|
||||
if(ADC_flag){
|
||||
EliteADCControl(WorkModeData);
|
||||
ADC_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Notify counter(Notify control, check if we need to send notify)
|
||||
//please don't put Notify counter before ADC counter, maybe get wrong data
|
||||
GPT.NotifyCounter = GPT.NotifyCounter + GPT.DeltaGptimerCounter;
|
||||
if(GPT.NotifyCounter >= INSTRUCTION.notifyRate){
|
||||
GPT.NotifyCounter -= INSTRUCTION.notifyRate; //To get right time
|
||||
notify_flag = true;
|
||||
if(vscanReset){
|
||||
notify_flag = false;
|
||||
}
|
||||
if(notify_flag){
|
||||
SendNotify();
|
||||
notify_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
// EliteDone();
|
||||
}
|
||||
else if (INSTRUCTION.eliteFxn == PULSE_MODE){
|
||||
/** Periodic Event **/
|
||||
// Default working flow is vscan -> ADC read -> send notify
|
||||
// We will need a flag to control vscan, ADC and notify
|
||||
|
||||
GPT.DeltaGptimerCounter = GPT.GptimerCounter - GPT.GptimerCounter0;
|
||||
GPT.GptimerCounter0 = GPT.GptimerCounter;
|
||||
|
||||
if(EliteWorkReset){
|
||||
InitEliteGPtimer();
|
||||
EliteWorkReset = false;
|
||||
batteryADC_flag = false;
|
||||
record_flag = true;
|
||||
firstTimeReset = true;
|
||||
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
|
||||
IinADCGainControl(INSTRUCTION.ADCGainLevel);
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
if( Ve1MatchVe2Mode() ){
|
||||
if (INSTRUCTION.Ve1 == INSTRUCTION.Ve2) {
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.Ve1));
|
||||
PeriodicEvent = false;
|
||||
ModeLED(NO_EVENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GPT.LeadTimeCounter = GPT.LeadTimeCounter + GPT.DeltaGptimerCounter;
|
||||
if(leadTimeReset && GPT.LeadTimeCounter <= 2000){
|
||||
vscanReset = true;
|
||||
}else{
|
||||
if(notifyFirst_flag){
|
||||
GPT.NotifyCounter = INSTRUCTION.notifyRate - 20;
|
||||
notifyFirst_flag = false;
|
||||
}
|
||||
vscanReset = false;
|
||||
leadTimeReset = false;
|
||||
}
|
||||
|
||||
//vscan counter
|
||||
GPT.VscanRateCounter = GPT.VscanRateCounter + GPT.DeltaGptimerCounter;
|
||||
|
||||
if (vscanReset) {
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, 25000));
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, 25000));
|
||||
//vscanReset = false;
|
||||
}else{
|
||||
test_Vscan(WorkModeData->PULSE);
|
||||
}
|
||||
|
||||
// if(GPT.VscanRateCounter >= INSTRUCTION.VsetRate){
|
||||
// if(GPT.VscanRateCounter >= INSTRUCTION.VsetRate * 2){
|
||||
// GPT.GptimerMultiple = GPT.VscanRateCounter / INSTRUCTION.VsetRate;
|
||||
// }else{
|
||||
// GPT.GptimerMultiple = 1;
|
||||
// }
|
||||
// GPT.VscanRateCounter -= INSTRUCTION.VsetRate * GPT.GptimerMultiple; //To get right time
|
||||
// vscan_flag = true;
|
||||
// if(vscan_flag){
|
||||
// EliteVscanControl(WorkModeData);
|
||||
// vscan_flag = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
//battery counter
|
||||
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
|
||||
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
|
||||
if(GPT.BatteryCheckCounter >= 50000){
|
||||
GPT.BatteryCheckCounter -= 50000; //To get right time
|
||||
batteryCheck_flag = true;
|
||||
}
|
||||
|
||||
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) | ((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
|
||||
if( bat < 768 && bat > 20){
|
||||
PIN15_setOutputValue(enable_5v, 0);
|
||||
}
|
||||
|
||||
//ADC counter
|
||||
GPT.SampleRateCounter = GPT.SampleRateCounter + GPT.DeltaGptimerCounter;
|
||||
if(GPT.SampleRateCounter >= INSTRUCTION.sampleRate){
|
||||
GPT.SampleRateCounter = 0; //To get right data, ADC must be delay 1.5ms
|
||||
ADC_flag = true;
|
||||
if(ADC_flag){
|
||||
EliteADCControl(WorkModeData);
|
||||
ADC_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Notify counter(Notify control, check if we need to send notify)
|
||||
//please don't put Notify counter before ADC counter, maybe get wrong data
|
||||
GPT.NotifyCounter = GPT.NotifyCounter + GPT.DeltaGptimerCounter;
|
||||
if(GPT.NotifyCounter >= INSTRUCTION.notifyRate){
|
||||
GPT.NotifyCounter -= INSTRUCTION.notifyRate; //To get right time
|
||||
notify_flag = true;
|
||||
if(vscanReset){
|
||||
notify_flag = false;
|
||||
}
|
||||
if(notify_flag){
|
||||
SendNotify();
|
||||
notify_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
// EliteDone();
|
||||
}
|
||||
else if(INSTRUCTION.eliteFxn == VOLT_OUTPUT){
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
WorkModeData->VO->_Vset = INSTRUCTION.VoltConstant;
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, WorkModeData->VO->_Vset)); //UserCode -> DAC code -> DAC out
|
||||
FreeWorkMode(WorkModeData);
|
||||
PeriodicEvent = false;
|
||||
}
|
||||
else if(INSTRUCTION.eliteFxn == CALI_DAC_MODE){
|
||||
DAC_outputV(INSTRUCTION.VoltConstant); //UserCode -> DAC code -> DAC out
|
||||
FreeWorkMode(WorkModeData);
|
||||
PeriodicEvent = false;
|
||||
}
|
||||
else{
|
||||
// IT, VT need only ADC measure
|
||||
return;
|
||||
// InitFlag();
|
||||
}
|
||||
}
|
||||
|
||||
static void EliteADCControl(CURRENT_USER_CODE *CurrentUserCode) {
|
||||
if (SampleRate_counter == INSTRUCTION.SampleRate-1) {
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IV_CURVE:{
|
||||
IT_Plot();
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
IT_Plot();
|
||||
break;
|
||||
}
|
||||
case IT_CURVE:{
|
||||
IT_Plot();
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
// read volt through ADC and put it into notify buffer
|
||||
VT_Plot();
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
ZT_Plot();
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
CCModeReadCurrent(CurrentUserCode);
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
static void EliteADCControl(WorkMode *WorkModeData) {
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IV_CURVE:{
|
||||
CC_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
CC_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
case IT_CURVE:{
|
||||
IT_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
case VT_CURVE:{
|
||||
VT_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
CC_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
CC_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
CC_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
CC_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
CC_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
case CALI_ADC_MODE:{
|
||||
if(INSTRUCTION.AdcChannel == IIN_ADC){
|
||||
cali_IT_plot(WorkModeData);
|
||||
}else if(INSTRUCTION.AdcChannel == VIN_ADC){
|
||||
cali_VT_plot(WorkModeData);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
CC_Plot(WorkModeData);
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void EliteNotifyControl() {
|
||||
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
|
||||
// output the last notify, and reset Elite
|
||||
static void EliteDone() {
|
||||
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE) || (INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY)) {
|
||||
if (!PeriodicEvent) {
|
||||
SendNotify();
|
||||
reset();
|
||||
} else if (StepTimeCounter == INSTRUCTION.StepTime - 1) {
|
||||
SendNotify();
|
||||
Eliteinterrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (SampleRate_counter == INSTRUCTION.SampleRate) {
|
||||
SendNotify();
|
||||
static void EliteVscanControl(WorkMode *WorkModeData) {
|
||||
switch (INSTRUCTION.eliteFxn) {
|
||||
case IV_CURVE:{
|
||||
IV_Vscan(WorkModeData->IV);
|
||||
break;
|
||||
}
|
||||
case CV_CURVE:{
|
||||
CV_Vscan(WorkModeData->CV);
|
||||
break;
|
||||
}
|
||||
case ZT_CURVE:{
|
||||
ZT_Vscan(WorkModeData->RT);
|
||||
break;
|
||||
}
|
||||
case CYCLIC_VOLTAMMETRY:{
|
||||
CV3_Vscan(WorkModeData->CV3);
|
||||
break;
|
||||
}
|
||||
case CONSTANT_CURRENT:{
|
||||
CC_Vscan(WorkModeData->CC);
|
||||
break;
|
||||
}
|
||||
case LINEAR_SWEEP_VOLTAMMETRY:{
|
||||
LSV_Vscan(WorkModeData->LSV);
|
||||
break;
|
||||
}
|
||||
case CONSTANT_VSCAN:{
|
||||
CVSCAN_Vscan(WorkModeData->CVSCAN);
|
||||
break;
|
||||
}
|
||||
case PULSE_MODE:{
|
||||
PULSE_Vscan(WorkModeData->PULSE);
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static uint16_t StepCode2DACcode(uint16_t StepCode){
|
||||
return (StepCode * 0x0005);
|
||||
}
|
||||
|
||||
static uint16_t OldStep2NewStepTime(uint8_t StepTime) {
|
||||
static uint32_t OldStep2NewStepTime(uint32_t StepTime){
|
||||
uint8_t StepTimeLevel = 0;
|
||||
StepTimeLevel = StepTime / 0x12;
|
||||
|
||||
switch (StepTimeLevel) {
|
||||
case 0: { //0.5 sec
|
||||
LED_color(LIGHTLED, 0xFF, 0xFF, 0xFF);
|
||||
return STEPTIME_HALF_SEC;
|
||||
}
|
||||
case 1: { //1 sec
|
||||
return STEPTIME_ONE_SEC;
|
||||
}
|
||||
case 2: { //2 sec
|
||||
return STEPTIME_TWO_SEC;
|
||||
}
|
||||
default: { //1 sec
|
||||
return STEPTIME_ONE_SEC;
|
||||
}
|
||||
case 0: { //0.5 sec
|
||||
return STEPTIME_HALF_SEC;
|
||||
}
|
||||
case 1: { //1 sec
|
||||
return STEPTIME_ONE_SEC;
|
||||
}
|
||||
case 2: { //2 sec
|
||||
return STEPTIME_TWO_SEC;
|
||||
}
|
||||
default: { //1 sec
|
||||
return STEPTIME_ONE_SEC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void step2VsetRate(uint32_t step){
|
||||
/*step = 100 mv, index = 0, n = 2
|
||||
10 mv, index = 1, n = 10
|
||||
1 mv, index = 2, n = 100
|
||||
0.1 mv, index = 3, n = 1000
|
||||
0.01mv, index = 4, n = 10000 */
|
||||
|
||||
if(step >= 10000){
|
||||
INSTRUCTION.VsetRateIndex = 0;
|
||||
}else if (step >= 1000){
|
||||
INSTRUCTION.VsetRateIndex = 1;
|
||||
}else if (step >= 100){
|
||||
INSTRUCTION.VsetRateIndex = 2;
|
||||
}else if (step >= 10){
|
||||
INSTRUCTION.VsetRateIndex = 3;
|
||||
}else if (step >= 1){
|
||||
INSTRUCTION.VsetRateIndex = 4;
|
||||
}
|
||||
}
|
||||
|
||||
static void InitFlag(){
|
||||
PeriodicEvent = false; // is there an PeriodicEvent?
|
||||
Free_Work_Mode = true; // Free(WorkModeData)
|
||||
}
|
||||
|
||||
static void InitEliteGPtimer() {
|
||||
GPT.SampleRateCounter = INSTRUCTION.sampleRate - 10;
|
||||
GPT.VscanRateCounter = INSTRUCTION.VsetRate - 1;
|
||||
notifyFirst_flag = true;
|
||||
}
|
||||
|
||||
static void InitEliteFlag() {
|
||||
InitPeriodicEvent = true; // need to create a WorkModeData?
|
||||
DACReset = true;
|
||||
vscanReset = true;
|
||||
EliteWorkReset = true;
|
||||
leadTimeReset = true;
|
||||
I_GAIN_100R_counter = 0;
|
||||
I_GAIN_3K_counter = 0;
|
||||
I_GAIN_100K_counter = 0;
|
||||
I_GAIN_3M_counter = 0;
|
||||
}
|
||||
#endif /* IMPEDANCE_METER_H_ */
|
||||
|
||||
+49
-52
@@ -529,7 +529,7 @@ static void SimpleBLEPeripheral_init(void) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "EliteWorkData.h"
|
||||
/*********************************************************************
|
||||
* @fn SimpleBLEPeripheral_taskFxn
|
||||
*
|
||||
@@ -544,28 +544,28 @@ static void SimpleBLEPeripheral_init(void) {
|
||||
|
||||
static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
|
||||
|
||||
#define CLOCK_ONE_SECOND 10000
|
||||
// Initialize application
|
||||
SimpleBLEPeripheral_init();
|
||||
headstage_init_device_info();
|
||||
|
||||
ZM_init();
|
||||
|
||||
Elite_SPI_init();
|
||||
I2Cinit();
|
||||
CURRENT_USER_CODE *CurrentUserCode = InitCurrentUserCode();
|
||||
LEDPowerON();
|
||||
|
||||
// uint8_t key_BAT = 0;
|
||||
uint8_t key = 0;
|
||||
uint16_t counter6994 = 0;
|
||||
bool EliteOn = 0;
|
||||
WorkMode *WorkModeData = CreateWorkMode();
|
||||
|
||||
// init DAC, set output ~= 0 V
|
||||
// DAC_outputV(Usercode_Correction_to_DAC(24999));
|
||||
INSTRUCTION.VoutGainLevel = VOUT_GAIN_15K;
|
||||
VoutGainControl(INSTRUCTION.VoutGainLevel);
|
||||
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, 25000));
|
||||
|
||||
uint8_t key = 0;
|
||||
uint16_t counter6994 = 0;
|
||||
bool EliteOn = 0;
|
||||
|
||||
elite_gptimer_start();
|
||||
|
||||
// Application main loops
|
||||
GPT.GptimerCounter0 = GPT.GptimerCounter;
|
||||
batteryADC_flag = false;
|
||||
headstage_battery_volt();
|
||||
headstage_init_device_info();
|
||||
|
||||
for (;;) {
|
||||
// Waits for a signal to the semaphore associated with the calling thread.
|
||||
// Note that the semaphore associated with a thread is signaled when a
|
||||
@@ -615,58 +615,44 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
|
||||
}
|
||||
if(events & SBP_PERIODIC_EVT){
|
||||
events &= ~SBP_PERIODIC_EVT;
|
||||
|
||||
// test LED functionality for Elite BAT
|
||||
// key_BAT = PIN_getInputValue(switch_on);
|
||||
// if (!key_BAT) {
|
||||
// LED_color(DARKLED, 0x00, 0x99, 0x00); // green LED
|
||||
// } else {
|
||||
// LED_color(DARKLED, 0x99, 0x00, 0x00); // red LED
|
||||
// }
|
||||
// PIN_setOutputValue(pin_handle, power_enable, 1);
|
||||
// LED_color(DARKLED, 0x00, 0x00, 0x99); // blue LED
|
||||
|
||||
if (!PeriodicEvent) { // if there is no periodic event
|
||||
if (!PeriodicEvent) { // if there is no periodic event
|
||||
key = PIN_getInputValue(switch_on);
|
||||
if (EliteOn) {
|
||||
if (counter6994 < CLOCK_ONE_SECOND/2) { // counter6994 enable a IC after 35 counts
|
||||
if (counter6994 < CLOCK_ONE_SECOND*5) { // counter6994 enable a IC after 35 counts
|
||||
counter6994++;
|
||||
} else if (counter6994 == CLOCK_ONE_SECOND/2) {
|
||||
PIN_setOutputValue(pin_handle, shutdown_6994, 1); // OFF = 1 => turn off 6994
|
||||
#ifdef ELITE_VERSION_1_4
|
||||
SPI_close(spiHandle0);
|
||||
I2Cinit();
|
||||
I2C_close(I2Chandle);
|
||||
spiHandle0 = SPI_open(Board_SPI0, &spiParams0); // LED SPI
|
||||
#endif
|
||||
} else if (counter6994 == CLOCK_ONE_SECOND*5) {
|
||||
PIN15_setOutputValue(shutdown_6994, 0); // OFF = 1 => turn off 6994
|
||||
counter6994++;
|
||||
} else if (counter6994 > CLOCK_ONE_SECOND*5) {
|
||||
counter6994 = 0;
|
||||
}
|
||||
EliteKeyPress(key);
|
||||
|
||||
if(key != 0){ //detect Elite battery power when no periodic event
|
||||
measureBat();
|
||||
}
|
||||
if(Free_Work_Mode){
|
||||
FreeWorkMode(WorkModeData);
|
||||
InitEliteInstruction();
|
||||
Free_Work_Mode = false;
|
||||
}
|
||||
} else {
|
||||
EliteOn = TurnOnElite(key);
|
||||
}
|
||||
}
|
||||
// if there is periodic event
|
||||
else {
|
||||
// Perform periodic application task
|
||||
SimpleBLEPeripheral_performPeriodicTask(CurrentUserCode);
|
||||
else { // if there is periodic event
|
||||
if(InitPeriodicEvent){
|
||||
InitWorkMode(WorkModeData);
|
||||
InitPeriodicEvent = false;
|
||||
}
|
||||
|
||||
// Perform periodic application task
|
||||
SimpleBLEPeripheral_performPeriodicTask(WorkModeData);
|
||||
key = PIN_getInputValue(switch_on);
|
||||
EliteKeyPress(key); // onPress=> key = 0; 1.lighten LED 2.long press shut down 2650
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// if (events & SBP_PERIODIC_EVT)
|
||||
// {
|
||||
// events &= ~SBP_PERIODIC_EVT;
|
||||
// Util_startClock(&periodicClock);
|
||||
// Perform periodic application task
|
||||
// SimpleBLEPeripheral_performPeriodicTask();
|
||||
// }
|
||||
|
||||
// headstage_gptimer_main_handle();
|
||||
|
||||
#ifdef FEATURE_OAD
|
||||
while (!Queue_empty(hOadQ)) {
|
||||
oadTargetWrite_t *oadWriteEvt = Queue_get(hOadQ);
|
||||
@@ -940,6 +926,17 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
|
||||
|
||||
numActive = linkDB_NumActive();
|
||||
|
||||
// uint16_t cxnHandle;
|
||||
//
|
||||
// // requestedPDUSize = LL payload = L2CAP_header + ATT header + BLE_NOT_BUFF_SIZE = 7 + BLE_NOT_BUFF_SIZE //roy
|
||||
// uint16_t requestedPDUSize = 251; //251 roy
|
||||
// uint16_t requestTxTime = 2120; // (LL payload + 14) * 8 //2120 roy
|
||||
// GAPRole_GetParameter(GAPROLE_CONNHANDLE, &cxnHandle);
|
||||
//
|
||||
// if (SUCCESS == HCI_LE_SetDataLenCmd(cxnHandle, requestedPDUSize, requestTxTime)) {
|
||||
//// LED_color(DARKLED, 0xFF, 0x00, 0xFF);
|
||||
// }
|
||||
|
||||
// Use numActive to determine the connection handle of the last
|
||||
// connection
|
||||
if (linkDB_GetInfo(numActive - 1, &linkInfo) == SUCCESS) {
|
||||
@@ -974,7 +971,7 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
|
||||
|
||||
case GAPROLE_WAITING:
|
||||
SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
|
||||
|
||||
ModeLED(BT_WAIT);
|
||||
break;
|
||||
|
||||
case GAPROLE_WAITING_AFTER_TIMEOUT:
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
|
||||
#input="./Elite_test.txt"
|
||||
input="D:/Elite/Calibration_data/$1.txt"
|
||||
output="./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDeviceCorrection.h"
|
||||
|
||||
#variable
|
||||
declare -i current_line=79
|
||||
declare -i col_index=0
|
||||
declare -i row_index=0
|
||||
#declare -i coeff=1
|
||||
#declare -i offset=0
|
||||
|
||||
declare -i current_gain=0
|
||||
#declare -i vin_gain=0
|
||||
#declare -i vout_gain=0
|
||||
MAC="MAC"
|
||||
|
||||
#constant
|
||||
declare -i ADC_CURRENT_GAIN_NUMBER=3
|
||||
declare -i ADC_VOLTAGE_GAIN_NUMBER=1
|
||||
declare -i DAC_GAIN_NUMBER=1
|
||||
|
||||
while read -r line; do
|
||||
for word in $line; do
|
||||
# get device MAC
|
||||
if [ $row_index -eq 0 ] && [ $col_index -eq 1 ];then
|
||||
MAC=$word
|
||||
sed -i "${current_line} i {" "$output"
|
||||
sed -i "${current_line} i \\\n#ifdef BOARD_${MAC}" "$output"
|
||||
sed -i 's/:/_/g' "$output"
|
||||
current_line=$current_line+3
|
||||
fi
|
||||
|
||||
#get ADC current cali data
|
||||
declare -i Iin_range=2+$ADC_CURRENT_GAIN_NUMBER
|
||||
if [ $row_index -gt 1 ] && [ $row_index -lt $Iin_range ];then
|
||||
|
||||
if [ $col_index -eq 1 ];then
|
||||
sed -i "${current_line} i \\\t.ADC_current[${current_gain}].coeff = ($word)," "$output"
|
||||
current_line=$current_line+1
|
||||
|
||||
elif [ $col_index -eq 2 ];then
|
||||
sed -i "${current_line} i \\\t.ADC_current[${current_gain}].offset = ($word)," "$output"
|
||||
current_line=$current_line+1
|
||||
|
||||
if [ $current_gain -lt 2 ];then
|
||||
current_gain=$current_gain+1
|
||||
else
|
||||
current_gain=0
|
||||
fi
|
||||
fi
|
||||
|
||||
#get DAC Vout cali data
|
||||
declare -i Vout_range=$Iin_range+$DAC_GAIN_NUMBER
|
||||
elif [ $row_index -gt 1 ] && [ $row_index -lt $Vout_range ];then
|
||||
if [ $col_index -eq 1 ];then
|
||||
sed -i "${current_line} i \\\t.Usercode2DAC.coeff = ($word)," "$output"
|
||||
current_line=$current_line+1
|
||||
|
||||
elif [ $col_index -eq 2 ];then
|
||||
sed -i "${current_line} i \\\t.Usercode2DAC.offset = ($word)," "$output"
|
||||
current_line=$current_line+1
|
||||
fi
|
||||
|
||||
#get ADC Vin cali data
|
||||
declare -i Vin_range=$Vout_range+$ADC_VOLTAGE_GAIN_NUMBER
|
||||
elif [ $row_index -gt 1 ] && [ $row_index -lt $Vin_range ];then
|
||||
if [ $col_index -eq 1 ];then
|
||||
sed -i "${current_line} i \\\t.ADC_volt.coeff = ($word)," "$output"
|
||||
current_line=$current_line+1
|
||||
|
||||
elif [ $col_index -eq 2 ];then
|
||||
sed -i "${current_line} i \\\t.ADC_volt.offset = ($word)," "$output"
|
||||
current_line=$current_line+1
|
||||
fi
|
||||
fi
|
||||
|
||||
#update index
|
||||
if [ $col_index -lt 2 ];then
|
||||
col_index=$col_index+1
|
||||
else
|
||||
col_index=0
|
||||
row_index=$row_index+1
|
||||
fi
|
||||
done
|
||||
done < $input
|
||||
|
||||
sed -i "${current_line} i };" "$output"
|
||||
current_line=$current_line+1
|
||||
sed -i "${current_line} i #endif" "$output"
|
||||
Reference in New Issue
Block a user