target/linux/at91/image/dfboot/src/include/lib_AT91RM9200.h
//*----------------------------------------------------------------------------
//* \fn    AT91F_US_Baudrate
//* \brief Caluculate baud_value according to the main clock and the baud rate
//*----------------------------------------------------------------------------
\fn    AT91F_US_Baudrate
\brief Caluculate baud_value according to the main clock and the baud rate
\ fn AT91F_US_Baudrate \ brief Caluculate baud_value according to the main clock and the baud rate
static inline unsigned int AT91F_US_Baudrate (
	const unsigned int main_clock, 
	const unsigned int baud_rate)  
{
	unsigned int baud_value = ((main_clock*10)/(baud_rate * 16));
	if ((baud_value % 10) >= 5)
		baud_value = (baud_value / 10) + 1;
	else
		baud_value /= 10;
	return baud_value;
}
static inline unsigned int AT91F_US_Baudrate ( const unsigned int main_clock , const unsigned int baud_rate ) { unsigned int baud_value = ( ( main_clock * 10 ) / ( baud_rate * 16 ) ) ; if ( ( baud_value % 10 ) >= 5 ) baud_value = ( baud_value / 10 ) + 1 ; else baud_value /= 10 ; return baud_value ; }
\fn    AT91F_US_Baudrate
\brief Caluculate baud_value according to the main clock and the baud rate
\ fn AT91F_US_Baudrate \ brief Caluculate baud_value according to the main clock and the baud rate
// \arg peripheral clock // \arg UART baudrate