Class to drive SDRAM on DISCO_F469NI
Dependents: DISCO-F469NI_SDRAM_demo
SDRAM_DISCO_F469NI.cpp@0:8dee094d9554, 2016-03-18 (annotated)
- Committer:
- adustm
- Date:
- Fri Mar 18 09:43:04 2016 +0000
- Revision:
- 0:8dee094d9554
DISCO_F469NI SDRAM class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adustm | 0:8dee094d9554 | 1 | /* Copyright (c) 2010-2016 mbed.org, MIT License |
adustm | 0:8dee094d9554 | 2 | * |
adustm | 0:8dee094d9554 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
adustm | 0:8dee094d9554 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
adustm | 0:8dee094d9554 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
adustm | 0:8dee094d9554 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
adustm | 0:8dee094d9554 | 7 | * Software is furnished to do so, subject to the following conditions: |
adustm | 0:8dee094d9554 | 8 | * |
adustm | 0:8dee094d9554 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
adustm | 0:8dee094d9554 | 10 | * substantial portions of the Software. |
adustm | 0:8dee094d9554 | 11 | * |
adustm | 0:8dee094d9554 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
adustm | 0:8dee094d9554 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
adustm | 0:8dee094d9554 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
adustm | 0:8dee094d9554 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
adustm | 0:8dee094d9554 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
adustm | 0:8dee094d9554 | 17 | */ |
adustm | 0:8dee094d9554 | 18 | |
adustm | 0:8dee094d9554 | 19 | #include "SDRAM_DISCO_F469NI.h" |
adustm | 0:8dee094d9554 | 20 | |
adustm | 0:8dee094d9554 | 21 | // Constructor |
adustm | 0:8dee094d9554 | 22 | SDRAM_DISCO_F469NI::SDRAM_DISCO_F469NI() |
adustm | 0:8dee094d9554 | 23 | { |
adustm | 0:8dee094d9554 | 24 | BSP_SDRAM_Init(); |
adustm | 0:8dee094d9554 | 25 | } |
adustm | 0:8dee094d9554 | 26 | |
adustm | 0:8dee094d9554 | 27 | // Destructor |
adustm | 0:8dee094d9554 | 28 | SDRAM_DISCO_F469NI::~SDRAM_DISCO_F469NI() |
adustm | 0:8dee094d9554 | 29 | { |
adustm | 0:8dee094d9554 | 30 | BSP_SDRAM_DeInit(); |
adustm | 0:8dee094d9554 | 31 | |
adustm | 0:8dee094d9554 | 32 | } |
adustm | 0:8dee094d9554 | 33 | |
adustm | 0:8dee094d9554 | 34 | //================================================================================================================= |
adustm | 0:8dee094d9554 | 35 | // Public methods |
adustm | 0:8dee094d9554 | 36 | //================================================================================================================= |
adustm | 0:8dee094d9554 | 37 | |
adustm | 0:8dee094d9554 | 38 | |
adustm | 0:8dee094d9554 | 39 | uint8_t SDRAM_DISCO_F469NI::Init(void) |
adustm | 0:8dee094d9554 | 40 | { |
adustm | 0:8dee094d9554 | 41 | return BSP_SDRAM_Init(); |
adustm | 0:8dee094d9554 | 42 | } |
adustm | 0:8dee094d9554 | 43 | |
adustm | 0:8dee094d9554 | 44 | uint8_t SDRAM_DISCO_F469NI::DeInit(void) |
adustm | 0:8dee094d9554 | 45 | { |
adustm | 0:8dee094d9554 | 46 | return BSP_SDRAM_DeInit(); |
adustm | 0:8dee094d9554 | 47 | } |
adustm | 0:8dee094d9554 | 48 | |
adustm | 0:8dee094d9554 | 49 | void SDRAM_DISCO_F469NI::Initialization_sequence(uint32_t RefreshCount) |
adustm | 0:8dee094d9554 | 50 | { |
adustm | 0:8dee094d9554 | 51 | BSP_SDRAM_Initialization_sequence(RefreshCount); |
adustm | 0:8dee094d9554 | 52 | } |
adustm | 0:8dee094d9554 | 53 | |
adustm | 0:8dee094d9554 | 54 | uint8_t SDRAM_DISCO_F469NI::ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) |
adustm | 0:8dee094d9554 | 55 | { |
adustm | 0:8dee094d9554 | 56 | return BSP_SDRAM_ReadData(uwStartAddress, pData, uwDataSize); |
adustm | 0:8dee094d9554 | 57 | } |
adustm | 0:8dee094d9554 | 58 | |
adustm | 0:8dee094d9554 | 59 | uint8_t SDRAM_DISCO_F469NI::ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) |
adustm | 0:8dee094d9554 | 60 | { |
adustm | 0:8dee094d9554 | 61 | return BSP_SDRAM_ReadData_DMA(uwStartAddress, pData, uwDataSize); |
adustm | 0:8dee094d9554 | 62 | } |
adustm | 0:8dee094d9554 | 63 | |
adustm | 0:8dee094d9554 | 64 | uint8_t SDRAM_DISCO_F469NI::WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) |
adustm | 0:8dee094d9554 | 65 | { |
adustm | 0:8dee094d9554 | 66 | return BSP_SDRAM_WriteData(uwStartAddress, pData, uwDataSize); |
adustm | 0:8dee094d9554 | 67 | } |
adustm | 0:8dee094d9554 | 68 | |
adustm | 0:8dee094d9554 | 69 | uint8_t SDRAM_DISCO_F469NI::WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize) |
adustm | 0:8dee094d9554 | 70 | { |
adustm | 0:8dee094d9554 | 71 | return BSP_SDRAM_WriteData_DMA(uwStartAddress, pData, uwDataSize); |
adustm | 0:8dee094d9554 | 72 | } |
adustm | 0:8dee094d9554 | 73 | |
adustm | 0:8dee094d9554 | 74 | uint8_t SDRAM_DISCO_F469NI::Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd) |
adustm | 0:8dee094d9554 | 75 | { |
adustm | 0:8dee094d9554 | 76 | return BSP_SDRAM_Sendcmd(SdramCmd); |
adustm | 0:8dee094d9554 | 77 | } |