TI-RTOS Drivers
tidrivers_full_2_20_00_08
|
SDHost driver implementation for the CC3200.
============================================================================
The SDHost header file should be included in an application as follows:
This SDHost driver implementation is designed to operate on a CC3200 SD Host controller using interrupts.
The SDHost driver is a driver designed to hook into FatFs. It implements a set of functions that FatFs needs to call to perform basic block data transfers.
The only functions that can be called by the application are the standard driver framework functions (_open, _close, etc...).
Once the driver has been opened, the application may used the FatFs APIs or the standard C runtime file I/O calls (fopen, fclose, etc...). Once the driver has been closed, ensure the application does NOT make any file I/O calls.
The SDHost driver interface module is joined (at link time) to a NULL terminated array of SDHost_Config data structures named SDHost_config. SDHost_config is implemented in the application with each entry being an instance of a SDHost peripheral. Each entry in SDHost_config contains a:
The SDHost driver interface produces log statements if instrumentation is enabled.
Diagnostics Mask | Log details |
---|---|
Diags_USER1 | basic operations performed |
Diags_USER2 | detailed operations performed |
============================================================================
#include <stdint.h>
#include <ti/drivers/ports/HwiP.h>
#include <ti/drivers/ports/SemaphoreP.h>
#include <ti/drivers/Power.h>
#include <ti/mw/fatfs/ff.h>
#include <ti/mw/fatfs/diskio.h>
Go to the source code of this file.
Data Structures | |
struct | SDHostCC3200_HWAttrs |
SDHostCC3200 Hardware attributes. More... | |
struct | SDHostCC3200_Object |
SDHostCC3200 Object. More... | |
struct | SDHostCC3200_Config |
SDHost Global configuration. More... | |
struct | SDHostCC3200_Params |
SDHostParameters. More... | |
Macros | |
#define | SDHostCC3200_CMD_RESERVED (32) |
#define | SDHostCC3200_STATUS_RESERVED (-32) |
#define | SDHostCC3200_STATUS_SUCCESS (0) |
Successful status code returned by SDHostCC3200_control(). More... | |
#define | SDHostCC3200_STATUS_ERROR (-1) |
Generic error status code returned by SDHostCC3200_control(). More... | |
#define | SDHostCC3200_STATUS_UNDEFINEDCMD (-2) |
An error status code returned by SDHostCC3200_control() for undefined command codes. More... | |
Typedefs | |
typedef enum SDHostCC3200_CardType | SDHostCC3200_CardType |
SD Card type inserted. More... | |
typedef struct SDHostCC3200_HWAttrs | SDHostCC3200_HWAttrs |
typedef struct SDHostCC3200_Object | SDHostCC3200_Object |
SDHostCC3200 Object. More... | |
typedef struct SDHostCC3200_Config * | SDHostCC3200_Handle |
A handle that is returned from a SDHost_open() call. More... | |
typedef struct SDHostCC3200_Config | SDHostCC3200_Config |
SDHost Global configuration. More... | |
typedef struct SDHostCC3200_Params | SDHostCC3200_Params |
SDHostParameters. More... | |
Enumerations | |
enum | SDHostCC3200_CardType { SDHostCC3200_NOCARD = 0, SDHostCC3200_MMC = 1, SDHostCC3200_SDSC = 2, SDHostCC3200_SDHC = 3 } |
SD Card type inserted. More... | |
Functions | |
void | SDHostCC3200_Params_init (SDHostCC3200_Params *params) |
void | SDHostCC3200_close (SDHostCC3200_Handle handle) |
void | SDHostCC3200_init (SDHostCC3200_Handle handle) |
int_fast8_t | SDHostCC3200_control (SDHostCC3200_Handle handle, uint_fast32_t cmd, uintptr_t arg) |
SDHostCC3200_Handle | SDHostCC3200_open (uint_least8_t index, uint_least8_t drv, SDHostCC3200_Params *params) |
typedef enum SDHostCC3200_CardType SDHostCC3200_CardType |
SD Card type inserted.
typedef struct SDHostCC3200_HWAttrs SDHostCC3200_HWAttrs |
typedef struct SDHostCC3200_Object SDHostCC3200_Object |
SDHostCC3200 Object.
The application must not access any member variables of this structure!
typedef struct SDHostCC3200_Config* SDHostCC3200_Handle |
A handle that is returned from a SDHost_open() call.
typedef struct SDHostCC3200_Config SDHostCC3200_Config |
SDHost Global configuration.
The SDHostCC3200_Config structure contains a set of pointers used to characterize the SDHost driver implementation.
This structure needs to be defined before calling SDHost_init() and it must not be changed thereafter.
typedef struct SDHostCC3200_Params SDHostCC3200_Params |
SDHostParameters.
SDSPI Parameters are used to with the SDSPI_open() call. Default values for these parameters are set using SDSPI_Params_init().
void SDHostCC3200_Params_init | ( | SDHostCC3200_Params * | params | ) |
Function to initialize any driver parameters. Note: No custom parameters are currently supported.
void SDHostCC3200_close | ( | SDHostCC3200_Handle | handle | ) |
Function to unmount the FatFs filesystem and unregister the SDHostCC3200 disk I/O functions from SYS/BIOS' FatFS module.
handle | SDHostCC3200_Handle returned by SDHost_open() |
void SDHostCC3200_init | ( | SDHostCC3200_Handle | handle | ) |
Function to initialize the SDHost module
int_fast8_t SDHostCC3200_control | ( | SDHostCC3200_Handle | handle, |
uint_fast32_t | cmd, | ||
uintptr_t | arg | ||
) |
SDHostCC3200_Handle SDHostCC3200_open | ( | uint_least8_t | index, |
uint_least8_t | drv, | ||
SDHostCC3200_Params * | params | ||
) |
Function to mount the FatFs filesystem and register the SDHostCC3200 disk I/O functions with SYS/BIOS' FatFS module.
This function also configures some basic Pin/Clock settings needed for the software chip select with the SDCard.
index | Logical peripheral number indexed into the HWAttrs table. |
drv | Drive Number |
params | SDHost parameters |