Lantronix MatchPort b/g MatchPort b/g - User Guide - Page 79

Examples, Command 1Ah, Set Active Levels, Set States

Page 79 highlights

7: Configurable Pins Command 1Ah, Set Active Levels Send: 2 parameters Bytes 1-4: Mask Bit X 1 means the direction for GPIO X will be updated with the value in the second parameter. 0 means the active type for that GPIO will not change. Bytes 5-8: New Active Levels Bit X 1 means GPIO X will become active low. 0 means it will become active high. Response: 1 parameter Bytes 1-4: Updated active levels Command 1Bh, Set States Send: 2 parameters Bytes 1-4: Mask Bit X 1 means the state for GPIO X will be updated with the value in the second parameter. 0 means the state for that GPIO will not change. Bytes 5-8: New States Bit X 1 means GPIO X will become active. 0 means it will become inactive. Response: 1 parameter Bytes 1-4: Updated states Examples Example 1: PC sends command 10h to find out which configurable pins are available as GPIO. PC -> MatchPort: 10h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h MatchPort -> PC: 10h, 03h, 00h, 00h, 00h Command details: 10h = command 10h 00h, 00h, 00h, 00h = ignored 00h, 00h, 00h, 00h = ignored Response details: 10h = response to command 10h 03h, 00h, 00h, 00h = bits 0 and 1 are 1→CP0 and CP1 are configured as GPIOs (GPIO0, GPIO1). bits 2 to 7 are 0 → configured for a special function and are unavailable for control or monitoring by the user. MatchPort User Guide 79

  • 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
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90

7: Configurable Pins
Command 1Ah, Set Active Levels
Send:
2 parameters
Bytes 1-4: Mask
Bit X
1 means the direction for GPIO X will be updated with the value in the
second parameter.
0 means the active type for that GPIO will not change.
Bytes 5-8: New Active Levels
Bit X
1 means GPIO X will become active low.
0 means it will become active high.
Response:
1 parameter
Bytes 1-4: Updated active levels
Command 1Bh, Set States
Send:
2 parameters
Bytes 1-4: Mask
Bit X
1 means the state for GPIO X will be updated with the value in the
second parameter.
0 means the state for that GPIO will not change.
Bytes 5-8: New States
Bit X
1 means GPIO X will become active.
0 means it will become inactive.
Response:
1 parameter
Bytes 1-4: Updated states
Examples
Example 1:
PC sends command 10h to find out which configurable pins are
available as GPIO.
PC -> MatchPort: 10h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
MatchPort -> PC: 10h, 03h, 00h, 00h, 00h
Command details:
10h = command 10h
00h, 00h, 00h, 00h = ignored
00h, 00h, 00h, 00h = ignored
Response details:
10h = response to command 10h
03h, 00h, 00h, 00h
=
bits 0 and 1 are 1
CP0 and CP1 are configured as GPIOs (GPIO0, GPIO1).
bits 2 to 7 are 0
configured for a special function and are unavailable for
control or monitoring by the user.
MatchPort User Guide
79