From 42a088d9a4189d9f5d3c30de0e592c9eac715a7f Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 6 Sep 2011 12:15:01 +0000 Subject: [PATCH] Add hw pin init for sd driver. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5031 38d2e660-2303-0410-9eaa-f027e97ec537 --- boards/sam3x-ek/hw/hw_sd.h | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 boards/sam3x-ek/hw/hw_sd.h diff --git a/boards/sam3x-ek/hw/hw_sd.h b/boards/sam3x-ek/hw/hw_sd.h new file mode 100644 index 00000000..d077b8b3 --- /dev/null +++ b/boards/sam3x-ek/hw/hw_sd.h @@ -0,0 +1,61 @@ +/** + * \file + * + * + * \brief SD driver hardware-specific definitions. + * + * + * \author Luca Ottaviano + */ + +#ifndef HW_SD_H +#define HW_SD_H + +#define SD_CS_INIT() do { /* implement me */} while(0) +#define SD_CS_ON() do { /* implement me */} while(0) +#define SD_CS_OFF() do { /* implement me */} while(0) + +#include + +#define SD_PIN_INIT() \ +do { \ + PIOA_PDR = BV(19) | BV(20) | BV(21) | BV(22) | BV(23) | BV(24); \ + PIO_PERIPH_SEL(PIOA_BASE, BV(19) | BV(20) | BV(21) | BV(22) | BV(23) | BV(24), PIO_PERIPH_A); \ + pmc_periphEnable(PIOE_ID); \ + PIOE_PUER = BV(6); \ + PIOE_ODR = BV(6); \ + PIOE_PER = BV(6); \ +} while (0) + +#define SD_CARD_PRESENT() (!(PIOE_PDSR & BV(6))) +#define SD_WRITE_PROTECT() false /* implement me */ + +#endif /* HW_SD_H */ -- 2.25.1