5.2.21 Set Pin Function

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-13, 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-14.
  • 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.
Table 5-13. Pin Index and RNBD350 Pins
Pin IndexRNBD350 PinsDefault Function
00PA3GPIO control
01PA8Event indicator
02PA9UART mode switch
03PA10Bluetooth® Low Energy status indicator 1/2
04PB4UART TX indicator
05PB5Status LED
06PB8Bluetooth® Low Energy status indicator 2/2
Table 5-14. Configurable Functions
Function IndexFunction Description
00None
01Bluetooth® Low Energy status indicator 1/2
02Bluetooth® Low Energy status indicator 2/2
03Status LED
04UART TX indicator
05UART mode switch
06Event indicator
07PTA function (read only)
ItemFirmware Version 1.0 and LaterDescription
Example:SW,03,06Assign pin PA10 to the event indicator function
Response:AOKSuccess
ErrSyntax error or invalid parameter
Note: The parameters of SW command are stored in PDS.