SdFat
Public Member Functions | Static Public Member Functions | List of all members
SdFile Class Reference

FAT16/FAT32 file with Print. More...

#include <SdFat.h>

Inheritance diagram for SdFile:
Inheritance graph
[legend]
Collaboration diagram for SdFile:
Collaboration graph
[legend]

Public Member Functions

 SdFile (const char *path, oflag_t oflag)
 
size_t write (uint8_t b)
 

Static Public Member Functions

static void dateTimeCallback (void(*dateTime)(uint16_t *date, uint16_t *time))
 
static void dateTimeCallbackCancel ()
 

Detailed Description

FAT16/FAT32 file with Print.

Constructor & Destructor Documentation

◆ SdFile()

SdFile::SdFile ( const char *  path,
oflag_t  oflag 
)
inline

Create an open SdFile.

Parameters
[in]pathpath for file.
[in]oflagopen flags.

Member Function Documentation

◆ dateTimeCallback()

static void SdFile::dateTimeCallback ( void(*)(uint16_t *date, uint16_t *time)  dateTime)
inlinestatic

Set the date/time callback function

Parameters
[in]dateTimeThe user's call back function. The callback function is of the form:
void dateTime(uint16_t* date, uint16_t* time) {
uint16_t year;
uint8_t month, day, hour, minute, second;
// User gets date and time from GPS or real-time clock here
// return date using FAT_DATE macro to format fields
*date = FAT_DATE(year, month, day);
// return time using FAT_TIME macro to format fields
*time = FAT_TIME(hour, minute, second);
}

Sets the function that is called when a file is created or when a file's directory entry is modified by sync(). All timestamps, access, creation, and modify, are set when a file is created. sync() maintains the last access date and last modify date/time.

◆ dateTimeCallbackCancel()

static void SdFile::dateTimeCallbackCancel ( )
inlinestatic

Cancel the date/time callback function.

◆ write()

size_t PrintFile< SdBaseFile >::write ( uint8_t  b)
inlineinherited

Write a single byte.

Parameters
[in]bbyte to write.
Returns
one for success.

The documentation for this class was generated from the following file: