diff options
Diffstat (limited to 'ports/ARM7-AT91SAM7X/sam7x_serial.c')
-rw-r--r-- | ports/ARM7-AT91SAM7X/sam7x_serial.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/ports/ARM7-AT91SAM7X/sam7x_serial.c b/ports/ARM7-AT91SAM7X/sam7x_serial.c index c2d2f01a7..146d73f1b 100644 --- a/ports/ARM7-AT91SAM7X/sam7x_serial.c +++ b/ports/ARM7-AT91SAM7X/sam7x_serial.c @@ -129,11 +129,11 @@ static void OutNotify2(void) { * @brief UART setup.
* @param[in] u pointer to an UART I/O block
* @param[in] speed serial port speed in bits per second
- * @param[in] mode mode flags
+ * @param[in] mr the value for the @p MR register
* @note Must be invoked with interrupts disabled.
* @note Does not reset the I/O queues.
*/
-void SetUSART(AT91PS_USART u, int speed, int mode) {
+void sam7x_set_usart(AT91PS_USART u, int speed, int mr) {
/* Disables IRQ sources and stop operations.*/
u->US_IDR = 0xFFFFFFFF;
@@ -184,11 +184,12 @@ void sam7x_serial_init(int prio0, int prio1) { AIC_EnableIT(AT91C_ID_US0);
/* Default parameters.*/
- SetUSART(AT91C_BASE_US0, SAM7X_USART_BITRATE, AT91C_US_USMODE_NORMAL |
- AT91C_US_CLKS_CLOCK |
- AT91C_US_CHRL_8_BITS |
- AT91C_US_PAR_NONE |
- AT91C_US_NBSTOP_1_BIT);
+ sam7x_set_usart(AT91C_BASE_US0, SAM7X_USART_BITRATE,
+ AT91C_US_USMODE_NORMAL |
+ AT91C_US_CLKS_CLOCK |
+ AT91C_US_CHRL_8_BITS |
+ AT91C_US_PAR_NONE |
+ AT91C_US_NBSTOP_1_BIT);
#endif
#if USE_SAM7X_USART1 || defined(__DOXYGEN__)
@@ -211,11 +212,12 @@ void sam7x_serial_init(int prio0, int prio1) { AIC_EnableIT(AT91C_ID_US1);
/* Default parameters.*/
- SetUSART(AT91C_BASE_US1, SAM7X_USART_BITRATE, AT91C_US_USMODE_NORMAL |
- AT91C_US_CLKS_CLOCK |
- AT91C_US_CHRL_8_BITS |
- AT91C_US_PAR_NONE |
- AT91C_US_NBSTOP_1_BIT);
+ sam7x_set_usart(AT91C_BASE_US1, SAM7X_USART_BITRATE,
+ AT91C_US_USMODE_NORMAL |
+ AT91C_US_CLKS_CLOCK |
+ AT91C_US_CHRL_8_BITS |
+ AT91C_US_PAR_NONE |
+ AT91C_US_NBSTOP_1_BIT);
#endif
}
|