Contiki-NG
Loading...
Searching...
No Matches

Files

file  rtcc-config.h
 RTCC configuration file.
 
file  rtcc.c
 Driver for the RE-Mote RF Real Time Clock Calendar (RTCC)
 
file  rtcc.h
 Header file for the RE-Mote RF antenna switch.
 

RTCC User functions

int8_t rtcc_set_time_date (simple_td_map *data)
 Set the time and date.
 
int8_t rtcc_get_time_date (simple_td_map *data)
 Get the current time and date.
 
int8_t rtcc_set_alarm_time_date (simple_td_map *data, uint8_t state, uint8_t repeat, uint8_t trigger)
 Configure the RTCC to match an alarm counter.
 
int8_t rtcc_date_increment_seconds (simple_td_map *data, uint16_t seconds)
 Increments the current date by a number of seconds.
 
int8_t rtcc_print (uint8_t value)
 Print data from the RTCC module, either from the memory map (values in BCD) or actual readable data (decimal).
 
int8_t rtcc_set_autocalibration (uint8_t period)
 Set the autocallibration period.
 
int8_t rtcc_set_calibration (uint8_t mode, int32_t adjust)
 Manually calibrate the RTCC.
 
int8_t rtcc_init (void)
 Initialize the RTCC, configures the I2C bus, interrupts and registers.
 

Detailed Description

Driver for the RE-Mote on-board ultra-low power RTCC (Real Time Clock Calendar)

Driver for the RE-Mote RTCC (Real Time Clock Calendar)

Function Documentation

◆ rtcc_date_increment_seconds()

int8_t rtcc_date_increment_seconds ( simple_td_map * data,
uint16_t seconds )

Increments the current date by a number of seconds.

Parameters
datastructure to store the date
secondsthe numberof seconds to increment the date
Returns
\ AB08_SUCCESS updated date values \ AB08_ERROR failed to return the values

Definition at line 568 of file rtcc.c.

References rtcc_get_time_date().

◆ rtcc_get_time_date()

int8_t rtcc_get_time_date ( simple_td_map * data)

Get the current time and date.

Parameters
*databuffer to store the results
Returns
\ AB08_SUCCESS date/time set \ AB08_ERROR failed to set time/date (enable DEBUG for more info)

Definition at line 368 of file rtcc.c.

Referenced by rtcc_date_increment_seconds().

◆ rtcc_init()

int8_t rtcc_init ( void )

Initialize the RTCC, configures the I2C bus, interrupts and registers.

Returns
\ AB08_SUCCESS date/time set \ AB08_ERROR failed to set time/date (enable DEBUG for more info)

Definition at line 922 of file rtcc.c.

References GPIO_DETECT_EDGE, GPIO_DETECT_FALLING, gpio_hal_register_handler(), GPIO_SET_INPUT, GPIO_SOFTWARE_CONTROL, GPIO_TRIGGER_SINGLE_EDGE, i2c_init(), process_start(), and rtcc_set_autocalibration().

◆ rtcc_print()

int8_t rtcc_print ( uint8_t value)

Print data from the RTCC module, either from the memory map (values in BCD) or actual readable data (decimal).

Parameters
valuevalue to print, see RTCC_PRINT_* options available
Returns
\ AB08_SUCCESS date/time set \ AB08_ERROR failed to set time/date (enable DEBUG for more info)

Definition at line 668 of file rtcc.c.

◆ rtcc_set_alarm_time_date()

int8_t rtcc_set_alarm_time_date ( simple_td_map * data,
uint8_t state,
uint8_t repeat,
uint8_t trigger )

Configure the RTCC to match an alarm counter.

Parameters
datadate and time values (in decimal) to match against
stateset on/off the alarm interruption
repeatset the frequency of the alarm (minute, hourly, daily, etc.)
triggerinterrupt trigger (INT1, INT2 or both)
Returns
\ AB08_SUCCESS date/time set \ AB08_ERROR failed to set time/date (enable DEBUG for more info)

Definition at line 391 of file rtcc.c.

References GPIO_ENABLE_INTERRUPT, IOC_OVERRIDE_PUE, and ioc_set_over().

◆ rtcc_set_autocalibration()

int8_t rtcc_set_autocalibration ( uint8_t period)

Set the autocallibration period.

Parameters
periodautocalibration configuration
Returns
\ AB08_SUCCESS date/time set \ AB08_ERROR failed to set time/date (enable DEBUG for more info)

Definition at line 744 of file rtcc.c.

References clock_delay_usec().

Referenced by rtcc_init().

◆ rtcc_set_calibration()

int8_t rtcc_set_calibration ( uint8_t mode,
int32_t adjust )

Manually calibrate the RTCC.

Parameters
modeoscillator to calibrate
adjustvalue (in ppm) to adjust the oscillator
Returns
\ AB08_SUCCESS date/time set \ AB08_ERROR failed to set time/date (enable DEBUG for more info)

Definition at line 800 of file rtcc.c.

◆ rtcc_set_time_date()

int8_t rtcc_set_time_date ( simple_td_map * data)

Set the time and date.

Parameters
*dataTime and date value (decimal format)
Returns
\ AB08_SUCCESS date/time set \ AB08_ERROR failed to set time/date (enable DEBUG for more info)

Definition at line 271 of file rtcc.c.