Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cubexHal.pdf
Скачиваний:
111
Добавлен:
10.02.2016
Размер:
16.16 Mб
Скачать

UM1725

HAL SD Generic Driver

53.2.10HAL_SD_ReadBlocks

Function Name

HAL_SD_ErrorTypedef HAL_SD_ReadBlocks

 

(SD_HandleTypeDef * hsd, uint32_t * pReadBuffer, uint64_t

 

ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks)

Function Description

Reads block(s) from a specified address in a card.

Parameters

 

hsd: SD handle

 

 

pReadBuffer: pointer to the buffer that will contain the

 

 

received data

 

 

ReadAddr: Address from where data is to be read

 

 

BlockSize: SD card Data block size

 

 

NumberOfBlocks: Number of SD blocks to read

Return values

 

SD Card error state

Notes

 

BlockSize must be 512 bytes.

53.2.11HAL_SD_WriteBlocks

Function Name

HAL_SD_ErrorTypedef HAL_SD_WriteBlocks

 

(SD_HandleTypeDef * hsd, uint32_t * pWriteBuffer, uint64_t

 

WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks)

Function Description

Allows to write block(s) to a specified address in a card.

Parameters

 

hsd: SD handle

 

 

pWriteBuffer: pointer to the buffer that will contain the data

 

 

to transmit

 

WriteAddr: Address from where data is to be written

 

 

BlockSize: SD card Data block size

 

 

NumberOfBlocks: Number of SD blocks to write

Return values

 

SD Card error state

Notes

 

BlockSize must be 512 bytes.

53.2.12HAL_SD_ReadBlocks_DMA

Function Name

HAL_SD_ErrorTypedef HAL_SD_ReadBlocks_DMA

 

 

(SD_HandleTypeDef * hsd, uint32_t * pReadBuffer, uint64_t

 

ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks)

Function Description

Reads block(s) from a specified address in a card.

 

Parameters

hsd: SD handle

 

 

pReadBuffer: Pointer to the buffer that will contain the

 

received data

 

 

ReadAddr: Address from where data is to be read

 

 

BlockSize: SD card Data block size

 

 

NumberOfBlocks: Number of blocks to read.

 

Return values

SD Card error state

 

Notes

This API should be followed by the function

 

 

HAL_SD_CheckReadOperation() to check the completion of

 

the read process

 

 

BlockSize must be 512 bytes.

 

 

DOCID025834 Rev 2

705/900

HAL SD Generic Driver

UM1725

53.2.13HAL_SD_WriteBlocks_DMA

Function Name

HAL_SD_ErrorTypedef HAL_SD_WriteBlocks_DMA

 

(SD_HandleTypeDef * hsd, uint32_t * pWriteBuffer, uint64_t

 

WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks)

Function Description

Writes block(s) to a specified address in a card.

Parameters

 

hsd: SD handle

 

 

pWriteBuffer: pointer to the buffer that will contain the data

 

 

to transmit

 

 

WriteAddr: Address from where data is to be read

 

 

BlockSize: the SD card Data block size

 

 

NumberOfBlocks: Number of blocks to write

Return values

 

SD Card error state

Notes

 

This API should be followed by the function

 

 

HAL_SD_CheckWriteOperation() to check the completion of

 

 

the write process (by SD current status polling).

BlockSize must be 512 bytes.

53.2.14HAL_SD_CheckReadOperation

Function Name

HAL_SD_ErrorTypedef HAL_SD_CheckReadOperation

 

(SD_HandleTypeDef * hsd, uint32_t Timeout)

Function Description

This function waits until the SD DMA data read transfer is finished.

Parameters

 

hsd: SD handle

 

 

Timeout: Timeout duration

Return values

SD Card error state

53.2.15HAL_SD_CheckWriteOperation

Function Name

HAL_SD_ErrorTypedef HAL_SD_CheckWriteOperation

 

(SD_HandleTypeDef * hsd, uint32_t Timeout)

Function Description

This function waits until the SD DMA data write transfer is finished.

Parameters

 

hsd: SD handle

 

 

Timeout: Timeout duration

Return values

SD Card error state

53.2.16 HAL_SD_Erase

Function Name

HAL_SD_ErrorTypedef HAL_SD_Erase (SD_HandleTypeDef *

 

hsd, uint64_t startaddr, uint64_t endaddr)

