Rev | Line | |
---|
[9] | 1 | #include "syslib.h"
|
---|
| 2 |
|
---|
| 3 | /*===========================================================================*
|
---|
| 4 | * sys_in *
|
---|
| 5 | *===========================================================================*/
|
---|
| 6 | PUBLIC int sys_in(port, value, type)
|
---|
| 7 | int port; /* port address to read from */
|
---|
| 8 | unsigned long *value; /* pointer where to store value */
|
---|
| 9 | int type; /* byte, word, long */
|
---|
| 10 | {
|
---|
| 11 | message m_io;
|
---|
| 12 | int result;
|
---|
| 13 |
|
---|
| 14 | m_io.DIO_TYPE = type;
|
---|
| 15 | m_io.DIO_REQUEST = DIO_INPUT;
|
---|
| 16 | m_io.DIO_PORT = port;
|
---|
| 17 |
|
---|
| 18 | result = _taskcall(SYSTASK, SYS_DEVIO, &m_io);
|
---|
| 19 | *value = m_io.DIO_VALUE;
|
---|
| 20 | return(result);
|
---|
| 21 | }
|
---|
| 22 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.