Contiki-NG
|
Driver for the RE-Mote on-board ultra-low power RTCC (Real Time Clock Calendar) More...
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 configuration macros | |
#define | RTCC_SET_DEFAULT_CONFIG 1 |
#define | RTCC_CLEAR_INT_MANUALLY 1 |
#define | RTCC_SET_AUTOCAL 1 |
RTCC default configuration structure | |
typedef struct ab080x_register_config | ab080x_register_config_t |
static const ab080x_register_config_t | ab080x_default_setting [] |
Callback function to handle the RTCC alarm interrupt and macro | |
void(* | rtcc_int1_callback )(uint8_t value) |
#define | RTCC_REGISTER_INT1(ptr) rtcc_int1_callback = ptr; |
RTCC error values | |
#define | AB08_ERROR (-1) |
#define | AB08_SUCCESS 0x00 |
RTCC enumeration and options |
RTCC User functions | |
int8_t | rtcc_set_time_date (simple_td_map *data) |
Set the time and date. More... | |
int8_t | rtcc_get_time_date (simple_td_map *data) |
Get the current time and date. More... | |
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. More... | |
int8_t | rtcc_date_increment_seconds (simple_td_map *data, uint16_t seconds) |
Increments the current date by a number of seconds. More... | |
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). More... | |
int8_t | rtcc_set_autocalibration (uint8_t period) |
Set the autocallibration period. More... | |
int8_t | rtcc_set_calibration (uint8_t mode, int32_t adjust) |
Manually calibrate the RTCC. More... | |
int8_t | rtcc_init (void) |
Initialize the RTCC, configures the I2C bus, interrupts and registers. More... | |
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)
int8_t rtcc_date_increment_seconds | ( | simple_td_map * | data, |
uint16_t | seconds | ||
) |
Increments the current date by a number of seconds.
data | structure to store the date |
seconds | the numberof seconds to increment the date |
Definition at line 568 of file rtcc.c.
References PROCESS, PROCESS_BEGIN, PROCESS_END, PROCESS_EXIT, PROCESS_EXITHANDLER, PROCESS_THREAD(), PROCESS_YIELD_UNTIL, and rtcc_get_time_date().
int8_t rtcc_get_time_date | ( | simple_td_map * | data | ) |
Get the current time and date.
*data | buffer to store the results |
Definition at line 368 of file rtcc.c.
Referenced by rtcc_date_increment_seconds().
int8_t rtcc_init | ( | void | ) |
Initialize the RTCC, configures the I2C bus, interrupts and registers.
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().
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).
value | value to print, see RTCC_PRINT_* options available |
Definition at line 668 of file rtcc.c.
References process_poll().
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.
data | date and time values (in decimal) to match against |
state | set on/off the alarm interruption |
repeat | set the frequency of the alarm (minute, hourly, daily, etc.) |
trigger | interrupt trigger (INT1, INT2 or both) |
Definition at line 391 of file rtcc.c.
References GPIO_ENABLE_INTERRUPT, IOC_OVERRIDE_PUE, ioc_set_over(), and NVIC_EnableIRQ().
int8_t rtcc_set_autocalibration | ( | uint8_t | period | ) |
Set the autocallibration period.
period | autocalibration configuration |
Definition at line 744 of file rtcc.c.
References clock_delay_usec().
Referenced by rtcc_init().
int8_t rtcc_set_calibration | ( | uint8_t | mode, |
int32_t | adjust | ||
) |
Manually calibrate the RTCC.
mode | oscillator to calibrate |
adjust | value (in ppm) to adjust the oscillator |
Definition at line 800 of file rtcc.c.
References gpio_hal_pin_to_mask.