2016 Microchip Technology Inc. DS50002466A-page 29
2.6.6 |I,<hex8>
Command |I reads multiple digital I/O values. It expects one input parameter of digital
I/O ports to read. The input parameter is the digital I/O pin bitmap in the 8-bit hex for-
mat. The I/O pin bitmap format is provided in Tab le 2- 11. If the bit is set for a corre-
sponding pin, and the pin is assigned to a predefined function, such bit is automatically
cleared. For pin function assignment, please refer to command SW (2.4.24).
The response to command |I is also a bitmap. If the corresponding pin to be read is
high, then the bit in the response is set, otherwise, the bit is cleared.
2.6.7
|O,<hex8>,<hex8>
Command |O sets the output value of the digital I/O ports. It expects two input param-
eters. The first parameter is the bitmap of digital I/O ports that are affected by this com-
mand; the second parameter is the output value in the bitmap. The bitmap format is the
same as in command |I, shown in Table 2-11. If the bit in the bitmap of I/O ports is set
for a corresponding pin, and the pin is assigned to a predefined function, such bit is
automatically cleared. For pin function assignment, please check command SW
(2.4.24).
2.6.8
[,<1-2>,<0-3>,<hex16>,<hex16>
Command [ supports Pulse-With Modulation (PWM) function on RN4870. RN4871
does not support this function. It expects up to four parameters.
The first parameter is the PWM channel to be used in this command. Two PWM chan-
nels are supported. Channel 1 is on pin P22 and channel 2 is on pin P23. If pin P22 has
been assigned to a system function, such command is ignored and RN4870 returns
error message.
TABLE 2-11: DIGITAL I/O BITMAP
Bitmap RN4870 Pins RN4871 Pins
01 P2_2 —
02 P2_4 —
04 P3_5 —
08 P1_2 P1_2
10 P1_3 P1_3
Example: |I,06 // Read digital I/O P2_4 and P3_5. If return value is 04,
// then P2_4 is low and P3_5 is high
Response: AOK
ERR
// Success
// Syntax error or invalid parameter
Example: |O,07,05 // Set digital I/O output on P2_2, P2_4 and P3_5.
// Set P2_2 and P3_5 high and P2_4 low.
Response: AOK
ERR
// Success
// Syntax error or invalid parameter