From: asterix Date: Tue, 6 Sep 2011 12:15:01 +0000 (+0000) Subject: Add hw pin init for sd driver. X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=42a088d9a4189d9f5d3c30de0e592c9eac715a7f;p=bertos.git Add hw pin init for sd driver. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5031 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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 */