| | |
| | | unsigned int TickPrioduS; //
|
| | | volatile unsigned int nCurTick=0;
|
| | | volatile unsigned int CurTickuS=0;
|
| | | //volatile unsigned int ThisRunTime=0; //开机时间
|
| | | //volatile unsigned int TotalRunTime=0; //总开机时间
|
| | | //volatile unsigned int PwrCount=0; //开机次数
|
| | | unsigned short ClkuS; //每个Clk的nS数,
|
| | | //volatile unsigned int ThisRunTime=0; //开机时间
|
| | | //volatile unsigned int TotalRunTime=0; //总开机时间
|
| | | //volatile unsigned int PwrCount=0; //开机次数
|
| | | unsigned short ClkuS; //每个Clk的nS数,
|
| | |
|
| | | int InituS(int TickFreq1)
|
| | | {
|
| | | TickPrioduS=1000000/TickFreq1; //每个SysTick的微秒数
|
| | | CoreClkMHz=HAL_RCC_GetHCLKFreq()/1000000; //=SystemCoreClock/1000000;每uS的时钟数
|
| | | TickPriodClk=SystemCoreClock/TickFreq1; //每个SysTick的时钟数
|
| | | TickPrioduS=1000000/TickFreq1; //每个SysTick的微秒数
|
| | | CoreClkMHz=HAL_RCC_GetHCLKFreq()/1000000; //=SystemCoreClock/1000000;每uS的时钟数
|
| | | TickPriodClk=SystemCoreClock/TickFreq1; //每个SysTick的时钟数
|
| | | ClkuS=(1000000LL*65536)/SystemCoreClock;
|
| | | CurTickuS=TickPrioduS+100u;
|
| | | return 0;
|
| | |
| | | #endif
|
| | | if (Uart2Stat.bPacketRecved)
|
| | | {
|
| | | ParsePacket(2, (pPacket)Uart2RecvBuf1, Uart2RecvBuf1DataLen); |
| | | KBusParsePacket(2, (pPacket)Uart2RecvBuf1, Uart2RecvBuf1DataLen); |
| | | Uart2RecvBuf1DataLen=0;
|
| | | Uart2Stat.bPacketRecved=0;
|
| | | Uart2RecvDMA(Uart2RecvBuf1,sizeof(Uart2RecvBuf1));
|
| | |
| | | case 13:
|
| | | return Input165_R(16);
|
| | | case 14:
|
| | | return 0; //FP0
|
| | | return 0; //FP0
|
| | | case 15:
|
| | | return Input165_R(16);
|
| | | case 16:
|
| | | return Input165_R(8);
|
| | | |
| | | default:
|
| | | break;
|
| | | }
|
| | |
| | | case 14:
|
| | | return (~(LL_GPIO_ReadInputPort(GPIOA)>>4))&0x0f; //FP0
|
| | | case 15:
|
| | | case 16:
|
| | | return ReadConfig_5(); //Wireless Master Slave 8 in 8 o
|
| | | default:
|
| | |
|
| | |
| | | void Output595_8(unsigned int cc)
|
| | | {
|
| | | //unsigned char i;
|
| | | ;// 74HC595输出程序,输出8位
|
| | | ;// 74HC595输出程序,输出8位
|
| | | // cc=~0x3f;
|
| | | __disable_irq();
|
| | | STRCLK2_1();
|
| | |
| | | void Output595_16(unsigned int cc)
|
| | | {
|
| | | //unsigned char i;
|
| | | ;// 74HC595输出程序,输出8位
|
| | | ;// 74HC595输出程序,输出8位
|
| | | // cc=~0x3f;
|
| | | __disable_irq();
|
| | | STRCLK2_1();
|
| | |
| | | //Output595_16(Y);
|
| | | }
|
| | |
|
| | | #if (BOARD_TYPE == 9 || BOARD_TYPE == 10 || BOARD_TYPE == 15 )
|
| | | #if (BOARD_TYPE == 9 || BOARD_TYPE == 10 || BOARD_TYPE == 15 || BOARD_TYPE == 16)
|
| | | //#pragma message("9,10")
|
| | | // V4.2 管脚排列向右移动了一位。
|
| | | // V4.2 管脚排列向右移动了一位。
|
| | | #define SRCLK1_0() LL_GPIO_ResetOutputPin(GPIOB,LL_GPIO_PIN_1)
|
| | | #define SRCLK1_1() LL_GPIO_SetOutputPin(GPIOB,LL_GPIO_PIN_1)
|
| | | #define STRCLK1_0() LL_GPIO_ResetOutputPin(GPIOB,LL_GPIO_PIN_2)
|
| | |
| | | #define OE1_1() LL_GPIO_SetOutputPin(GPIOB,LL_GPIO_PIN_10)
|
| | | #define SER1_0() LL_GPIO_ResetOutputPin(GPIOB,LL_GPIO_PIN_11)
|
| | | #define SER1_1() LL_GPIO_SetOutputPin(GPIOB,LL_GPIO_PIN_11)
|
| | | #else //按照原来的管脚排列
|
| | | #else //按照原来的管脚排列
|
| | | #define SRCLK1_0() LL_GPIO_ResetOutputPin(GPIOB,LL_GPIO_PIN_0)
|
| | | #define SRCLK1_1() LL_GPIO_SetOutputPin(GPIOB,LL_GPIO_PIN_0)
|
| | | #define STRCLK1_0() LL_GPIO_ResetOutputPin(GPIOB,LL_GPIO_PIN_1)
|
| | |
| | | void displayInput(unsigned int cc)
|
| | | {
|
| | | //unsigned char i;
|
| | | ;// 74HC595输出程序,输出8位
|
| | | ;// 74HC595输出程序,输出8位
|
| | | // cc=~0x3f;
|
| | | __disable_irq();
|
| | | STRCLK1_1();
|