Intel® Quark™ Microcontroller Software Interface  1.4.0
Intel® Quark™ Microcontroller BSP
MPR

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...
 

Detailed Description

Memory Protection Region control for Quark Microcontrollers.

Function Documentation

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.

Parameters
[in]ctxMPR context structure. This must not be NULL.
Returns
Standard errno return type for QMSI.
Return values
0on success.
Negativeerrno 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.

Parameters
[out]ctxMPR context structure. This must not be NULL.
Returns
Standard errno return type for QMSI.
Return values
0on success.
Negativeerrno 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.

Parameters
[in]idWhich MPR to configure.
[in]cfgMPR configuration.
Returns
int 0 on success, error code otherwise.

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 
)

Configure MPR violation behaviour.

Parameters
[in]mode(generate interrupt, warm reset, enter probe mode).
[in]callback_fnfor interrupt mode (only).
[in]datauser data for interrupt mode (only).
Returns
int 0 on success, error code otherwise.

Definition at line 89 of file qm_mpr.c.