Advantech MIO-5850 User Manual page 79

Table of Contents

Advertisement

// read command
for (i=0; i<len; i++)
{
if (ec_wait_obf())
return 0xFF;
*datp++ = inb(DAT_PORT);
}
}
else
{
// write command
for (i=0; i<len; i++)
{
if (ec_wait_ibe())
return 0xFF;
outb(DAT_PORT, *datp++);
}
}
return 0;
}
//
================================================================
=============
// ec_wdt_setup
//
================================================================
=============
uint8_t ec_wdt_setup(uint8_t wdt_type, uint32_t ms)
{
uint8_t
buf[4];
buf[0] = (ms >> 0) & 0xFF;
buf[1] = (ms >> 8) & 0xFF;
buf[2] = (ms >> 16) & 0xFF;
buf[3] = (ms >> 24) & 0xFF;
if (ec_prot_trans(WDT_CMD_WRITE, wdt_type, 0, 4, buf))
return 0xFF;
return 0;
}
71
MIO-5850 User Manual

Advertisement

Table of Contents
loading

Table of Contents