Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DISCO-F469NI_SD_demo StoreBitmaps IntegrationPotentiometer IntegrationCAN ... more
SD_DISCO_F469NI.cpp@0:173c7f7ccc35, 2016-03-18 (annotated)
- Committer:
- adustm
- Date:
- Fri Mar 18 15:19:45 2016 +0000
- Revision:
- 0:173c7f7ccc35
- Child:
- 1:c532df66d66a
Class for SD_DISCO_F469NI
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| adustm | 0:173c7f7ccc35 | 1 | /* Copyright (c) 2010-2016 mbed.org, MIT License |
| adustm | 0:173c7f7ccc35 | 2 | * |
| adustm | 0:173c7f7ccc35 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
| adustm | 0:173c7f7ccc35 | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
| adustm | 0:173c7f7ccc35 | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
| adustm | 0:173c7f7ccc35 | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
| adustm | 0:173c7f7ccc35 | 7 | * Software is furnished to do so, subject to the following conditions: |
| adustm | 0:173c7f7ccc35 | 8 | * |
| adustm | 0:173c7f7ccc35 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
| adustm | 0:173c7f7ccc35 | 10 | * substantial portions of the Software. |
| adustm | 0:173c7f7ccc35 | 11 | * |
| adustm | 0:173c7f7ccc35 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
| adustm | 0:173c7f7ccc35 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| adustm | 0:173c7f7ccc35 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| adustm | 0:173c7f7ccc35 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| adustm | 0:173c7f7ccc35 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| adustm | 0:173c7f7ccc35 | 17 | */ |
| adustm | 0:173c7f7ccc35 | 18 | |
| adustm | 0:173c7f7ccc35 | 19 | #include "SD_DISCO_F469NI.h" |
| adustm | 0:173c7f7ccc35 | 20 | |
| adustm | 0:173c7f7ccc35 | 21 | // Constructor |
| adustm | 0:173c7f7ccc35 | 22 | SD_DISCO_F469NI::SD_DISCO_F469NI() |
| adustm | 0:173c7f7ccc35 | 23 | { |
| adustm | 0:173c7f7ccc35 | 24 | BSP_SD_Init(); |
| adustm | 0:173c7f7ccc35 | 25 | } |
| adustm | 0:173c7f7ccc35 | 26 | |
| adustm | 0:173c7f7ccc35 | 27 | // Destructor |
| adustm | 0:173c7f7ccc35 | 28 | SD_DISCO_F469NI::~SD_DISCO_F469NI() |
| adustm | 0:173c7f7ccc35 | 29 | { |
| adustm | 0:173c7f7ccc35 | 30 | BSP_SD_DeInit(); |
| adustm | 0:173c7f7ccc35 | 31 | |
| adustm | 0:173c7f7ccc35 | 32 | } |
| adustm | 0:173c7f7ccc35 | 33 | |
| adustm | 0:173c7f7ccc35 | 34 | //================================================================================================================= |
| adustm | 0:173c7f7ccc35 | 35 | // Public methods |
| adustm | 0:173c7f7ccc35 | 36 | //================================================================================================================= |
| adustm | 0:173c7f7ccc35 | 37 | |
| adustm | 0:173c7f7ccc35 | 38 | |
| adustm | 0:173c7f7ccc35 | 39 | uint8_t SD_DISCO_F469NI::Init(void) |
| adustm | 0:173c7f7ccc35 | 40 | { |
| adustm | 0:173c7f7ccc35 | 41 | return BSP_SD_Init(); |
| adustm | 0:173c7f7ccc35 | 42 | } |
| adustm | 0:173c7f7ccc35 | 43 | |
| adustm | 0:173c7f7ccc35 | 44 | uint8_t SD_DISCO_F469NI::DeInit(void) |
| adustm | 0:173c7f7ccc35 | 45 | { |
| adustm | 0:173c7f7ccc35 | 46 | return BSP_SD_DeInit(); |
| adustm | 0:173c7f7ccc35 | 47 | } |
| adustm | 0:173c7f7ccc35 | 48 | |
| adustm | 0:173c7f7ccc35 | 49 | uint8_t SD_DISCO_F469NI::ITConfig(void) |
| adustm | 0:173c7f7ccc35 | 50 | { |
| adustm | 0:173c7f7ccc35 | 51 | return BSP_SD_ITConfig(); |
| adustm | 0:173c7f7ccc35 | 52 | } |
| adustm | 0:173c7f7ccc35 | 53 | |
| adustm | 0:173c7f7ccc35 | 54 | uint8_t SD_DISCO_F469NI::IsDetected(void) |
| adustm | 0:173c7f7ccc35 | 55 | { |
| adustm | 0:173c7f7ccc35 | 56 | return BSP_SD_IsDetected(); |
| adustm | 0:173c7f7ccc35 | 57 | } |
| adustm | 0:173c7f7ccc35 | 58 | |
| adustm | 0:173c7f7ccc35 | 59 | uint8_t SD_DISCO_F469NI::ReadBlocks(uint32_t *pData, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumOfBlocks) |
| adustm | 0:173c7f7ccc35 | 60 | { |
| adustm | 0:173c7f7ccc35 | 61 | return BSP_SD_ReadBlocks(pData, ReadAddr, BlockSize, NumOfBlocks); |
| adustm | 0:173c7f7ccc35 | 62 | } |
| adustm | 0:173c7f7ccc35 | 63 | |
| adustm | 0:173c7f7ccc35 | 64 | uint8_t SD_DISCO_F469NI::WriteBlocks(uint32_t *pData, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumOfBlocks) |
| adustm | 0:173c7f7ccc35 | 65 | { |
| adustm | 0:173c7f7ccc35 | 66 | return BSP_SD_WriteBlocks(pData, WriteAddr, BlockSize, NumOfBlocks); |
| adustm | 0:173c7f7ccc35 | 67 | } |
| adustm | 0:173c7f7ccc35 | 68 | |
| adustm | 0:173c7f7ccc35 | 69 | uint8_t SD_DISCO_F469NI::ReadBlocks_DMA(uint32_t *pData, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumOfBlocks) |
| adustm | 0:173c7f7ccc35 | 70 | { |
| adustm | 0:173c7f7ccc35 | 71 | return BSP_SD_ReadBlocks_DMA(pData, ReadAddr, BlockSize, NumOfBlocks); |
| adustm | 0:173c7f7ccc35 | 72 | } |
| adustm | 0:173c7f7ccc35 | 73 | |
| adustm | 0:173c7f7ccc35 | 74 | uint8_t SD_DISCO_F469NI::WriteBlocks_DMA(uint32_t *pData, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumOfBlocks) |
| adustm | 0:173c7f7ccc35 | 75 | { |
| adustm | 0:173c7f7ccc35 | 76 | return BSP_SD_WriteBlocks_DMA(pData, WriteAddr, BlockSize, NumOfBlocks); |
| adustm | 0:173c7f7ccc35 | 77 | } |
| adustm | 0:173c7f7ccc35 | 78 | |
| adustm | 0:173c7f7ccc35 | 79 | uint8_t SD_DISCO_F469NI::Erase(uint64_t StartAddr, uint64_t EndAddr) |
| adustm | 0:173c7f7ccc35 | 80 | { |
| adustm | 0:173c7f7ccc35 | 81 | return BSP_SD_Erase(StartAddr, EndAddr); |
| adustm | 0:173c7f7ccc35 | 82 | } |
| adustm | 0:173c7f7ccc35 | 83 | |
| adustm | 0:173c7f7ccc35 | 84 | HAL_SD_TransferStateTypedef SD_DISCO_F469NI::GetStatus(void) |
| adustm | 0:173c7f7ccc35 | 85 | { |
| adustm | 0:173c7f7ccc35 | 86 | return BSP_SD_GetStatus(); |
| adustm | 0:173c7f7ccc35 | 87 | } |
| adustm | 0:173c7f7ccc35 | 88 | |
| adustm | 0:173c7f7ccc35 | 89 | void SD_DISCO_F469NI::GetCardInfo(HAL_SD_CardInfoTypedef *CardInfo) |
| adustm | 0:173c7f7ccc35 | 90 | { |
| adustm | 0:173c7f7ccc35 | 91 | BSP_SD_GetCardInfo(CardInfo); |
| adustm | 0:173c7f7ccc35 | 92 | } |
| adustm | 0:173c7f7ccc35 | 93 |