SdFat
Functions | Variables
FsDateTime Namespace Reference

Functions

void clearCallback ()
 
void setCallback (void(*dateTime)(uint16_t *date, uint16_t *time))
 
void setCallback (void(*dateTime)(uint16_t *date, uint16_t *time, uint8_t *ms10))
 

Variables

void(* callback )(uint16_t *date, uint16_t *time, uint8_t *ms10) = NULL
 
void(* callback2 )(uint16_t *date, uint16_t *time) = NULL
 

Detailed Description

Date time callback.

Date time callback

Function Documentation

◆ clearCallback()

void FsDateTime::clearCallback ( )

Cancel callback

◆ setCallback() [1/2]

void FsDateTime::setCallback ( void(*)(uint16_t *date, uint16_t *time)  dateTime)

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.

◆ setCallback() [2/2]

void FsDateTime::setCallback ( void(*)(uint16_t *date, uint16_t *time, uint8_t *ms10)  dateTime)

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, uint8_t* ms10) {
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);
*ms10 = <tens of ms since second/1>
}

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.

Variable Documentation

◆ callback

void(* FsDateTime::callback = NULL

Date time callback.

◆ callback2

void(* FsDateTime::callback2 = NULL

Date time callback.