diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-17 20:02:57 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-17 20:02:57 +0000 |
commit | 942e88ce3a1e8b5a5c58ba5578438b9df5a4b5c4 (patch) | |
tree | 3c08fae01ca644560902522b284bb5cd4f068498 /nuttx/configs/lpc4330-xplorer/include/board.h | |
parent | 5da90b889758aac235acf8c1dff93e90ddfbfe7d (diff) | |
download | px4-nuttx-942e88ce3a1e8b5a5c58ba5578438b9df5a4b5c4.tar.gz px4-nuttx-942e88ce3a1e8b5a5c58ba5578438b9df5a4b5c4.tar.bz2 px4-nuttx-942e88ce3a1e8b5a5c58ba5578438b9df5a4b5c4.zip |
Add logic to initialize the LPC43xx SPIFI device
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4949 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/lpc4330-xplorer/include/board.h')
-rw-r--r-- | nuttx/configs/lpc4330-xplorer/include/board.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nuttx/configs/lpc4330-xplorer/include/board.h b/nuttx/configs/lpc4330-xplorer/include/board.h index 6901b8d16..052c1a97f 100644 --- a/nuttx/configs/lpc4330-xplorer/include/board.h +++ b/nuttx/configs/lpc4330-xplorer/include/board.h @@ -151,6 +151,36 @@ #define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY +/* SPIFI clocking **********************************************************/ +/* The SPIFI will receive clocking from a divider per the settings provided + * in this file. The NuttX code will configure PLL1 as the input clock + * for the selected divider + */ + +#if BOARD_FCLKOUT_FREQUENCY < 120000000 +# define BOARD_SPIFI_PLL1 1 /* Use PLL1 directly */ +# undef BOARD_SPIFI_DIVA +#else +# undef BOARD_SPIFI_PLL1 +# define BOARD_SPIFI_DIVA 1 /* Use IDIVA */ +#endif + +#undef BOARD_SPIFI_DIVB +#undef BOARD_SPIFI_DIVC +#undef BOARD_SPIFI_DIVD +#undef BOARD_SPIFI_DIVE + +/* We need to configure the divider so that its output is as close to 120MHz + * without exceeding that value. + */ + +#if BOARD_FCLKOUT_FREQUENCY < 120000000 +# define BOARD_SPIFI_FREQUENCY BOARD_FCLKOUT_FREQUENCY /* 72Mhz? */ +#else +# define BOARD_SPIFI_DIVIDER (2) /* 204MHz / 2 = 102MHz */ +# define BOARD_SPIFI_FREQUENCY (102000000) /* 204MHz / 2 = 102MHz */ +#endif + /* UART clocking ***********************************************************/ /* Configure all U[S]ARTs to use the XTAL input frequency */ |