There are several of the top level APIs, like digitalWrite, which index this array without checking anything, which if the value passed in, is out of range, will produce unpredictable results, ranging from faulting to randomly acting on different pin.
Example:
void digitalWrite(pin_size_t pin, PinStatus val) {
R_IOPORT_PinWrite(NULL, g_pin_cfg[pin].pin, val == LOW ? BSP_IO_LEVEL_LOW : BSP_IO_LEVEL_HIGH);
}
I am assuming, that the UNOR4 boards are not EXTENDED_PIN_MODE so
typedef uint8_t pin_size_t;
A quick check I believe, that some of the APIs include:
analogWrite
pinMode
digitalWrite
digitalRead
Note: I see a few places that actually checks:
static int pin2IrqChannel(int pin) {
/* -------------------------------------------------------------------------- */
/* verify index are good */
if(pin < 0 || pin >= (int)(g_pin_cfg_size / sizeof(g_pin_cfg[0]))) {
return -1;
}
Likewise PwmOut
There are probably others in both check and don't check, as I have not gone through every reference.