A library with drivers for different peripherals on the LPC4088 QuickStart Board or related add-on boards.

Dependencies:   FATFileSystem

Dependents:   LPC4088test LPC4088test_ledonly LPC4088test_deleteall LPC4088_RAMtest ... more

Committer:
embeddedartists
Date:
Wed Jun 10 08:34:09 2015 +0000
Revision:
20:e1e36493f347
Parent:
12:15597e45eea0
Fixed compiler error in MCIFileSystem regarding us_ticker_api.h

Who changed what in which revision?

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