Weight_Bed/IO_Init.c

39 lines
916 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "H/Function_Init.H"
/*****************************************************
*函数名称void IO_Init(void)
*函数功能IO初始化,CLK输出DT输入
*入口参数void
*出口参数void
*****************************************************/
void IO_Init(void)
{
P0CON = 0x12; ////7 , 6 DT1, 5 , 4 .CLK1, 3 , 2 DT3, 1 .CLK3, 0
P0PH = 0x00;
P1CON = 0xFF; //7 , 6 , 5 , 4 , 3 , 2 , 1 , 0
P1PH = 0x00;
P2CON = 0x20; //7 大按钮 , 6 DT2, 5 .CLK2, 4 小按钮, 3 , 2 , 1 , 0
P2PH = 0x90;
P3CON = 0xFF; //7 , 6 , 5 , 4 , 3 , 2 , 1 , 0
P3PH = 0x00;
P4CON = 0x08; //7 , 6 , 5 , 4 DT0, 3 .CLK0, 2 , 1 , 0
P4PH = 0x00;
P5CON = 0xFF; //7 , 6 , 5 , 4 , 3 , 2 , 1 , 0
P5PH = 0x00;
SC95F7616B_NIO_Init(); //未引出IO口配置
}
void Delay(unsigned long time)
{
while(time--);//4.3us
}
void Delay1ms(void)
{
Delay(585);
}
void Delay_ms(unsigned long time)
{
while(time--)
Delay1ms();
}