2 * @brief LPC18xx/43xx EMC driver
\r
5 * Copyright(C) NXP Semiconductors, 2012
\r
6 * All rights reserved.
\r
9 * Software that is described herein is for illustrative purposes only
\r
10 * which provides customers with programming information regarding the
\r
11 * LPC products. This software is supplied "AS IS" without any warranties of
\r
12 * any kind, and NXP Semiconductors and its licensor disclaim any and
\r
13 * all warranties, express or implied, including all implied warranties of
\r
14 * merchantability, fitness for a particular purpose and non-infringement of
\r
15 * intellectual property rights. NXP Semiconductors assumes no responsibility
\r
16 * or liability for the use of the software, conveys no license or rights under any
\r
17 * patent, copyright, mask work right, or any other intellectual property rights in
\r
18 * or to any products. NXP Semiconductors reserves the right to make changes
\r
19 * in the software without notification. NXP Semiconductors also makes no
\r
20 * representation or warranty that such application will be suitable for the
\r
21 * specified use without further testing or modification.
\r
24 * Permission to use, copy, modify, and distribute this software and its
\r
25 * documentation is hereby granted, under NXP Semiconductors' and its
\r
26 * licensor's relevant copyrights in the software, without fee, provided that it
\r
27 * is used in conjunction with NXP Semiconductors microcontrollers. This
\r
28 * copyright, permission, and disclaimer notice must appear in all copies of
\r
32 #ifndef __EMC_18XX_43XX_H_
\r
33 #define __EMC_18XX_43XX_H_
\r
39 /** @defgroup EMC_18XX_43XX CHIP: LPC18xx/43xx EMC Driver
\r
40 * @ingroup CHIP_18XX_43XX_Drivers
\r
42 * The EMC interface clocks must be enabled outside this driver prior to
\r
43 * calling any function of this driver with the
\r
44 * Chip_Clock_EnableOpts(CLK_MX_EMC_DIV) and Chip_Clock_Enable(CLK_MX_EMC)
\r
49 * Dynamic Chip Select Address
\r
51 #define EMC_ADDRESS_DYCS0 (0x28000000)
\r
52 #define EMC_ADDRESS_DYCS1 (0x30000000)
\r
53 #define EMC_ADDRESS_DYCS2 (0x60000000)
\r
54 #define EMC_ADDRESS_DYCS3 (0x70000000)
\r
57 * Static Chip Select Address
\r
59 #define EMC_ADDRESS_CS0 (0x1C000000)
\r
60 #define EMC_ADDRESS_CS1 (0x1D000000)
\r
61 #define EMC_ADDRESS_CS2 (0x1E000000)
\r
62 #define EMC_ADDRESS_CS3 (0x1F000000)
\r
65 * @brief Dyanmic memory setup
\r
66 * @param Dynamic_Config : Pointer to dynamic memory setup data
\r
69 void Chip_EMC_Dynamic_Init(IP_EMC_DYN_CONFIG_T *Dynamic_Config);
\r
72 * @brief Static memory setup
\r
73 * @param Static_Config : Pointer to static memory setup data
\r
76 void Chip_EMC_Static_Init(IP_EMC_STATIC_CONFIG_T *Static_Config);
\r
79 * @brief Enable Dynamic Memory Controller
\r
80 * @param Enable : 1 = Enable Dynamic Memory Controller, 0 = Disable
\r
83 STATIC INLINE void Chip_EMC_Dynamic_Enable(uint8_t Enable)
\r
85 IP_EMC_Dynamic_Enable(LPC_EMC, Enable);
\r
89 * @brief Mirror CS1 to CS0 and DYCS0
\r
90 * @param Enable : 1 = Mirror, 0 = Normal Memory Map
\r
93 STATIC INLINE void Chip_EMC_Mirror(uint8_t Enable)
\r
95 IP_EMC_Mirror(LPC_EMC, Enable);
\r
100 * @param Enable : 1 = Enable, 0 = Disable
\r
103 STATIC INLINE void Chip_EMC_Enable(uint8_t Enable)
\r
105 IP_EMC_Enable(LPC_EMC, Enable);
\r
109 * @brief Set EMC LowPower Mode
\r
110 * @param Enable : 1 = Enable, 0 = Disable
\r
112 * @note This function should only be called when the memory
\r
113 * controller is not busy (bit 0 of the status register is not set).
\r
115 STATIC INLINE void Chip_EMC_LowPowerMode(uint8_t Enable)
\r
117 IP_EMC_LowPowerMode(LPC_EMC, Enable);
\r
121 * @brief Initialize EMC
\r
122 * @param Enable : 1 = Enable, 0 = Disable
\r
123 * @param EndianMode : Endian Mode, 0 = Little, 1 = Big
\r
126 STATIC INLINE void Chip_EMC_Init(uint32_t Enable, uint32_t EndianMode)
\r
128 IP_EMC_Init(LPC_EMC, Enable, 0, EndianMode);
\r
132 * @brief Set Static Memory Extended Wait in Clock
\r
133 * @param Wait16Clks : Number of '16 clock' delay cycles
\r
136 STATIC INLINE void Chip_EMC_SetStaticExtendedWait(uint32_t Wait16Clks)
\r
138 IP_EMC_SetStaticExtendedWait(LPC_EMC, Wait16Clks);
\r
149 #endif /* __EMC_18XX_43XX_H_ */
\r