It returns htim->state.
State is HAL_TIM_StateTypeDef type:
enum HAL_TIM_StateTypeDef {
HAL_TIM_STATE_RESET = 0x00U, HAL_TIM_STATE_READY = 0x01U, HAL_TIM_STATE_BUSY = 0x02U, HAL_TIM_STATE_TIMEOUT = 0x03U,
HAL_TIM_STATE_ERROR = 0x04U
}
It's meant for internal use.
By default, it's in reset state.
When you init the peripheral, it becomes ready.
Most HAL functions check this, for example some will instantly return error if state is not ready.
Same as if, for example, you start a DMA transfer, the timer handle will be busy until DMA finishes, attempts to use the timer will probably return busy.
When the DMA is over, the handle will be unlocked back to ready.
This is not 100% accurate, it's been some time since I last used HAL.
Navigate the library and see where htim->state is used.