Lantronix EDS2100 Linux SDK - User Guide - Page 59

cpm CP Manager

Page 59 highlights

10 Sample Applications Figure 10-8. Serial-To-Ethernet GPIO Setup Screen cpm (CP Manager) The Configurable Pin Manager (cpm) provides shell level access to the device's GPIO pins. It also provides an example of how to use the libcp API to communicate with the CP GPIO driver. To use CPs as GPIO, you have to configure the kernel. (see CONFIG_LTRX_CPM_DEFAULT_GPIO of Appendix A Important Configuration Switches) The cpm.conf configuration file is used to group CPs into bit patterns. Note that the MatchPort AR has seven GPIO pins, whereas the XPort Pro has three of which 2 are shared with the serial driver. The cpm.conf file is of the following format: config cp { type # direction state # pin assign inverted # active low or high } group { type # direction state # group status bit CP # CP pin assign } Below is an example configuration file for creating a group called LED to control output for CP1 to CP4 NOTE: The XPort Pro supports only 3 GPIO pins. [cpm.conf] config cp1 { type output state enable invert disable Linux Software Developers Kit (SDK) User Guide 59

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76

10 Sample Applications
Linux Software Developers Kit (SDK) User Guide
59
Figure 10-8. Serial-To-Ethernet GPIO Setup Screen
cpm (CP Manager)
The Configurable Pin Manager (cpm) provides shell level access to the device’s GPIO pins. It
also provides an example of how to use the libcp API to communicate with the CP GPIO driver.
To use CPs as GPIO, you have to configure the kernel. (see
CONFIG_LTRX_CPM_DEFAULT_GPIO of Appendix A
Important Configuration Switches
)
The cpm.conf configuration file is used to group CPs into bit patterns. Note that the MatchPort AR
has seven GPIO pins, whereas the XPort Pro has three of which 2 are shared with the serial
driver. The cpm.conf file is of the following format:
config cp<num[1-7]> {
type
<output|input>
# direction
state <enable|disable> # pin assign
inverted
<enable|disable>
# active low or high
}
group <name> {
type <output|input>
# direction
state <enable|disable> # group status
bit<num[0-31]> CP<num[1-7]>
# CP pin assign
}
Below is an example configuration file for creating a group called LED to control output for CP1 to
CP4
NOTE:
The XPort Pro supports only 3 GPIO pins.
[cpm.conf]
config cp1 {
type output
state enable
invert disable