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.
Table 5-4. Pin Index and RNBD350 Pins
Pin IndexRNBD350 PinsDefault Function
00PA3 GPIO control
01PA8 Event indicator
02PA9 UART mode switch
03 PA10 Bluetooth® Low Energy status indicator 1/2
04PB4UART TX indicator
05PB5 Status LED
06PB8 Bluetooth Low Energy status indicator 2/2
Table 5-5. Configurable Functions
Function IndexFunction Description
00None
01Bluetooth® Low Energy status indicator1/2
02Bluetooth Low Energy status indicator 2/2
03Status LED
04UART TX indicator
05UART mode switch
06Event indicator
07PTA 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.