yan zhang
/
NB_CLOCK_180505
clock
myKnow/myknow.h@3:b8766d623f01, 2018-05-22 (annotated)
- Committer:
- donghuoyinzi
- Date:
- Tue May 22 09:10:05 2018 +0000
- Revision:
- 3:b8766d623f01
- Parent:
- 1:013b9fdc4e78
0522
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donghuoyinzi | 0:17e9016529cf | 1 | #include "mbed.h" |
donghuoyinzi | 0:17e9016529cf | 2 | |
donghuoyinzi | 0:17e9016529cf | 3 | #ifndef know_H |
donghuoyinzi | 0:17e9016529cf | 4 | #define know_H |
donghuoyinzi | 0:17e9016529cf | 5 | |
donghuoyinzi | 3:b8766d623f01 | 6 | #define TSK_MAX_LEN 50 |
donghuoyinzi | 3:b8766d623f01 | 7 | #define DAT_MAX_LEN 50 |
donghuoyinzi | 3:b8766d623f01 | 8 | |
donghuoyinzi | 0:17e9016529cf | 9 | #define UART1_TX PA_9 //MCU TX1 |
donghuoyinzi | 0:17e9016529cf | 10 | #define UART1_RX PA_10 //MCU RX1 |
donghuoyinzi | 0:17e9016529cf | 11 | #define UART2_TX PA_2 //MCU TX2 |
donghuoyinzi | 0:17e9016529cf | 12 | #define UART2_RX PA_3 //MCU RX2 |
donghuoyinzi | 3:b8766d623f01 | 13 | #define UART3_TX PB_10 //BC95 RXPA_11 |
donghuoyinzi | 3:b8766d623f01 | 14 | #define UART3_RX PB_11 //BC95 TXPA_12 |
donghuoyinzi | 0:17e9016529cf | 15 | |
donghuoyinzi | 0:17e9016529cf | 16 | #define SECOND_T0 PB_13 //输出驱动马达-秒针 |
donghuoyinzi | 0:17e9016529cf | 17 | #define SECOND_T1 PB_12 //输出驱动马达-秒针 |
donghuoyinzi | 0:17e9016529cf | 18 | #define MINITUE_T0 PB_15 //输出驱动马达-分针 |
donghuoyinzi | 0:17e9016529cf | 19 | #define MINITUE_T1 PB_14 //输出驱动马达-分针 |
donghuoyinzi | 0:17e9016529cf | 20 | |
donghuoyinzi | 0:17e9016529cf | 21 | #define JCVIN PA_4 //马达检测输入 |
donghuoyinzi | 0:17e9016529cf | 22 | #define JCOUT_SE PA_5 //马达秒针检测输出 |
donghuoyinzi | 0:17e9016529cf | 23 | #define JCOUT_MI PA_6 //马达分针检测输出 |
donghuoyinzi | 0:17e9016529cf | 24 | |
donghuoyinzi | 0:17e9016529cf | 25 | #define BATAD PA_7 //batteryAD 电量采集 |
donghuoyinzi | 0:17e9016529cf | 26 | #define POW PA_8 //bc95 电源 |
donghuoyinzi | 0:17e9016529cf | 27 | #define RESET PB_9 //BC95 复位 |
donghuoyinzi | 0:17e9016529cf | 28 | |
donghuoyinzi | 0:17e9016529cf | 29 | #define LED1 PB_0 //LED1 |
donghuoyinzi | 0:17e9016529cf | 30 | #define LED2 PB_1 //LED2 |
donghuoyinzi | 0:17e9016529cf | 31 | |
donghuoyinzi | 0:17e9016529cf | 32 | class know |
donghuoyinzi | 0:17e9016529cf | 33 | { |
donghuoyinzi | 0:17e9016529cf | 34 | public: |
donghuoyinzi | 3:b8766d623f01 | 35 | static char task[20][TSK_MAX_LEN]; //任务编址 |
donghuoyinzi | 3:b8766d623f01 | 36 | static char polSta[100]; //状态池 |
donghuoyinzi | 3:b8766d623f01 | 37 | static char polDat[10][DAT_MAX_LEN]; //数据池 |
donghuoyinzi | 0:17e9016529cf | 38 | |
donghuoyinzi | 0:17e9016529cf | 39 | static Serial uart1; |
donghuoyinzi | 0:17e9016529cf | 40 | static Serial uart2; |
donghuoyinzi | 0:17e9016529cf | 41 | static Serial uart3; |
donghuoyinzi | 0:17e9016529cf | 42 | |
donghuoyinzi | 0:17e9016529cf | 43 | static DigitalOut MotS0; |
donghuoyinzi | 0:17e9016529cf | 44 | static DigitalOut MotS1; |
donghuoyinzi | 0:17e9016529cf | 45 | static DigitalOut MotM0; |
donghuoyinzi | 0:17e9016529cf | 46 | static DigitalOut MotM1; |
donghuoyinzi | 0:17e9016529cf | 47 | |
donghuoyinzi | 0:17e9016529cf | 48 | static DigitalOut TestO_S; |
donghuoyinzi | 0:17e9016529cf | 49 | static DigitalOut TestO_M; |
donghuoyinzi | 0:17e9016529cf | 50 | static InterruptIn TestIn; |
donghuoyinzi | 0:17e9016529cf | 51 | |
donghuoyinzi | 0:17e9016529cf | 52 | static AnalogIn batAD; |
donghuoyinzi | 0:17e9016529cf | 53 | static DigitalOut pow; |
donghuoyinzi | 0:17e9016529cf | 54 | static DigitalOut reset; |
donghuoyinzi | 0:17e9016529cf | 55 | |
donghuoyinzi | 0:17e9016529cf | 56 | static DigitalOut led1; |
donghuoyinzi | 0:17e9016529cf | 57 | static DigitalOut led2; |
donghuoyinzi | 0:17e9016529cf | 58 | |
donghuoyinzi | 0:17e9016529cf | 59 | static Ticker time1; //定时器1 |
donghuoyinzi | 0:17e9016529cf | 60 | static Ticker time2; //定时器2 |
donghuoyinzi | 0:17e9016529cf | 61 | static Ticker time3; //定时器3 |
donghuoyinzi | 0:17e9016529cf | 62 | }; |
donghuoyinzi | 0:17e9016529cf | 63 | |
donghuoyinzi | 0:17e9016529cf | 64 | class knowAct |
donghuoyinzi | 0:17e9016529cf | 65 | { |
donghuoyinzi | 0:17e9016529cf | 66 | public: |
donghuoyinzi | 0:17e9016529cf | 67 | static void buildtsk(void); // |
donghuoyinzi | 0:17e9016529cf | 68 | }; |
donghuoyinzi | 0:17e9016529cf | 69 | |
donghuoyinzi | 0:17e9016529cf | 70 | #endif |