2005-04-21 16:53:53 +02:00
|
|
|
#include "syslib.h"
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* sys_in *
|
|
|
|
*===========================================================================*/
|
|
|
|
PUBLIC int sys_in(port, value, type)
|
|
|
|
int port; /* port address to read from */
|
|
|
|
unsigned long *value; /* pointer where to store value */
|
|
|
|
int type; /* byte, word, long */
|
|
|
|
{
|
|
|
|
message m_io;
|
|
|
|
int result;
|
|
|
|
|
2006-06-20 10:45:04 +02:00
|
|
|
m_io.DIO_REQUEST = _DIO_INPUT | type;
|
2005-04-21 16:53:53 +02:00
|
|
|
m_io.DIO_PORT = port;
|
|
|
|
|
|
|
|
result = _taskcall(SYSTASK, SYS_DEVIO, &m_io);
|
|
|
|
*value = m_io.DIO_VALUE;
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|