summaryrefslogtreecommitdiff
path: root/nuttx/drivers/mtd/at25.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-08-05 08:24:39 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-08-05 08:24:39 -0600
commit77df6ac2d504fc42d3e1def268cbaa551dcf64fa (patch)
tree69ef6565b5ce0d4ebf4ab2a4544e52947c9c7182 /nuttx/drivers/mtd/at25.c
parent47683aa2a4086083916c2ae55ed25bed3c72188a (diff)
downloadpx4-nuttx-77df6ac2d504fc42d3e1def268cbaa551dcf64fa.tar.gz
px4-nuttx-77df6ac2d504fc42d3e1def268cbaa551dcf64fa.tar.bz2
px4-nuttx-77df6ac2d504fc42d3e1def268cbaa551dcf64fa.zip
SAMA5: Add logic to auto-mount a file system on AT25 SPI FLASH for NSH
Diffstat (limited to 'nuttx/drivers/mtd/at25.c')
-rw-r--r--nuttx/drivers/mtd/at25.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/nuttx/drivers/mtd/at25.c b/nuttx/drivers/mtd/at25.c
index 465ea4425..914c08c1b 100644
--- a/nuttx/drivers/mtd/at25.c
+++ b/nuttx/drivers/mtd/at25.c
@@ -57,11 +57,16 @@
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
+/* Configuration ********************************************************************/
#ifndef CONFIG_AT25_SPIMODE
# define CONFIG_AT25_SPIMODE SPIDEV_MODE0
#endif
+#ifndef CONFIG_AT25_SPIFREQUENCY
+# define CONFIG_AT25_SPIFREQUENCY 20000000
+#endif
+
/* AT25 Registers *******************************************************************/
/* Indentification register values */
@@ -180,7 +185,7 @@ static void at25_lock(FAR struct spi_dev_s *dev)
SPI_SETMODE(dev, CONFIG_AT25_SPIMODE);
SPI_SETBITS(dev, 8);
- (void)SPI_SETFREQUENCY(dev, 20000000);
+ (void)SPI_SETFREQUENCY(dev, CONFIG_AT25_SPIFREQUENCY);
}
/************************************************************************************