Cubebite Publish
Fork of HelloWorld_IDS01A4 by
main.h@14:1a6faeda6579, 2018-02-13 (annotated)
- Committer:
- jmhong
- Date:
- Tue Feb 13 06:35:39 2018 +0000
- Revision:
- 14:1a6faeda6579
180213 HJM commit;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| jmhong | 14:1a6faeda6579 | 1 | #pragma once |
| jmhong | 14:1a6faeda6579 | 2 | |
| jmhong | 14:1a6faeda6579 | 3 | #ifndef __MBED_H__ |
| jmhong | 14:1a6faeda6579 | 4 | #define __MBED_H__ |
| jmhong | 14:1a6faeda6579 | 5 | #include "mbed.h" |
| jmhong | 14:1a6faeda6579 | 6 | #endif //__MBED_H__ |
| jmhong | 14:1a6faeda6579 | 7 | |
| jmhong | 14:1a6faeda6579 | 8 | #ifndef __SIMPLESPIRIT1_H__ |
| jmhong | 14:1a6faeda6579 | 9 | #define __SIMPLESPIRIT1_H__ |
| jmhong | 14:1a6faeda6579 | 10 | #include "SimpleSpirit1.h" |
| jmhong | 14:1a6faeda6579 | 11 | #endif //__SIMPLESPIRIT1_H__ |
| jmhong | 14:1a6faeda6579 | 12 | |
| jmhong | 14:1a6faeda6579 | 13 | |
| jmhong | 14:1a6faeda6579 | 14 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 15 | //Global variable : LEDs and user buttons by board |
| jmhong | 14:1a6faeda6579 | 16 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 17 | #ifdef CUBEBITE_BOARD_F401RE |
| jmhong | 14:1a6faeda6579 | 18 | static DigitalOut TestLED(D5); /* LED of IDS01A4/5 */ |
| jmhong | 14:1a6faeda6579 | 19 | #endif |
| jmhong | 14:1a6faeda6579 | 20 | |
| jmhong | 14:1a6faeda6579 | 21 | #ifdef CUBEBITE_BOARD_F746ZG |
| jmhong | 14:1a6faeda6579 | 22 | static DigitalOut TestLED(PB_0); /* LED of IDS01A4/5 */ |
| jmhong | 14:1a6faeda6579 | 23 | static DigitalOut TestLED2(PB_7); /* LED of IDS01A4/5 */ |
| jmhong | 14:1a6faeda6579 | 24 | static DigitalOut TestLED3(PB_14); /* LED of IDS01A4/5 */ |
| jmhong | 14:1a6faeda6579 | 25 | #endif |
| jmhong | 14:1a6faeda6579 | 26 | |
| jmhong | 14:1a6faeda6579 | 27 | #ifdef CUBEBITE_RF_USER_BUTTON_SEND_TEST |
| jmhong | 14:1a6faeda6579 | 28 | static InterruptIn event(USER_BUTTON); /* Interrupt event to give userinterface to send pkt. */ |
| jmhong | 14:1a6faeda6579 | 29 | #endif |
| jmhong | 14:1a6faeda6579 | 30 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 31 | |
| jmhong | 14:1a6faeda6579 | 32 | |
| jmhong | 14:1a6faeda6579 | 33 | |
| jmhong | 14:1a6faeda6579 | 34 | |
| jmhong | 14:1a6faeda6579 | 35 | |
| jmhong | 14:1a6faeda6579 | 36 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 37 | //Global variable : Rf Send, read Buffer |
| jmhong | 14:1a6faeda6579 | 38 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 39 | /* 180108 cubebite HJM : send testing, orignal code */ |
| jmhong | 14:1a6faeda6579 | 40 | #define TEST_STR_LEN (32) |
| jmhong | 14:1a6faeda6579 | 41 | static uint8_t uiSendBuf[TEST_STR_LEN] ={'S','P','I','R','I','T','1',' ','H','E','L','L','O',' ','W','O','R','L','D',' ','P','2','P',' ','D','E','M','O'}; |
| jmhong | 14:1a6faeda6579 | 42 | static uint8_t uiRendBuf[TEST_STR_LEN] ={'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; |
| jmhong | 14:1a6faeda6579 | 43 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 44 | |
| jmhong | 14:1a6faeda6579 | 45 | |
| jmhong | 14:1a6faeda6579 | 46 | |
| jmhong | 14:1a6faeda6579 | 47 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 48 | //Global variable : tx, rx Flag |
| jmhong | 14:1a6faeda6579 | 49 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 50 | static volatile bool bRxDoneFlag = false; |
| jmhong | 14:1a6faeda6579 | 51 | static volatile bool bTxDoneFlag = false; |
| jmhong | 14:1a6faeda6579 | 52 | static volatile bool bSendDataFlag = false; |
| jmhong | 14:1a6faeda6579 | 53 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 54 | |
| jmhong | 14:1a6faeda6579 | 55 | |
| jmhong | 14:1a6faeda6579 | 56 | |
| jmhong | 14:1a6faeda6579 | 57 | |
| jmhong | 14:1a6faeda6579 | 58 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 59 | //Global variable : Testing |
| jmhong | 14:1a6faeda6579 | 60 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 61 | |
| jmhong | 14:1a6faeda6579 | 62 | /* Test : RF Speed Test */ |
| jmhong | 14:1a6faeda6579 | 63 | #ifdef CUBEBITE_RF_SPEED_TEST_SEND_ON |
| jmhong | 14:1a6faeda6579 | 64 | static clock_t clocktimeRFSpeedTestStart, clocktimeRFSpeedTestEnd; |
| jmhong | 14:1a6faeda6579 | 65 | static float fRfSpeedTestResultTime; |
| jmhong | 14:1a6faeda6579 | 66 | |
| jmhong | 14:1a6faeda6579 | 67 | static bool bIsSendFirstClockFunctionStarted = false; |
| jmhong | 14:1a6faeda6579 | 68 | static bool bIsSetSendFlag = false; |
| jmhong | 14:1a6faeda6579 | 69 | #endif |
| jmhong | 14:1a6faeda6579 | 70 | |
| jmhong | 14:1a6faeda6579 | 71 | |
| jmhong | 14:1a6faeda6579 | 72 | #ifdef CUBEBITE_RF_SPEED_TEST_RECV_ON |
| jmhong | 14:1a6faeda6579 | 73 | #define TEST_ACK_STR_LEN (6) |
| jmhong | 14:1a6faeda6579 | 74 | static uint8_t uiSendAckBuf[TEST_ACK_STR_LEN] ={'O','K'}; |
| jmhong | 14:1a6faeda6579 | 75 | size_t sizetCurrAckBufLen = strlen((const char*)uiSendAckBuf) + 1; |
| jmhong | 14:1a6faeda6579 | 76 | |
| jmhong | 14:1a6faeda6579 | 77 | static bool bIsAckSended = false; |
| jmhong | 14:1a6faeda6579 | 78 | #endif |
| jmhong | 14:1a6faeda6579 | 79 | //************************************************************************************* |
| jmhong | 14:1a6faeda6579 | 80 | |
| jmhong | 14:1a6faeda6579 | 81 | |
| jmhong | 14:1a6faeda6579 | 82 | |
| jmhong | 14:1a6faeda6579 | 83 | |
| jmhong | 14:1a6faeda6579 | 84 | |
| jmhong | 14:1a6faeda6579 | 85 | |
| jmhong | 14:1a6faeda6579 | 86 | |
| jmhong | 14:1a6faeda6579 | 87 | |
| jmhong | 14:1a6faeda6579 | 88 | |
| jmhong | 14:1a6faeda6579 | 89 | |
| jmhong | 14:1a6faeda6579 | 90 | |
| jmhong | 14:1a6faeda6579 | 91 | |
| jmhong | 14:1a6faeda6579 | 92 | |
| jmhong | 14:1a6faeda6579 | 93 | |
| jmhong | 14:1a6faeda6579 | 94 |
