Programming Structure
The structure that should be used to store pin configuration and information is dimm_io from dimmio.h, located in /opt/uClinux/linux/include/linux/. Table 2 below describes the six fields of the structure and their settings.
Table 2: dimm_io structure description
Field | Description | |
|
| |
| type - short | |
port_number | The port number corresponds to the ports of | |
the MC68VZ328, where A = 0, B = 1, C = | ||
| ||
| 2, … L = 11, M = 12 | |
|
| |
| type - short | |
bit_number | The bit numbers are for each port, where 0 = | |
| lsb, … 7 = msb | |
|
| |
| type - long | |
offset | This is the offset into the list of active pins. | |
| The offset has a maximum range of 0 to 26. | |
|
| |
| type - unsigned char | |
mode | The mode determines the direction of the I/O | |
| point, where 0 = input, 1 = output | |
|
| |
| type - unsigned char | |
| The state describes the logic level on the pin, | |
state | where 0 = low, 1 = highNote that the state | |
field is not updated when an ioctl call is used | ||
| ||
| and field exists only for programming | |
| convenience. | |
|
| |
| type - unsigned char | |
pull_up_dn | The pull_up_dn controls the | |
down register for each pin, where 0 = | ||
| ||
| disabled, 1 = enabled | |
|
|
68 | www.amctechcorp.com |