488
Platforms
©2000-2008 Tibbo Technology Inc.
Mapping scan and return lines
First, you need to define the list of scan and return lines. One great feature of the
kp. object is that you can assign ("map") any I/O line of your device to be a scan
or return line. I/O lines serving as scan or return lines don't even have to be
"together" (have consecutive numbers). Scan lines are assigned through the
property, return lines -- through the
property. For example, here is how you select lines 24, 20, and 27 to serve as
scan lines, and 28, 21, and 25 to serve as return lines:
kp.scanlinesmapping="24,20,27"
kp.returnlinesmapping="28,21,25"
io.num=PL_IO_NUM_24
io.enabled=YES
io.num=PL_IO_NUM_20_INT4
io.enabled=YES
io.num=PL_IO_NUM_27
io.enabled=YES
each scan line must be configured as
output, each return line -- as input (shown in the example above).
Notice how we did not have any order in specifying return and scan lines -- this
simply does not matter. Select any lines, order then in any way you want. The only
limitations are:
You can't have more than 8 scan lines and 8 return lines;
You must have at least 1 return line;
Any given I/O line can only serve as a scan or return line, not both.
Line numbers are platform-dependent. They come from pl_io_num found in the
"Platform-dependent Constants" section of your platform documentation. The
pl_io_num is a list of constants like "PL_IO_NUM_24". You cannot just drop
"PL_IO_NUM_24" into kp.scanlinesmapping (or kp.returnlinesmapping). The
correct way is to write "24" or use str(PL_IO_NUM_24). So, another way to do the
above setup would look like this:
kp.scanlinesmapping=str(PL_IO_","+str(PL_IO_NUM_2","+str(P
L_IO_NUM_27)
kp.returnlinesmapping=str(PL_IO_","+str(PL_IO_NUM_2","+str
(PL_IO_NUM_25)
...
s=kp.returnlinesmapping
's will be equal to '28,21,25' (full constant
names like PL_IO_NUM_28 are not preserved)
Notice that no matter how you set kp.scanlinesmapping and kp.
returnlinesmapping, reading them will always return a simple list of numbers
(shown in the example above).
Defining state transition delays
Your second step is to set proper delay times for
. Five
497
496
368
486