Advantech MIO-5850 User Manual page 77

Table of Contents

Advertisement

uint8_t ec_wait_ibe(void)
{
uint16_t
retries = EC_RETRIES;
// wait for the input buffer empty
while (inb(STS_PORT) & EC_STS_IBF)
{
if (--retries == 0)
return 0xFF;
}
return 0;
}
//
================================================================
=============
// ec_wait_obe
//
================================================================
=============
uint8_t ec_wait_obe(void)
{
uint16_t
retries = EC_RETRIES;
// wait for the output buffer empty
while (inb(STS_PORT) & EC_STS_OBF)
{
if (--retries == 0)
return 0xFF;
// timeout obe
inb(DAT_PORT); // reading output buffer if OBF
}
return 0;
}
//
================================================================
=============
// ec_wait_obf
//
================================================================
=============
uint8_t ec_wait_obf(void)
{
uint16_t
retries = EC_RETRIES;
// wait for the output buffer full
69
MIO-5850 User Manual

Advertisement

Table of Contents
loading

Table of Contents