Bug in H7 hrtim deadtime prescaler reference manual RM0433 and the HAL library code
I was getting strange results with the deadtime prescaler of the H7 hrtim and it appears that the H7 reference manual (RM0433 rev 7) is incorrect: The DTPRSC field of register HRTIM_DTxR, is supposed to get binary values from 011 to 111 (000 to 010 are reserved) which correspond to multiplication of the tHRTIM by 1, 2, 4, 8, and 16. The provided formula is tDTG = 2^(DTPRSC - 3) * tHRTIM.
But, when I set the prescaler to the HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8 define from HAL, it places a 0 in DTPRSC, while according to RM0433, it should have been 0b110 (= 6). Then when I used HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4, it wrote 1 in DTPRSC, and so on. There is not a XX_MUL16 defined.
The actual deadtime is scaling in the oposite direction! The delay with MUL8 is half of the delay with MUL4, which is half of that with MUL2, ....
Therefore the actual formula is tDTG = 2^(DTPRSC) * tHRTIM, so the -3 should not be in the exponent and the values of 0b000 to 0b010 are valid. (Probably the highest 3 values are the ones which should be reserved). Moreover, the names of the defines (the MUL4, MUL8, etc) in HAL are wrong.
Board: Nucleo H743ZI2, HAL version v1.10
