A board support package for the LPC4088 Display Module.
Dependencies: DM_HttpServer DM_USBHost
Dependents: lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more
Fork of DMSupport by
Memory/sdram.h@9:a33326afd686, 2014-12-11 (annotated)
- Committer:
- embeddedartists
- Date:
- Thu Dec 11 18:23:07 2014 +0000
- Revision:
- 9:a33326afd686
- Parent:
- 0:6b68dac0d986
Updated documentation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 0:6b68dac0d986 | 1 | /* |
embeddedartists | 9:a33326afd686 | 2 | * Copyright 2014 Embedded Artists AB |
embeddedartists | 0:6b68dac0d986 | 3 | * |
embeddedartists | 0:6b68dac0d986 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
embeddedartists | 0:6b68dac0d986 | 5 | * you may not use this file except in compliance with the License. |
embeddedartists | 0:6b68dac0d986 | 6 | * You may obtain a copy of the License at |
embeddedartists | 0:6b68dac0d986 | 7 | * |
embeddedartists | 0:6b68dac0d986 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
embeddedartists | 0:6b68dac0d986 | 9 | * |
embeddedartists | 0:6b68dac0d986 | 10 | * Unless required by applicable law or agreed to in writing, software |
embeddedartists | 0:6b68dac0d986 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
embeddedartists | 0:6b68dac0d986 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
embeddedartists | 0:6b68dac0d986 | 13 | * See the License for the specific language governing permissions and |
embeddedartists | 0:6b68dac0d986 | 14 | * limitations under the License. |
embeddedartists | 0:6b68dac0d986 | 15 | */ |
embeddedartists | 0:6b68dac0d986 | 16 | |
embeddedartists | 0:6b68dac0d986 | 17 | #ifndef __SDRAM_H |
embeddedartists | 0:6b68dac0d986 | 18 | #define __SDRAM_H |
embeddedartists | 0:6b68dac0d986 | 19 | |
embeddedartists | 0:6b68dac0d986 | 20 | #include "stdint.h" |
embeddedartists | 0:6b68dac0d986 | 21 | |
embeddedartists | 0:6b68dac0d986 | 22 | /* |
embeddedartists | 0:6b68dac0d986 | 23 | * These timing parameters are based on the EMC clock |
embeddedartists | 0:6b68dac0d986 | 24 | * there is no way of ensuring what the EMC clock frequency is |
embeddedartists | 0:6b68dac0d986 | 25 | * without severely bloating the code |
embeddedartists | 0:6b68dac0d986 | 26 | * ENSURE THAT THE EMC clock is one of these values |
embeddedartists | 0:6b68dac0d986 | 27 | */ |
embeddedartists | 0:6b68dac0d986 | 28 | #define SDRAM_SPEED_48 0 |
embeddedartists | 0:6b68dac0d986 | 29 | #define SDRAM_SPEED_50 1 |
embeddedartists | 0:6b68dac0d986 | 30 | #define SDRAM_SPEED_60 2 |
embeddedartists | 0:6b68dac0d986 | 31 | #define SDRAM_SPEED_72 3 |
embeddedartists | 0:6b68dac0d986 | 32 | #define SDRAM_SPEED_80 4 |
embeddedartists | 0:6b68dac0d986 | 33 | |
embeddedartists | 0:6b68dac0d986 | 34 | #define SDRAM_SPEED SDRAM_SPEED_60 |
embeddedartists | 0:6b68dac0d986 | 35 | |
embeddedartists | 0:6b68dac0d986 | 36 | #define SDRAM_CONFIG_32BIT |
embeddedartists | 0:6b68dac0d986 | 37 | #define SDRAM_SIZE 0x2000000 |
embeddedartists | 0:6b68dac0d986 | 38 | |
embeddedartists | 0:6b68dac0d986 | 39 | #define SDRAM_BASE 0xA0000000 /*CS0*/ |
embeddedartists | 0:6b68dac0d986 | 40 | |
embeddedartists | 0:6b68dac0d986 | 41 | /* Initializes the SDRAM. |
embeddedartists | 0:6b68dac0d986 | 42 | * |
embeddedartists | 0:6b68dac0d986 | 43 | * The entire SDRAM will be made available to malloc per default. |
embeddedartists | 0:6b68dac0d986 | 44 | * |
embeddedartists | 0:6b68dac0d986 | 45 | * Note that this functions is called internally if malloc requests |
embeddedartists | 0:6b68dac0d986 | 46 | * memory from SDRAM and that hasn't been disabled with a call to |
embeddedartists | 0:6b68dac0d986 | 47 | * sdram_disableMallocSdram(). |
embeddedartists | 0:6b68dac0d986 | 48 | * |
embeddedartists | 0:6b68dac0d986 | 49 | * @returns 0 on success, 1 on failure |
embeddedartists | 0:6b68dac0d986 | 50 | */ |
embeddedartists | 0:6b68dac0d986 | 51 | uint32_t sdram_init(); |
embeddedartists | 0:6b68dac0d986 | 52 | |
embeddedartists | 0:6b68dac0d986 | 53 | /* Prevents malloc from using SDRAM. |
embeddedartists | 0:6b68dac0d986 | 54 | * |
embeddedartists | 0:6b68dac0d986 | 55 | * This function must be called before the first allocation that |
embeddedartists | 0:6b68dac0d986 | 56 | * would have been in SDRAM. If a big allocation has already been |
embeddedartists | 0:6b68dac0d986 | 57 | * made then this call will do nothing as the SDRAM will have been |
embeddedartists | 0:6b68dac0d986 | 58 | * initialized and all SDRAM given to malloc. |
embeddedartists | 0:6b68dac0d986 | 59 | */ |
embeddedartists | 0:6b68dac0d986 | 60 | void sdram_disableMallocSdram(); |
embeddedartists | 0:6b68dac0d986 | 61 | |
embeddedartists | 0:6b68dac0d986 | 62 | #endif /* end __SDRAM_H */ |
embeddedartists | 0:6b68dac0d986 | 63 | /**************************************************************************** |
embeddedartists | 0:6b68dac0d986 | 64 | ** End Of File |
embeddedartists | 0:6b68dac0d986 | 65 | *****************************************************************************/ |