31
#define BIT3 0x08
#define BIT4 0x10
#define BIT5 0x20
#define BIT6 0x40
#define BIT7 0x80
#define IO_Base 0xA00
#define CDS_PORT 1
#define CDO_PORT 2
void Init_DIO_Default()
{
}
/*-----------------------------------------------
@brief : Set CD_OPEN power level
@Input : Level-- 0:Low 1: High
------------------------------------------------*/
void Set_CD_OPEN(int Level)
{ int t;
if(Level)
{ outportb(CDO_PORT,inportb(CDO_PORT)|BIT6);
printf(" CD_OPEN is High \n");
}
else
{ outportb(CDO_PORT,inportb(CDO_PORT) &~BIT6);
printf("CD_OPEN is Low\n");
}
}
/*-----------------------------------------------
@brief : Get CD_SENSE low active
@Return : 1:Low active with no jitter
------------------------------------------------*/
int Get_CD_SENSE_Status()
{
if(inportb(CDS_PORT)&BIT3)
{ delay(100);
if(inportb(CDS_PORT)&BIT3)
{
printf("CD_SENSE is Low level stability.\n");
return 1;
}
}
else
printf("CD_SENSE is High level\n");
return 0;
}
main()
{
printf("System ready\n ");
Содержание HK560
Страница 1: ...1 User Manual HK560 QingDao Hisense Intelligent Commercial System Co Ltd ...
Страница 17: ...17 4 RFID test Open demo The operation steps are as follows ...
Страница 23: ...23 Hardware Monitor ...
Страница 32: ...32 Set_CD_OPEN High Set_CD_OPEN 1 Set_CD_OPEN Low Set_CD_OPEN 0 while 1 Get_CD_SENSE_Status ...