Go to the source code of this file.
|
| void | SDWFF3_close (SD_Handle handle) |
| | Function to close a SD peripheral specified by the SD handle. More...
|
| |
| int_fast16_t | SDWFF3_control (SD_Handle handle, uint_fast16_t cmd, void *arg) |
| | Function for setting control parameters of the SDWFF3 driver after it has been opened. More...
|
| |
| uint_fast32_t | SDWFF3_getNumSectors (SD_Handle handle) |
| | Function to obtain the total number of sectors on the SD card. Note: Total Card capacity is the (NumberOfSectors * SectorSize). More...
|
| |
| uint_fast32_t | SDWFF3_getSectorSize (SD_Handle handle) |
| |
| void | SDWFF3_init (SD_Handle handle) |
| | This function initializes the SD driver. More...
|
| |
| int_fast16_t | SDWFF3_initialize (SD_Handle handle) |
| | Function to initialize the SD card. More...
|
| |
| SD_Handle | SDWFF3_open (SD_Handle handle, SD_Params *params) |
| | Function to open the SD peripheral with the index and parameters specified. More...
|
| |
| int_fast16_t | SDWFF3_read (SD_Handle handle, void *buf, int_fast32_t sector, uint_fast32_t secCount) |
| | Function that reads the specified sectors from the SD card. The destination is specified by buf. The starting sector is specified by sector and the total number of sectors to read is provided by secCount. More...
|
| |
| int_fast16_t | SDWFF3_write (SD_Handle handle, const void *buf, int_fast32_t sector, uint_fast32_t secCount) |
| | Function that writes data to the specified sectors of the SD card. The source is specified by buf. The starting sector to write is specified by sector and the total number of sectors to write is provided by secCount. More...
|
| |
§ SDWFF3_EventCB
| typedef void(* SDWFF3_EventCB) (uint8_t event) |
Callback function supplied by the application.
§ Event_Type
| Enumerator |
|---|
| SDWFF3_NULL | |
| SDWFF3_CARD_INSERTED | |
| SDWFF3_CARD_REMOVED | |
| SDWFF3_CARD_WRITE_PROTECTED | |
| SDWFF3_STATUS_ERR | |
§ SDWFF3_close()
Function to close a SD peripheral specified by the SD handle.
The functions are based on SD.h Descriptions will appear there, and expanded here where relevant for WFF3.
======== SDWFF3_close ======== When closing the peripheral, IOs will be reset to what is configured by SysConfig. If power-off while sleep defined in Sys-Config then card must be initialized too.
- Precondition
- SD_open() had to be called first.
- Parameters
-
- See also
- SD_open()
§ SDWFF3_control()
| int_fast16_t SDWFF3_control |
( |
SD_Handle |
handle, |
|
|
uint_fast16_t |
cmd, |
|
|
void * |
arg |
|
) |
| |
Function for setting control parameters of the SDWFF3 driver after it has been opened.
======== SDWFF3_control ========
- Precondition
- SDWFF3_open() has to be called first.
- Parameters
-
| handle | A SDWFF3 handle returned from SDWFF3_open() |
| cmd | The command to execute, supported commands are:
| Command | SD_STATUS_SUCCESS | SD_STATUS_ERROR |
| SDWFF3_CMD_IS_CARD_CONNECTED | Card is connected | Card is NOT connected |
| SDWFF3_CMD_IS_CARD_WRITE_PROTECTED | Card is write protected | Card is write protected |
|
| arg | Not used in SDWFF3. |
- Returns
- Status code
- Return values
-
§ SDWFF3_getNumSectors()
| uint_fast32_t SDWFF3_getNumSectors |
( |
SD_Handle |
handle | ) |
|
Function to obtain the total number of sectors on the SD card. Note: Total Card capacity is the (NumberOfSectors * SectorSize).
- Precondition
- SD Card has been initialized using SD_initialize().
- Parameters
-
- Returns
- The total number of sectors on the SD card, or 0 if an error occurred.
- See also
- SD_initialize()
§ SDWFF3_getSectorSize()
| uint_fast32_t SDWFF3_getSectorSize |
( |
SD_Handle |
handle | ) |
|
The sector size of SD card is always 512 bytes
§ SDWFF3_init()
This function initializes the SD driver.
- Precondition
- The #SD_config[] array must exist and be persistent before this function can be called. This function must also be called before any other SD driver APIs. This function call does not modify any peripheral registers.
- Note
- For initializing the driver correctly, review the example for using the driver above.
§ SDWFF3_initialize()
| int_fast16_t SDWFF3_initialize |
( |
SD_Handle |
handle | ) |
|
Function to initialize the SD card.
- Precondition
- SD controller has been opened by calling SD_open().
- Parameters
-
- Returns
- SD_STATUS_SUCCESS if no errors occurred during the initialization, SD_STATUS_ERROR otherwise.
§ SDWFF3_open()
Function to open the SD peripheral with the index and parameters specified.
- Precondition
- SD controller has been initialized using SD_init().
- Parameters
-
| index | There is one SDWFF3 so index = 0. |
| params | Pointer to a SDWFF3_Param block. SDWFF3CallbackFxn - call-back function for the application. The function must be SDWFF3EventCB type. See example above for template. minDmaTransferSize - Define the threshold for using DMA in transaction. If the number of sector is bigger than minDmaTransferSize, DMA will be used. |
- Returns
- A SD_Handle on success or a NULL on an error or if it has been opened already.
- See also
- SD_init()
-
SD_close()
§ SDWFF3_read()
| int_fast16_t SDWFF3_read |
( |
SD_Handle |
handle, |
|
|
void * |
buf, |
|
|
int_fast32_t |
sector, |
|
|
uint_fast32_t |
secCount |
|
) |
| |
Function that reads the specified sectors from the SD card. The destination is specified by buf. The starting sector is specified by sector and the total number of sectors to read is provided by secCount.
- Precondition
- SD controller has been opened and initialized by calling SD_open() followed by SD_initialize().
- Parameters
-
| handle | A SD_Handle returned from SD_open(). |
| buf | Pointer to a buffer to read data into. |
| sector | Starting sector on the disk to read from. |
| secCount | Number of sectors to be read. |
- Returns
- SD_STATUS_SUCCESS if no errors occurred during the write, SD_STATUS_ERROR otherwise.
- See also
- SD_initialize()
§ SDWFF3_write()
| int_fast16_t SDWFF3_write |
( |
SD_Handle |
handle, |
|
|
const void * |
buf, |
|
|
int_fast32_t |
sector, |
|
|
uint_fast32_t |
secCount |
|
) |
| |
Function that writes data to the specified sectors of the SD card. The source is specified by buf. The starting sector to write is specified by sector and the total number of sectors to write is provided by secCount.
- Precondition
- SD controller has been opened and initialized by calling SD_open() followed by SD_initialize().
- Parameters
-
| handle | A SD_Handle returned from SD_open(). |
| buf | Pointer to a buffer containing data to write to disk. |
| sector | Starting sector on the disk to write to. |
| secCount | Number of sectors to be written. |
- Returns
- SD_STATUS_SUCCESS if no errors occurred during the write, SD_STATUS_ERROR otherwise.
- See also
- SD_initialize()
§ SDWFF3_fxnTable