Date / Time Driver

The date / time driver is used for keeping track of the date and time.

Data Structures

ATMO_DateTime_Config_t

ATMO_DateTime_Time_t

Member Name Type
seconds uint8_t
minutes uint8_t
hours uint8_t
days uint8_t
weekday ATMO_DateTime_Weekday_t
month ATMO_DateTime_Month_t
years uint8_t

Type Definitions

Name Definition
ATMO_DateTime_DriverInstance_t typedef struct ATMO_DateTime_DriverInstance_t

Enumerations

enum ATMO_DateTime_Status_t

Name Value
ATMO_DateTime_Status_Success 0x00u
ATMO_DateTime_Status_Fail 0x01u
ATMO_DateTime_Status_Initialized 0x02u
ATMO_DateTime_Status_Invalid 0x03u
ATMO_DateTime_Status_NotSupported 0x04u
ATMO_DateTime_Status_Unspecified 0x05u

enum ATMO_DateTime_Weekday_t

Name Value
ATMO_DateTime_Sunday 0
ATMO_DateTime_Monday 1
ATMO_DateTime_Tuesday 2
ATMO_DateTime_Wednesday 3
ATMO_DateTime_Thursday 4
ATMO_DateTime_Friday 5
ATMO_DateTime_Saturday 6

enum ATMO_DateTime_Month_t

Name Value
ATMO_DateTime_January 0x1
ATMO_DateTime_February 0x2
ATMO_DateTime_March 0x3
ATMO_DateTime_April 0x4
ATMO_DateTime_May 0x5
ATMO_DateTime_June 0x6
ATMO_DateTime_July 0x7
ATMO_DateTime_August 0x8
ATMO_DateTime_September 0x9
ATMO_DateTime_October 0x10
ATMO_DateTime_November 0x11
ATMO_DateTime_December 0x12

Functions

ATMO_Status_t ATMO_DateTime_AddDriverInstance(const ATMO_DateTime_DriverInstance_t *driverInstance, ATMO_DriverInstanceData_t *driverInstanceData, ATMO_DriverInstanceHandle_t *instanceNumber)

This routine will add an instance of a driver for DateTime into the DateTime driver handler.

Parameter Direction Type
instanceNumber N/A ATMO_DriverInstanceHandle_t *
driverInstanceData N/A ATMO_DriverInstanceData_t *
driverInstance N/A const ATMO_DateTime_DriverInstance_t *
Return Type
ATMO_Status_t

ATMO_DateTime_Status_t ATMO_DateTime_Init(ATMO_DriverInstanceHandle_t instance)

Initialize date time driver.

Parameter Direction Type
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_DateTime_Status_t

ATMO_DateTime_Status_t ATMO_DateTime_DeInit(ATMO_DriverInstanceHandle_t instance)

This routine de-initializes the date time driver

Parameter Direction Type
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_DateTime_Status_t

ATMO_DateTime_Status_t ATMO_DateTime_SetConfiguration(ATMO_DriverInstanceHandle_t instance, const ATMO_DateTime_Config_t *config)

Set date time configuration.

Parameter Direction Type
config in const ATMO_DateTime_Config_t *
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_DateTime_Status_t

ATMO_DateTime_Status_t ATMO_DateTime_GetDateTime(ATMO_DriverInstanceHandle_t instance, ATMO_DateTime_Time_t *datetime)

Retrieve the current date and time.

Parameter Direction Type
datetime out ATMO_DateTime_Time_t *
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_DateTime_Status_t

ATMO_DateTime_Status_t ATMO_DateTime_GetDateTimeEpoch(ATMO_DriverInstanceHandle_t instance, uint32_t *datetime)

Retrieve the current date and time.

Parameter Direction Type
datetime out uint32_t *
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_DateTime_Status_t

ATMO_DateTime_Status_t ATMO_DateTime_GetDateTimeIsoStr(ATMO_DriverInstanceHandle_t instance, char *datetime, uint32_t bufferLen)

Retrieve the current date and time.

Parameter Direction Type
bufferLen N/A uint32_t
datetime out char *
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_DateTime_Status_t

ATMO_DateTime_Status_t ATMO_DateTime_SetDateTime(ATMO_DriverInstanceHandle_t instance, ATMO_DateTime_Time_t *datetime)

Set the current date and time.

Parameter Direction Type
datetime in ATMO_DateTime_Time_t *
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_DateTime_Status_t

ATMO_DateTime_Status_t ATMO_DateTime_SetDateTimeEpoch(ATMO_DriverInstanceHandle_t instance, uint32_t datetime)

Set the current date and time.

Parameter Direction Type
datetime in uint32_t
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_DateTime_Status_t

ATMO_DateTime_Status_t ATMO_DateTime_SetDateTimeIsoStr(ATMO_DriverInstanceHandle_t instance, const char *datetime)

Set the current date and time.

Parameter Direction Type
datetime in const char *
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_DateTime_Status_t