XDK API  3.6.0
Documentation
Files | Macros | Functions | Variables
SdCardExample

Demo application shows how to write a file to the SD card and later read back the file. More...

+ Collaboration diagram for SdCardExample:

Files

file  AppController.c
 

Macros

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER
 
#define BUFFER_SIZE   UINT16_C(512)
 
#define DRIVE_ZERO   UINT8_C(0)
 
#define SECTOR_VALUE   UINT8_C(6)
 
#define SINGLE_BLOCK   UINT8_C(1)
 
#define SINGLE_SECTOR_LEN   UINT32_C(512)
 

Functions

void AppController_Init (void *cmdProcessorHandle, uint32_t param2)
 Gives control to the Application controller. More...
 
static void AppControllerEnable (void *param1, uint32_t param2)
 To enable the necessary modules for the application. More...
 
static Retcode_T AppControllerFatFileSystemWriteRead (void)
 ThIS API uses the FAT file system library calls. This API will write and read files and it will compare the contents which has been written and read. More...
 
static void AppControllerFire (void *pvParameters)
 Responsible for controlling the SD card example flow. More...
 
static void AppControllerSetup (void *param1, uint32_t param2)
 To setup the necessary modules for the application. More...
 

Variables

static CmdProcessor_TAppCmdProcessor
 
static xTaskHandle AppControllerHandle = NULL
 
Storage_Setup_T StorageSetupInfo
 

Detailed Description

The example will read the presence of an SD Card in the SD Card slot and turn on the Red LED if one is present. The device will then create and write to the text file TEST_XDK.TXT the text. This content is created by SD card Read/Write functionality using FAT32 file system. The will continue to write the SD Card again and again.

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER
#define BUFFER_SIZE   UINT16_C(512)
#define DRIVE_ZERO   UINT8_C(0)

SD Card Drive 0 location

#define SECTOR_VALUE   UINT8_C(6)

SDC Disk sector value

#define SINGLE_BLOCK   UINT8_C(1)

SD- Card Single block write or read

#define SINGLE_SECTOR_LEN   UINT32_C(512)

Single sector size in SDcard

Function Documentation

void AppController_Init ( void *  cmdProcessorHandle,
uint32_t  param2 
)

This is a template function where the user can write his custom application.

Refer interface header for description

+ Here is the call graph for this function:

static void AppControllerEnable ( void *  param1,
uint32_t  param2 
)
static
  • SD Card
  • LED
Parameters
[in]param1Unused
[in]param2Unused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static Retcode_T AppControllerFatFileSystemWriteRead ( void  )
static
Return values
RETCODE_OK- All the file operations are success
SDCARD_APP_ERROR- when there is a mismatch in read and write buffer
FILE_WRITE_ERROR- when file system write is failed
FILE_READ_ERROR- when file system read is failed

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void AppControllerFire ( void *  pvParameters)
static
  • Check whether the storage medium (SD Card)is available or not
  • if FAT_FILE_SYSTEM==1 then will write and read files and it will compare the contents which has been written and read.
  • if FAT_FILE_SYSTEM==0 then it will write some string and read the string. then validate the written and read string.
Parameters
[in]pvParametersUnused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void AppControllerSetup ( void *  param1,
uint32_t  param2 
)
static
  • SD Card
  • LED
Parameters
[in]param1Unused
[in]param2Unused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

CmdProcessor_T* AppCmdProcessor
static

Handle to store the main Command processor handle to be used by run-time event driven threads

xTaskHandle AppControllerHandle = NULL
static

OS thread handle for Application controller to be used by run-time blocking threads

Storage_Setup_T StorageSetupInfo
Initial value:
=
{
.SDCard = true,
.WiFiFileSystem = false
}

Storage setup parameters


All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:54 by doxygen 1.8.8