ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
main.c File Reference

Test the RTC peripherial is functional. More...

#include <libents/util/time.h>
#include <libtock-sync/peripherals/rtc.h>
#include <libtock-sync/services/alarm.h>
#include <stdio.h>
#include <string.h>
#include <unity.h>

Go to the source code of this file.

Functions

void setUp (void)
 Run at the start of every test.
 
void tearDown (void)
 Run at the end of every test.
 
void test_rtc_exists (void)
 
void test_set_date (void)
 
void test_get_date (void)
 
void test_get_date_delay (void)
 
void test_time_epoch (void)
 
void test_rtc_date_to_epoch (void)
 
void test_epoch_to_rtc_date (void)
 
int main (void)
 

Detailed Description

Test the RTC peripherial is functional.

Checks the following:

  • RTC driver is enabled in the kernel
  • Date can be set
  • Date can be get
  • Date is retained after going to sleep
Author
John Madden
Date
2027-07-23

Copyright (c) 2026 jLab, UCSC

Definition in file main.c.

Function Documentation

◆ main()

◆ setUp()

void setUp ( void  )

Run at the start of every test.

Definition at line 33 of file main.c.

◆ tearDown()

void tearDown ( void  )

Run at the end of every test.

Definition at line 38 of file main.c.

◆ test_epoch_to_rtc_date()

void test_epoch_to_rtc_date ( void  )

Definition at line 122 of file main.c.

References epoch(), and epoch_to_rtc_date().

Referenced by main().

◆ test_get_date()

void test_get_date ( void  )

Definition at line 63 of file main.c.

Referenced by main().

◆ test_get_date_delay()

void test_get_date_delay ( void  )

Definition at line 80 of file main.c.

Referenced by main().

◆ test_rtc_date_to_epoch()

void test_rtc_date_to_epoch ( void  )

Definition at line 107 of file main.c.

References epoch(), and rtc_date_to_epoch().

Referenced by main().

◆ test_rtc_exists()

void test_rtc_exists ( void  )

Definition at line 40 of file main.c.

Referenced by main().

◆ test_set_date()

void test_set_date ( void  )

Definition at line 45 of file main.c.

Referenced by main().

◆ test_time_epoch()

void test_time_epoch ( void  )

Definition at line 99 of file main.c.

References epoch(), and set_epoch().

Referenced by main().