|
Intel® Quark™ Microcontroller Software Interface
1.4.0
Intel® Quark™ Microcontroller BSP
|
PIC timer. More...
Data Structures | |
| struct | qm_pic_timer_config_t |
| PIC timer configuration type. More... | |
Enumerations | |
| enum | qm_pic_timer_mode_t { QM_PIC_TIMER_MODE_ONE_SHOT, QM_PIC_TIMER_MODE_PERIODIC } |
| PIC timer mode type. More... | |
Functions | |
| int | qm_pic_timer_set_config (const qm_pic_timer_config_t *const cfg) |
| Set the PIC timer configuration. More... | |
| int | qm_pic_timer_set (const uint32_t count) |
| Set the current count value of the PIC timer. More... | |
| int | qm_pic_timer_get (uint32_t *const count) |
| Get the current count value of the PIC timer. More... | |
| int | qm_pic_timer_save_context (qm_pic_timer_context_t *const ctx) |
| Save PIC Timer peripheral's context. More... | |
| int | qm_pic_timer_restore_context (const qm_pic_timer_context_t *const ctx) |
| Restore PIC Timer peripheral's context. More... | |
PIC timer.
| enum qm_pic_timer_mode_t |
PIC timer mode type.
| Enumerator | |
|---|---|
| QM_PIC_TIMER_MODE_ONE_SHOT |
One shot mode. |
| QM_PIC_TIMER_MODE_PERIODIC |
Periodic mode. |
Definition at line 21 of file qm_pic_timer.h.
| int qm_pic_timer_get | ( | uint32_t *const | count | ) |
Get the current count value of the PIC timer.
| [out] | count | Pointer to the store the timer count. This must not be NULL. |
| 0 | on success. |
| Negative | errno for possible error codes. |
Definition at line 76 of file qm_pic_timer.c.
| int qm_pic_timer_restore_context | ( | const qm_pic_timer_context_t *const | ctx | ) |
Restore PIC Timer peripheral's context.
Restore the configuration of the specified PIC Timer peripheral after exiting sleep. The timer is restored to the count saved before sleep.
| [in] | ctx | PIC Timer context structure. This must not be NULL. |
| 0 | on success. |
| Negative | errno for possible error codes. |
Definition at line 116 of file qm_pic_timer.c.
References qm_pic_timer_context_t::lvttimer, qm_pic_timer_context_t::timer_dcr, and qm_pic_timer_context_t::timer_icr.
| int qm_pic_timer_save_context | ( | qm_pic_timer_context_t *const | ctx | ) |
Save PIC Timer peripheral's context.
Saves the configuration of the specified PIC Timer peripheral before entering sleep.
| [out] | ctx | PIC Timer context structure. This must not be NULL. |
| 0 | on success. |
| Negative | errno for possible error codes. |
Definition at line 109 of file qm_pic_timer.c.
References qm_pic_timer_context_t::lvttimer, qm_pic_timer_context_t::timer_dcr, and qm_pic_timer_context_t::timer_icr.
| int qm_pic_timer_set | ( | const uint32_t | count | ) |
Set the current count value of the PIC timer.
Set the current count value of the PIC timer. A value equal to 0 effectively stops the timer.
| [in] | count | Value to load the timer with. |
| Always | returns 0. |
| Negative | errno for possible error codes. |
Definition at line 69 of file qm_pic_timer.c.
| int qm_pic_timer_set_config | ( | const qm_pic_timer_config_t *const | cfg | ) |
Set the PIC timer configuration.
Set the PIC timer configuration. This includes timer mode and if interrupts are enabled. If interrupts are enabled, it will configure the callback function.
| [in] | cfg | PIC timer configuration. This must not be NULL. |
| 0 | on success. |
| Negative | errno for possible error codes. |
Definition at line 41 of file qm_pic_timer.c.
References qm_pic_timer_config_t::callback, qm_pic_timer_config_t::callback_data, qm_pic_timer_config_t::int_en, qm_pic_timer_config_t::mode, and QM_PIC_TIMER_MODE_PERIODIC.