Intel® Quark™ Microcontroller Software Interface
1.4.0
Intel® Quark™ Microcontroller BSP
|
Memory Protection Region control for Quark Microcontrollers. More...
Data Structures | |
struct | qm_mpr_config_t |
SRAM Memory Protection Region configuration type. More... | |
Functions | |
int | qm_mpr_set_config (const qm_mpr_id_t id, const qm_mpr_config_t *const cfg) |
Configure SRAM controller's Memory Protection Region. More... | |
int | qm_mpr_set_violation_policy (const qm_mpr_viol_mode_t mode, qm_mpr_callback_t callback_fn, void *data) |
Configure MPR violation behaviour. More... | |
int | qm_mpr_save_context (qm_mpr_context_t *const ctx) |
Save MPR context. More... | |
int | qm_mpr_restore_context (const qm_mpr_context_t *const ctx) |
Restore MPR context. More... | |
Memory Protection Region control for Quark Microcontrollers.
int qm_mpr_restore_context | ( | const qm_mpr_context_t *const | ctx | ) |
Restore MPR context.
Restore the configuration of the specified MPR peripheral after exiting sleep.
MPR configuration is lost after sleep and can therefore be modified even if this configuration was locked before sleep. To support persistent configuration, the configuration must be restored when resuming as part of the bootloader.
[in] | ctx | MPR context structure. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 167 of file qm_mpr.c.
References qm_mpr_reg_t::mpr_cfg, qm_mpr_context_t::mpr_cfg, and QM_MPR_NUM.
int qm_mpr_save_context | ( | qm_mpr_context_t *const | ctx | ) |
Save MPR context.
Save the configuration of the specified MPR peripheral before entering sleep.
MPR configuration is lost after sleep and can therefore be modified even if this configuration was locked before sleep. To support persistent configuration, the configuration must be restored when resuming as part of the bootloader.
[out] | ctx | MPR context structure. This must not be NULL. |
0 | on success. |
Negative | errno for possible error codes. |
Definition at line 160 of file qm_mpr.c.
References qm_mpr_reg_t::mpr_cfg, qm_mpr_context_t::mpr_cfg, and QM_MPR_NUM.
int qm_mpr_set_config | ( | const qm_mpr_id_t | id, |
const qm_mpr_config_t *const | cfg | ||
) |
Configure SRAM controller's Memory Protection Region.
[in] | id | Which MPR to configure. |
[in] | cfg | MPR configuration. |
Definition at line 24 of file qm_mpr.c.
References qm_mpr_config_t::agent_read_en_mask, qm_mpr_config_t::agent_write_en_mask, qm_mpr_config_t::en_lock_mask, qm_mpr_config_t::low_bound, QM_MPR_NUM, and qm_mpr_config_t::up_bound.
int qm_mpr_set_violation_policy | ( | const qm_mpr_viol_mode_t | mode, |
qm_mpr_callback_t | callback_fn, | ||
void * | data | ||
) |