From dcbfd2e5649f97aa04fbbc6ea2b008aa4486e225 Mon Sep 17 00:00:00 2001 From: Peter Pearse Date: Tue, 14 Aug 2007 10:14:05 +0100 Subject: Add the files. --- board/at91rm9200dk/mux.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 board/at91rm9200dk/mux.c (limited to 'board/at91rm9200dk/mux.c') diff --git a/board/at91rm9200dk/mux.c b/board/at91rm9200dk/mux.c new file mode 100644 index 0000000000..d573923c1b --- /dev/null +++ b/board/at91rm9200dk/mux.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include + +int AT91F_GetMuxStatus(void) { +#ifdef DATAFLASH_MMC_SELECT + AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */ + AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */ + + + if(AT91C_BASE_PIOB->PIO_ODSR & DATAFLASH_MMC_SELECT) { + return 1; + } else { + return 0; + } +#endif + return 0; +} + +void AT91F_SelectMMC(void) { +#ifdef DATAFLASH_MMC_SELECT + AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */ + AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */ + /* Set Output */ + AT91C_BASE_PIOB->PIO_SODR = DATAFLASH_MMC_SELECT; +#endif +} + +void AT91F_SelectSPI(void) { +#ifdef DATAFLASH_MMC_SELECT + AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */ + AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */ + /* Clear Output */ + AT91C_BASE_PIOB->PIO_CODR = DATAFLASH_MMC_SELECT; +#endif +} + + -- cgit From f01dbb5424a81453c81190dd30e945891466f621 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Tue, 14 Aug 2007 18:42:36 +0200 Subject: Coding style cleanup. Update CHANGELOG. Signed-off-by: Wolfgang Denk --- board/at91rm9200dk/mux.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'board/at91rm9200dk/mux.c') diff --git a/board/at91rm9200dk/mux.c b/board/at91rm9200dk/mux.c index d573923c1b..767d28090d 100644 --- a/board/at91rm9200dk/mux.c +++ b/board/at91rm9200dk/mux.c @@ -23,8 +23,8 @@ void AT91F_SelectMMC(void) { AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */ AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */ /* Set Output */ - AT91C_BASE_PIOB->PIO_SODR = DATAFLASH_MMC_SELECT; -#endif + AT91C_BASE_PIOB->PIO_SODR = DATAFLASH_MMC_SELECT; +#endif } void AT91F_SelectSPI(void) { @@ -32,8 +32,6 @@ void AT91F_SelectSPI(void) { AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */ AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */ /* Clear Output */ - AT91C_BASE_PIOB->PIO_CODR = DATAFLASH_MMC_SELECT; -#endif + AT91C_BASE_PIOB->PIO_CODR = DATAFLASH_MMC_SELECT; +#endif } - - -- cgit