12.6.2.1.2 Function system_peripheral_unlock()
Unlock a given peripheral's control registers.
__no_inline enum status_code system_peripheral_unlock( const uint32_t peripheral_id, const uint32_t key)
Unlocks a given peripheral's control registers, allowing write access to the peripheral so that changes can be made to the module's configuration.
- Warning
-
Unlocking an already locked peripheral will cause a CUP exception, and terminate program execution.
Data direction | Parameter name | Description |
---|---|---|
[in] |
peripheral_id |
ID for the peripheral to be unlocked, sourced via the SYSTEM_PERIPHERAL_ID macro |
[in] |
key |
Bitwise inverse of peripheral ID, used as key to reduce the chance of accidental unlocking. See Key-Argument |
Returns
Status of the peripheral unlock procedure.
Return value | Description |
---|---|
STATUS_OK |
If the peripheral was successfully locked |
STATUS_ERR_INVALID_ARG |
If invalid argument(s) were supplied |