Function
8255 mode setup is acquired per chip.
Format
Ret = DioGet8255Mode ( Id , ChipNo , &CtrlWord )
Parameters
Id
[ C, C++: short] [Python: ctypes.c_short]
Specify the device ID retrieved from DioInit.
ChipNo
[ C, C++: unsigned short] [Python: ctypes.c_ushort]
Specify a LSIi8255 chip number.
CtrlWord
[ C, C++: unsigned short *] [Python: ctypes.POINTER(ctypes.c_ushort)]
Specify the address of the variable which stores control word.
The setting value list of control word is shown below.
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
D1 |
D0 |
Hex |
Port A |
Port C |
Port B |
Port C |
|
(High 4bit) |
(Low 4bit) |
||||||||||
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
80 |
OUTPUT |
OUTPUT |
OUTPUT |
OUTPUT |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
81 |
OUTPUT |
OUTPUT |
OUTPUT |
INPUT |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
82 |
OUTPUT |
OUTPUT |
INPUT |
OUTPUT |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
83 |
OUTPUT |
OUTPUT |
INPUT |
INPUT |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
88 |
OUTPUT |
INPUT |
OUTPUT |
OUTPUT |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
89 |
OUTPUT |
INPUT |
OUTPUT |
INPUT |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
8A |
OUTPUT |
INPUT |
INPUT |
OUTPUT |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
1 |
8B |
OUTPUT |
INPUT |
INPUT |
INPUT |
1 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
90 |
INPUT |
OUTPUT |
OUTPUT |
OUTPUT |
1 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
91 |
INPUT |
OUTPUT |
OUTPUT |
INPUT |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
92 |
INPUT |
OUTPUT |
INPUT |
OUTPUT |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
93 |
INPUT |
OUTPUT |
INPUT |
INPUT |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
98 |
INPUT |
INPUT |
OUTPUT |
OUTPUT |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
99 |
INPUT |
INPUT |
OUTPUT |
INPUT |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
9A |
INPUT |
INPUT |
INPUT |
OUTPUT |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
9B |
INPUT |
INPUT |
INPUT |
INPUT |
Return Value
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
Definition |
Value [Dec] |
Description |
DIO_ERR_SUCCESS |
0 |
Normal complete |
DIO_ERR_DLL_INVALID_ID |
10001 |
Invalid ID is specified. |
DIO_ERR_DLL_CALL_DRIVER |
10002 |
Driver cannot be called (failed in ioctl). |
DIO_ERR_DLL_BUFF_ADDRESS |
10100 |
Invalid data buffer address. |
DIO_ERR_SYS_NOT_SUPPORTED |
20001 |
This function cannot be used for this device. |
DIO_ERR_SYS_PORT_NO |
20100 |
Port number is outside of the specified available range. |
DIO_ERR_SYS_8255 |
20500 |
8255 chip number is outside of the range. |
The other errors: (See also: Error code details)
Remarks
Please use it after performing DioInit first
and setting up an I/O port
by DioSet8255Mode() next, when using this function.
Example
Get the setting of LSIi8255 chip on your device.
C, C++ |
long Ret; unsigned short CtrlWord; Ret = DioGet8255Mode(Id,
0, &CtrlWord); |
Python |
Ret = ctypes.c_long() Ret.value = cdio.DioGet8255Mode(Id,
0, ctypes.byref(CtrlWord)) |
See Also