Intel® Quark™ Microcontroller Software Interface
1.4.0
Intel® Quark™ Microcontroller BSP
|
Always-on Counters. More...
Data Structures | |
struct | qm_aonpt_config_t |
QM Always-on Periodic Timer configuration type. More... | |
Enumerations | |
enum | qm_aonpt_status_t { QM_AONPT_READY = 0, QM_AONPT_EXPIRED } |
Always on counter status. More... | |
Functions | |
int | qm_aonc_enable (const qm_aonc_t aonc) |
Enable the Always-on Counter. More... | |
int | qm_aonc_disable (const qm_aonc_t aonc) |
Disable the Always-on Counter. More... | |
int | qm_aonc_get_value (const qm_aonc_t aonc, uint32_t *const val) |
Get the current value of the Always-on Counter. More... | |
int | qm_aonpt_set_config (const qm_aonc_t aonc, const qm_aonpt_config_t *const cfg) |
Set the Always-on Periodic Timer configuration. More... | |
int | qm_aonpt_get_value (const qm_aonc_t aonc, uint32_t *const val) |
Get the current value of the Always-on Periodic Timer. More... | |
int | qm_aonpt_get_status (const qm_aonc_t aonc, qm_aonpt_status_t *const status) |
Get the current status of an Always-on Periodic Timer. More... | |
int | qm_aonpt_clear (const qm_aonc_t aonc) |
Clear the status of the Always-on Periodic Timer. More... | |
int | qm_aonpt_reset (const qm_aonc_t aonc) |
Reset the Always-on Periodic Timer back to the configured value. More... | |
int | qm_aonpt_save_context (const qm_aonc_t aonc, qm_aonc_context_t *const ctx) |
Save the Always-on Periodic Timer context. More... | |
int | qm_aonpt_restore_context (const qm_aonc_t aonc, const qm_aonc_context_t *const ctx) |
Restore the Always-on Periodic Timer context. More... | |
Always-on Counters.
enum qm_aonpt_status_t |
Always on counter status.
Enumerator | |
---|---|
QM_AONPT_READY |
Default Timer Status. |
QM_AONPT_EXPIRED |
Timer expired. Status must be cleared with qm_aonpt_clear(). |
Definition at line 26 of file qm_aon_counters.h.
int qm_aonc_disable | ( | const qm_aonc_t | aonc | ) |
Disable the Always-on Counter.
[in] | aonc | Always-on counter to read. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 140 of file qm_aon_counters.c.
int qm_aonc_enable | ( | const qm_aonc_t | aonc | ) |
Enable the Always-on Counter.
[in] | aonc | Always-on counter to read. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 130 of file qm_aon_counters.c.
int qm_aonc_get_value | ( | const qm_aonc_t | aonc, |
uint32_t *const | val | ||
) |
Get the current value of the Always-on Counter.
Returns a 32-bit value which represents the number of clock cycles since the counter was first enabled.
[in] | aonc | Always-on counter to read. |
[out] | val | Value of the counter. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 150 of file qm_aon_counters.c.
int qm_aonpt_clear | ( | const qm_aonc_t | aonc | ) |
Clear the status of the Always-on Periodic Timer.
The status must be clear before the Always-on Periodic Timer can trigger another interrupt.
[in] | aonc | Always-on counter to read. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 210 of file qm_aon_counters.c.
int qm_aonpt_get_status | ( | const qm_aonc_t | aonc, |
qm_aonpt_status_t *const | status | ||
) |
Get the current status of an Always-on Periodic Timer.
[in] | aonc | Always-on counter to read. |
[out] | status | Status of the Always-on Periodic Timer. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 195 of file qm_aon_counters.c.
References QM_AONPT_EXPIRED, and QM_AONPT_READY.
int qm_aonpt_get_value | ( | const qm_aonc_t | aonc, |
uint32_t *const | val | ||
) |
Get the current value of the Always-on Periodic Timer.
Returns a 32-bit value which represents the number of clock cycles remaining before the timer fires. This is the initial configured number minus the number of cycles that have passed.
[in] | aonc | Always-on counter to read. |
[out] | val | Value of the Always-on Periodic Timer. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 184 of file qm_aon_counters.c.
int qm_aonpt_reset | ( | const qm_aonc_t | aonc | ) |
Reset the Always-on Periodic Timer back to the configured value.
[in] | aonc | Always-on counter to read. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 224 of file qm_aon_counters.c.
int qm_aonpt_restore_context | ( | const qm_aonc_t | aonc, |
const qm_aonc_context_t *const | ctx | ||
) |
Restore the Always-on Periodic Timer context.
Restore the configuration of the specified AONC peripheral after exiting sleep.
[in] | aonc | AONC index. |
[in] | ctx | AONC context structure. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 246 of file qm_aon_counters.c.
int qm_aonpt_save_context | ( | const qm_aonc_t | aonc, |
qm_aonc_context_t *const | ctx | ||
) |
Save the Always-on Periodic Timer context.
Save the configuration of the specified AONC peripheral before entering sleep.
[in] | aonc | AONC index. |
[out] | ctx | AONC context structure. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 235 of file qm_aon_counters.c.
int qm_aonpt_set_config | ( | const qm_aonc_t | aonc, |
const qm_aonpt_config_t *const | cfg | ||
) |
Set the Always-on Periodic Timer configuration.
This includes the initial value of the Always-on Periodic Timer, the interrupt enable and the callback function that will be run when the timer expiers and an interrupt is triggered. The Periodic Timer is disabled if the counter is set to 0.
[in] | aonc | Always-on counter to read. |
[in] | cfg | New configuration for the Always-on Periodic Timer. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 160 of file qm_aon_counters.c.
References qm_aonpt_config_t::callback, qm_aonpt_config_t::callback_data, qm_aonpt_config_t::count, and qm_aonpt_config_t::int_en.