IPC Module - RTC Service

This page contains documentation of the RTC API.

Messages

message rtc_get_time_req
Return message:

rtc_get_time_rsp

Get the RTC time, in UTC.

message rtc_get_time_rsp
Parameters:
message rtc_allocate_alarm_req
Return message:

rtc_allocate_alarm_rsp

Allocate RTC alarm ID. All allocated alarm IDs are stored until shutdown / restart and will need to be re-allocated on startup.

Must be freed with rtc_free_alarm_req_norsp

see a_ipc_msg_rtc_free_alarm_req_norsp

message rtc_allocate_alarm_rsp
Parameters:
  • result (enum rtc_result) – Result of the operation

  • alarm_id (uint8) – Alarm ID, valid values are: 0-19

Allocate RTC alarm response.

message rtc_set_alarm_req
Parameters:
  • alarm_id (uint8) – The ID to set alarm for, must be allocated with ‘rtc_allocate_alarm’

  • time (uint32) – Unix epoch time

Return message:

rtc_set_alarm_rsp

Set RTC alarm request. All set alarms are stored until shutdown / restart and will need to be re-requested on startup.

Note that the alarm programmed into the RTC will still wake the system.

message rtc_set_alarm_rsp
Parameters:

result (enum rtc_result) – Result of the operation

Create RTC alarm response.

message rtc_cancel_alarm_req
Parameters:

alarm_id (uint8) – Alarm ID

Return message:

rtc_cancel_alarm_rsp

Cancel RTC alarm request.

message rtc_cancel_alarm_rsp
Parameters:

result (enum rtc_result) – Result of the operation

Cancel RTC alarm response.

message rtc_free_alarm_req_norsp
Parameters:

alarm_id (uint8) – Alarm ID

Free RTC alarm ID.

This will also cancel an outstanding alarm tied to the ID.

message rtc_alarm_notification_publish_ind
Parameters:

alarm_id (uint8) – Alarm ID

RTC alarm notification event. Sent when an alarm has been expired.

Alarms notifications will be sent when the system is running and when the system is in suspend-to-RAM mode.

message rtc_alarm_notification_subscribe_req

Subscribe to rtc_alarm_notification_publish_ind messages

message rtc_alarm_notification_subscribe_rsp
Parameters:

result (enum ipc_subscribe_result)

Result from rtc_alarm_notification_subscribe_req

message rtc_alarm_notification_unsubscribe_req_norsp

Unsubscribe from rtc_alarm_notification_publish_ind messages

Enums

enum rtc_result

Result codes.

Constant

Value

Description

OK

0

OK

MAX_ALARMS_EXCEEDED

1

Max alarms exceeded

INVALID_ALARM_ID

2

Invalid alarm id

ERROR_UNKNOWN

3

Unknown error