SAM Peripheral Access Controller Driver.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include "pac.h"
Functions | |
__no_inline enum status_code | system_peripheral_lock (const uint32_t peripheral_id, const uint32_t key) |
Lock a given peripheral's control registers. More... | |
__no_inline enum status_code | system_peripheral_lock_always (const uint32_t peripheral_id, const uint32_t key) |
Lock a given peripheral's control registers until hardware reset. More... | |
__no_inline enum status_code | system_peripheral_unlock (const uint32_t peripheral_id, const uint32_t key) |
Unlock a given peripheral's control registers. More... | |
__no_inline enum status_code system_peripheral_lock_always | ( | const uint32_t | peripheral_id, |
const uint32_t | key | ||
) |
Lock a given peripheral's control registers until hardware reset.
Locks a given peripheral's control registers, to deny write access to the peripheral to prevent accidental changes to the module's configuration. After lock, the only way to unlock is hardware reset.
[in] | peripheral_id | ID for the peripheral to be locked, sourced via the SYSTEM_PERIPHERAL_ID macro |
[in] | key | Bitwise inverse of peripheral ID, used as key to reduce the chance of accidental locking. See Key-Argument |
STATUS_OK | If the peripheral was successfully locked |
STATUS_ERR_INVALID_ARG | If invalid argument(s) were supplied |
References Assert, STATUS_ERR_INVALID_ARG, and STATUS_OK.