RC11xx(HP)-TM
RC25xx(HP)-TM
RC17xx(HP)-TM
2016 Radiocrafts AS
RC11xx(HP)/25xx(HP)/17xx(HP)-TM Data Sheet rev. 1.48 Page 36 of 86
2016 Tiny Mesh AS
Radiocrafts
Embedded Wireless Solutions
Digital Output control
Digital outputs are controlled by Gateway commands, using the
SET OUTPUTS
Command.
The designated GPIOs must first be enabled as outputs, by configuring the desired
GPIO
function. The
Default configuration is Input. A command to set or reset a
GPIO
that has not been configured for Output
control will have no effect. The default output value at Reset is selectable in the
GPIO
configuration.
The
DATA 1
and
DATA 2
bytes in the
COMMAND PACKET FORMAT
are used to control the output status.
The contents of these bytes are 'bit mapped', such that the first bit of the byte controls the output status
of
GPIO
0, and the 7
th
bit of the byte is used to set
GPIO
7.
DATA 1
is used for setting outputs, while
DATA 2
is used for clearing outputs.
Note that setting a bit in
DATA 2
(Clear output) will override a bit that has been set in
DATA 1
(Set
Output). By using two separate bits for setting/ clearing an output, the external application firmware may
be relieved of the task of knowing the previous state of a digital output, because only the single bits
selected by the command will be affected.
Example 1:
Set GPIO Outputs 5 and 7
Command Data byte 1
Command Data byte 2
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
GPIO Output
GPIO7 GPIO6 GPIO5 GPIO4 GPIO3 GPIO2 GPIO1 GPIO0
Set
No
Change
Set
No
Change
No
Change
No
Change
No
Change
No
Change
Example 2:
Clear GPIO Output 3
Command Data byte 1
Command Data byte 2
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
GPIO Output
GPIO7 GPIO6 GPIO5 GPIO4 GPIO3 GPIO2 GPIO1 GPIO0
No
Change
No
Change
No
Change
No
Change
Clea-
red
No
Change
No
Change
No
Change
Example 3:
Command Data Byte 2 settings will override Command Data Byte 1 settings
Setting and clearing the same output, results in clearing the output:
Command Data byte 1
Command Data byte 2
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
0
GPIO Output
GPIO7 GPIO6 GPIO5 GPIO4 GPIO3 GPIO2 GPIO1 GPIO0
No
Change
No
Change
No
Change
No
Change
No
Change
Clea-
red
No
Change
No
Change
GPIO mapping
GPIO7 GPIO6 GPIO5 GPIO4 GPIO3 GPIO2 GPIO1 GPIO0
Module
pin
23
Module
pin
24
Module
pin
25
Module
pin
26
Module
pin
22
Module
pin
20
Module
pin
16
Module
pin
15