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