5.2.21 Set Pin Function (SW,<hex8>,<hex8>)
Format: SW,<hex8>,<hex8>
This command is used to configure pin functions. It expects two input parameters.
- The first parameter is an 8-bit hex of the pin index, as shown in Table 5-4, which displays the pin indexes.
- The second parameter is an 8-bit hex representing the function assigned to the pin, and the supported functions are enumerated in Table 5-5.
- Users have the option to choose a specific function for a dedicated pin using these two parameters.
- When the PTA function is enabled, PA3, PA8 and PA9 are reserved for PTA pins.
- If the selected pin is occupied by the PTA function with PTA function enabled or if the selected pin is set to the PTA function, RNBD350 will respond with an error message.
- In the scenario where the selected pin is assigned a specific function and another pin already has that specific function, the other pin will be set to the none function.
Pin Index | RNBD350 Pins | Default Function |
---|---|---|
00 | PA3 | GPIO control |
01 | PA8 | Event indicator |
02 | PA9 | UART mode switch |
03 | PA10 | Bluetooth® Low Energy status indicator 1/2 |
04 | PB4 | UART TX indicator |
05 | PB5 | Status LED |
06 | PB8 | Bluetooth Low Energy status indicator 2/2 |
Function Index | Function Description |
---|---|
00 | None |
01 | Bluetooth® Low Energy status indicator1/2 |
02 | Bluetooth Low Energy status indicator 2/2 |
03 | Status LED |
04 | UART TX indicator |
05 | UART mode switch |
06 | Event indicator |
07 | PTA function (Read-only) |
Example: | SW,03,06 | // Assign pin PA10 to the event indicator function |
Response: | AOK | // Success |
Err | // Syntax error or invalid parameter |
Note: The parameters of
SW
command are stored in PDS.