Arianna autonomous DAQ firmware
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
SnLPC1768UID.cpp@116:8099b754fbb4, 2016-05-03 (annotated)
- Committer:
- uci1
- Date:
- Tue May 03 02:01:35 2016 +0000
- Revision:
- 116:8099b754fbb4
One program for all stns via UID/MAC lookup table or generation. Status sends number trg/evt and livetime, not rates. Add 512 sample evt and RFFT-LUTs. Add L1Scaledown trg bit. Allow skip SST reset at start. Fix dt at end of seq. End of comm signal.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
uci1 | 116:8099b754fbb4 | 1 | #include "SnLPC1768UID.h" |
uci1 | 116:8099b754fbb4 | 2 | |
uci1 | 116:8099b754fbb4 | 3 | #include "mbed.h" |
uci1 | 116:8099b754fbb4 | 4 | |
uci1 | 116:8099b754fbb4 | 5 | /* |
uci1 | 116:8099b754fbb4 | 6 | * How to read LPC1768 part ID and device serial number |
uci1 | 116:8099b754fbb4 | 7 | * Dan Minear |
uci1 | 116:8099b754fbb4 | 8 | * 2012-11-08 |
uci1 | 116:8099b754fbb4 | 9 | */ |
uci1 | 116:8099b754fbb4 | 10 | |
uci1 | 116:8099b754fbb4 | 11 | #define IAP_LOCATION 0x1FFF1FF1 |
uci1 | 116:8099b754fbb4 | 12 | |
uci1 | 116:8099b754fbb4 | 13 | typedef void (*IAP)(uint32_t [], uint32_t[] ); |
uci1 | 116:8099b754fbb4 | 14 | IAP iap_entry = (IAP) IAP_LOCATION; |
uci1 | 116:8099b754fbb4 | 15 | |
uci1 | 116:8099b754fbb4 | 16 | bool SnLPC1768UID::GetUID(uint32_t uid[SnLPC1768UID::kUIDlen]) { |
uci1 | 116:8099b754fbb4 | 17 | #ifdef DEBUG |
uci1 | 116:8099b754fbb4 | 18 | printf("SnLPC1768UID::GetUID ... \r\n"); |
uci1 | 116:8099b754fbb4 | 19 | #endif |
uci1 | 116:8099b754fbb4 | 20 | // 58 here asks for the UID of the chip |
uci1 | 116:8099b754fbb4 | 21 | static const uint8_t kLenCmd = kUIDlen + 1; |
uci1 | 116:8099b754fbb4 | 22 | uint32_t command[kLenCmd] = {58,0,0,0,0}; |
uci1 | 116:8099b754fbb4 | 23 | uint32_t result[kLenCmd] = {0,0,0,0,0}; |
uci1 | 116:8099b754fbb4 | 24 | iap_entry(command, result); |
uci1 | 116:8099b754fbb4 | 25 | if (result[0] == 0) { |
uci1 | 116:8099b754fbb4 | 26 | for(int i = 0; i < kUIDlen; ++i) { |
uci1 | 116:8099b754fbb4 | 27 | uid[i] = result[i+1]; |
uci1 | 116:8099b754fbb4 | 28 | #ifdef DEBUG |
uci1 | 116:8099b754fbb4 | 29 | printf( "0x%08X\r\n", uid[i] ); |
uci1 | 116:8099b754fbb4 | 30 | #endif |
uci1 | 116:8099b754fbb4 | 31 | } |
uci1 | 116:8099b754fbb4 | 32 | return true; |
uci1 | 116:8099b754fbb4 | 33 | |
uci1 | 116:8099b754fbb4 | 34 | } else { |
uci1 | 116:8099b754fbb4 | 35 | #ifdef DEBUG |
uci1 | 116:8099b754fbb4 | 36 | printf("Status error!\r\n"); |
uci1 | 116:8099b754fbb4 | 37 | #endif |
uci1 | 116:8099b754fbb4 | 38 | |
uci1 | 116:8099b754fbb4 | 39 | } |
uci1 | 116:8099b754fbb4 | 40 | return false; |
uci1 | 116:8099b754fbb4 | 41 | }; |