Function
8255 mode setup is set up per chip.
Format
Ret = DioSet8255Mode ( Id , ChipNo , CtrlWord )
Parameters
Id
[C:short] [ Python: ctypes.c_short ]
Specify the device ID retrieved from DioInit.
ChipNo
[C:unsigned short] [ Python: ctypes.c_ushort ]
Specify a LSIi8255 chip number.
CtrlWord
[C:unsigned short] [ Python: ctypes.c_ushort ]
Specify control word.
The setting value list of control word is shown below.
D7 |
D6 |
D5 |
D4 |
D4 |
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: 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)
Initial Value
At the time of system starting, all ports are setup of an input.
Remarks
Please use an I/O function after performing
DioInit first and
setting up an I/O port with this function next, when using DIO-48D-LPE
and PIO-48D(LPCI)H, DIO-48D2-PCI, DIO-48DX-USB.
Example
C |
Ret = DioSet8255Mode
( Id , ChipNo , CtrlWord ); |
Python |
Ret = cdio.DioSet8255Mode
( Id , ChipNo , CtrlWord ) |
See Also