Function Description

Erases the specified memory area of the given SD card.

Parameters

hsd: SD handle

 

startaddr: Start byte address

 

endaddr: End byte address

Return values

SD Card error state

53.2.17HAL_SD_IRQHandler

706/900

DOCID025834 Rev 2

UM1725

 

HAL SD Generic Driver

Function Name

void HAL_SD_IRQHandler (SD_HandleTypeDef * hsd)

Function Description

This function handles SD card interrupt request.

Parameters

 

hsd: SD handle

Return values

 

None

53.2.18HAL_SD_XferCpltCallback

Function Name

void HAL_SD_XferCpltCallback (SD_HandleTypeDef * hsd)

Function Description

SD end of transfer callback.

Parameters

 

hsd: SD handle

Return values

 

None

53.2.19HAL_SD_XferErrorCallback

Function Name

void HAL_SD_XferErrorCallback (SD_HandleTypeDef * hsd)

Function Description

SD Transfer Error callback.

Parameters

 

hsd: SD handle

Return values

 

None

53.2.20HAL_SD_DMA_RxCpltCallback

Function Name

void HAL_SD_DMA_RxCpltCallback (DMA_HandleTypeDef *

 

hdma)

Function Description

SD Transfer complete Rx callback in non blocking mode.

Parameters

 

hdma: pointer to a DMA_HandleTypeDef structure that

 

 

contains the configuration information for the specified DMA

 

 

module.

Return values

 

None

53.2.21HAL_SD_DMA_RxErrorCallback

Function Name

void HAL_SD_DMA_RxErrorCallback (DMA_HandleTypeDef *

 

hdma)

Function Description

SD DMA transfer complete Rx error callback.

Parameters

 

hdma: pointer to a DMA_HandleTypeDef structure that

 

 

contains the configuration information for the specified DMA

 

 

module.

Return values

 

None

53.2.22HAL_SD_DMA_TxCpltCallback

Function Name

void HAL_SD_DMA_TxCpltCallback (DMA_HandleTypeDef *

 

hdma)

 

Function Description

SD Transfer complete Tx callback in non blocking mode.

 

Parameters

hdma: pointer to a DMA_HandleTypeDef structure that

 

DOCID025834 Rev 2

707/900

HAL SD Generic Driver

UM1725

 

contains the configuration information for the specified DMA

 

module.

Return values

None

53.2.23HAL_SD_DMA_TxErrorCallback

Function Name

void HAL_SD_DMA_TxErrorCallback (DMA_HandleTypeDef *

 

hdma)

Function Description

SD DMA transfer complete error Tx callback.

Parameters

 

hdma: pointer to a DMA_HandleTypeDef structure that

 

 

contains the configuration information for the specified DMA

 

 

module.

Return values

 

None

53.2.24HAL_SD_Get_CardInfo

Function Name

HAL_SD_ErrorTypedef HAL_SD_Get_CardInfo

 

(SD_HandleTypeDef * hsd, HAL_SD_CardInfoTypedef *

 

pCardInfo)

Function Description

Returns information about specific card.

Parameters

hsd: SD handle

 

pCardInfo: Pointer to a HAL_SD_CardInfoTypedef structure

 

that contains all SD cardinformation

Return values

SD Card error state

53.2.25HAL_SD_WideBusOperation_Config

Function Name

HAL_SD_ErrorTypedef HAL_SD_WideBusOperation_Config

 

(SD_HandleTypeDef * hsd, uint32_t WideMode)

Function Description

Enables wide bus operation for the requested card if supported by

 

card.

Parameters

hsd: SD handle

 

WideMode: Specifies the SD card wide bus mode This

 

parameter can be one of the following values:

 

SDIO_BUS_WIDE_8B: 8-bit data transfer (Only for

 

MMC)SDIO_BUS_WIDE_4B: 4-bit data

 

transferSDIO_BUS_WIDE_1B: 1-bit data transfer

Return values

SD Card error state

53.2.26HAL_SD_StopTransfer

Function Name

HAL_SD_ErrorTypedef HAL_SD_StopTransfer

 

(SD_HandleTypeDef * hsd)

Function Description

Aborts an ongoing data transfer.

Parameters

hsd: SD handle

Return values

SD Card error state

708/900

DOCID025834 Rev 2

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]