aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/ATSAMA5D2/SERIAL/main.c
diff options
context:
space:
mode:
authoredolomb <none@example.com>2018-02-12 16:20:40 +0000
committeredolomb <none@example.com>2018-02-12 16:20:40 +0000
commit2b9c2a3ad54fbc613896609c3c412490b2ef54ed (patch)
treeb5b5008e1465e504871e91761e3d0f8e1890a9cb /testhal/ATSAMA5D2/SERIAL/main.c
parent0b5d6d6f77d0869cfdf4c793bc3e831557902067 (diff)
downloadChibiOS-2b9c2a3ad54fbc613896609c3c412490b2ef54ed.tar.gz
ChibiOS-2b9c2a3ad54fbc613896609c3c412490b2ef54ed.tar.bz2
ChibiOS-2b9c2a3ad54fbc613896609c3c412490b2ef54ed.zip
SAMA5D2-SERIAL now runs in DDR using FLEXCOM0 as serial
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11487 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/ATSAMA5D2/SERIAL/main.c')
-rwxr-xr-xtesthal/ATSAMA5D2/SERIAL/main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/testhal/ATSAMA5D2/SERIAL/main.c b/testhal/ATSAMA5D2/SERIAL/main.c
index cd1a382f7..e72c1f43e 100755
--- a/testhal/ATSAMA5D2/SERIAL/main.c
+++ b/testhal/ATSAMA5D2/SERIAL/main.c
@@ -74,7 +74,7 @@ static THD_FUNCTION(Thread1, arg) {
static const SerialConfig sdcfg = {
115200,
0,
- UART_MR_PAR_NO
+ US_MR_CHRL_8_BIT | US_MR_PAR_NO
};
/*
@@ -95,11 +95,12 @@ int main(void) {
/*
* Activates the serial driver 1 using the driver default configuration.
*/
- sdStart(&SD1, &sdcfg);
+ sdStart(&FSD0, &sdcfg);
+
+ /* Redirecting FLEX0 RX on PB29 and FLEX0 TX on PB28. */
+ palSetGroupMode(PIOB, PAL_PORT_BIT(28) | PAL_PORT_BIT(29), 0U,
+ PAL_SAMA_FUNC_PERIPH_C | PAL_MODE_SECURE);
- /* Redirecting UART1 RX on PD2 and UART1 TX on PD3. */
- palSetGroupMode(PIOD, PAL_PORT_BIT(2) | PAL_PORT_BIT(3), 0U,
- PAL_SAMA_FUNC_PERIPH_A | PAL_MODE_SECURE);
/*
* Creates the blinker thread.
*/
@@ -109,9 +110,9 @@ int main(void) {
* Normal main() thread activity.
*/
while (true) {
- getInputString((BaseSequentialStream *)&SD1, lineBuffer, BUFFER_SIZE);
- chprintf((BaseSequentialStream *)&SD1, lineBuffer);
- chprintf((BaseSequentialStream *)&SD1, "\n\r");
+ getInputString((BaseSequentialStream *)&FSD0, lineBuffer, BUFFER_SIZE);
+ chprintf((BaseSequentialStream *)&FSD0, lineBuffer);
+ chprintf((BaseSequentialStream *)&FSD0, "\n\r");
chThdSleepMilliseconds(500);
}
}