SYS/BIOS  7.00
Data Structures | Macros | Functions
Seconds.h File Reference

Detailed Description

Seconds Manager.

This module is a proxy to the device-specific Seconds module functions as defined in ISeconds.xdc.

This module generates a custom time() function in the configuration-generated .c file. This time() function calls Seconds_get() to get the number of seconds since 1970 from a device-specific delegate function.

Note: For TI codegen tools, time() returns the number of seconds since 1900. The generated time() function takes this into account, and adds the number of seconds from 1900 to 1970 to the value returned by Seconds_get(). This allows functions such as localtime() to work correctly with TI tools.

The actual implementations of the Seconds module functions are provided by the Seconds module delegates.

Additional, family-specific Seconds module APIs may also be provided by the Seconds module delegates.

Calling Context

Function Hwi Swi Task Main Startup
get Y Y Y Y Y
set N N Y Y Y
Definitions:
  • Hwi: API is callable from a Hwi thread.
  • Swi: API is callable from a Swi thread.
  • Task: API is callable from a Task thread.
  • Main: API is callable during any of these phases:
    • In your module startup after this module is started (e.g. Seconds_Module_startupDone() returns true).
    • During xdc.runtime.Startup.lastFxns.
    • During main().
    • During BIOS.startupFxns.
  • Startup: API is callable during any of these phases:
    • During xdc.runtime.Startup.firstFxns.
    • In your module startup before this module is started (e.g. Seconds_Module_startupDone() returns false).

Usage example with run-time support library:

#include <time.h>
time_t t;
struct tm *ltm;
char *curTime;
Seconds_set(STARTTIME);
t = time(NULL);
ltm = localtime(&t);
curTime = asctime(ltm);
System_printf("Time(GMT): %s\n", curTime);
#include <xdc/std.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <ti/sysbios/hal/Seconds_defs.h>
Include dependency graph for Seconds.h:

Go to the source code of this file.

Data Structures

struct  Seconds_Time
 

Macros

#define ti_sysbios_hal_Seconds_long_names
 

Functions

uint32_t Seconds_get (void)
 
uint32_t Seconds_getTime (Seconds_Time *ts)
 
void Seconds_set (uint32_t seconds)
 
uint32_t Seconds_setTime (Seconds_Time *ts)
 

Macro Definition Documentation

§ ti_sysbios_hal_Seconds_long_names

#define ti_sysbios_hal_Seconds_long_names

Function Documentation

§ Seconds_get()

uint32_t Seconds_get ( void  )

§ Seconds_getTime()

uint32_t Seconds_getTime ( Seconds_Time ts)

§ Seconds_set()

void Seconds_set ( uint32_t  seconds)

§ Seconds_setTime()

uint32_t Seconds_setTime ( Seconds_Time ts)
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale