/* Retrieve the amount of cycles to delay for the given amount of ms.  */
static uint32_t _get_cycles_for_ms_internal(const uint16_t ms, const uint32_t freq, const uint8_t power)
/* Retrieve the amount of cycles to delay for the given amount of ms.  */
static uint32_t _get_cycles_for_ms_internal(const uint16_t ms, const uint32_t freq, const uint8_t power)
{
	switch (power) {
	case 9:
		return (ms * (freq / 1000000) * 1000);
	case 8:
		return (ms * (freq / 100000) * 100);
	case 7:
		return (ms * (freq / 10000) * 10);
	case 6:
		return (ms * (freq / 1000));
	case 5:
		return (ms * (freq / 100) + 9) / 10;
	default:
		return (ms * (freq / 1) + 999) / 1000;
	}
}