If you have not already done so, for things like this it helps to download the reference
manual for the processor. In the version I downloaded rm0399 - STM32H745/755 and STM32H747/757 advanced Arm®-based 32-bit MCUs, GPIO is in chapter 12
If you go to thei GIGA documentation page, you can see the full pinout.
ABX00063-full-pinout.pdf
So for the pins mentioned above, you see.
So you see that pin 25 maps to hardware pin PJ0
//GPIOJ->ODR = (0b00000001); // Turns on: D25 (PJ0)
So the PJ says port J. One of the hardware include files, on my install located at:
<Arduino15_locatlion>\Arduino15\packages\arduino\hardware\mbed_giga\4.1.5\cores\arduino\mbed\targets\TARGET_STM\TARGET_STM32H7\STM32Cube_FW\CMSIS\stm32h747xx.h
defines GPIOJ to point to the GPIO register structure.
typedef struct
{
__IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
__IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
__IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
__IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
__IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
__IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
__IO uint32_t BSRR; /*!< GPIO port bit set/reset, Address offset: 0x18 */
__IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
__IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */
} GPIO_TypeDef;
So, they are setting the ODR register to the value 1, which turns on D25.
With the Side effect that it also turns off all of the other IO pins on port J that may have been on. like at least (27, 29, 31, 33, 35, ...)
Which is why I prefer to use the BSRR register. to turn on pin D25:
GPIOJ->BSRR = (1 << 0);
Only the IO pins whose bit is set in the lower 16 bits will be turned high,
Only the IO pins whose bit is set in the upper 16 bits will be turned low.
GPIOJ->BSRR = (1 << (0 + 16));
Hope that makes sense.
Note, I do similar stuff in my digitalWriteFast/digitalToggleFast/digitalReadFast as this hard coding, but instead have it look up the mapping from the pin number to how
the code has pin name, which encodes the port number and bit within it, which I then
use to compute register address. If you use it with constants, it in theory should be
optimized back down to more or less the same one instuction.