|
Synopsis
int sub_edge_config( sub_handle hndl, int set, int* get )
Configure EDGE module.
Parameters
| • | set - set will be used only if get == 0. EDGE lines EDG7..EDG0 are configured by two bits Ex1,Ex0 in set where x is 7..0. set bits have following interpretation: |
MSB
31..16
|
15
|
14
|
13
|
12
|
11
|
10
|
09
|
08
|
07
|
06
|
05
|
04
|
03
|
02
|
01
|
00
|
-
|
EDG7
|
EDG6
|
EDG5
|
EDG4
|
EDG3
|
EDG2
|
EDG1
|
EDG0
|
-
|
E71
|
E70
|
E61
|
E60
|
E51
|
E50
|
E41
|
E40
|
E31
|
E30
|
E21
|
E20
|
E11
|
E10
|
E01
|
E00
|
Ex1
|
Ex0
|
Edge Detection
|
0
|
0
|
No
|
0
|
1
|
Any change
|
1
|
0
|
Falling edge
|
1
|
1
|
Rising edge
|
| • | *get - Pointer to store current edge configuration read from SUB-20. If get is not zero function will read edge configuration otherwise it will set edge configuration |
Return value
On success function returns 0. Otherwise error code.
Example
rc = sub_edge_config( hndl, 0, &edge_config ); /* Read Edge configuration */
/* EDG0 = 01B - Any change */
/* EDG1 = 01B - Any change */
/* EDG2 - 11B - Risinge edge */
/* EDG7..EDG3 not detected */
rc = sub_edge_config( hndl, 0x0035, 0 ); /* set = 0011.0101B */
See also
Error Codes
|