Appendix
- 40 -
CPC-1814CLD5NA-N
if(in_out==1)
{
mask=ich_mask(1,pin_NO);
tempv=inportb(ioadd)|mask;
outportb(ioadd,tempv);
}
else
{
mask=ich_mask(0,pin_NO);
tempv=inportb(ioadd)&mask;
outportb(ioadd,tempv);
}
}
/*************************************************************
Function Name: set high/low level for output pin write_gpio(int high_low,int
pin_NO)
Input Parameters: (high/low level, PIN number)(high_low=1 high level, =0 low level
Returned Value:
Functions: initialize GPIO according to DATASHEET specification
*************************************************************/
void write_gpio(const int high_low, const int pin_NO)
{
unsigned int ioadd=(BAR+0x0c);
int
offset=pin_NO/8;
unsigned
char
mask;
unsigned
char
tempv;
if(pin_NO>=32)
{
ioadd=(BAR+0x38);