EE445M RTOS
Taken at the University of Texas Spring 2015
|
Functions | |
int32_t | FlashErase (uint32_t ui32Address) |
int32_t | FlashProgram (uint32_t *pui32Data, uint32_t ui32Address, uint32_t ui32Count) |
tFlashProtection | FlashProtectGet (uint32_t ui32Address) |
int32_t | FlashProtectSet (uint32_t ui32Address, tFlashProtection eProtect) |
int32_t | FlashProtectSave (void) |
int32_t | FlashUserGet (uint32_t *pui32User0, uint32_t *pui32User1) |
int32_t | FlashUserSet (uint32_t ui32User0, uint32_t ui32User1) |
int32_t | FlashUserSave (void) |
void | FlashIntRegister (void(*pfnHandler)(void)) |
void | FlashIntUnregister (void) |
void | FlashIntEnable (uint32_t ui32IntFlags) |
void | FlashIntDisable (uint32_t ui32IntFlags) |
uint32_t | FlashIntStatus (bool bMasked) |
void | FlashIntClear (uint32_t ui32IntFlags) |
Variables | |
static const uint32_t | g_pui32FMPPERegs [] |
static const uint32_t | g_pui32FMPRERegs [] |
int32_t FlashErase | ( | uint32_t | ui32Address | ) |
Erases a block of flash.
ui32Address | is the start address of the flash block to be erased. |
This function erases a block of the on-chip flash. After erasing, the block is filled with 0xFF bytes. Read-only and execute-only blocks cannot be erased.
The flash block size is device-class dependent. All TM4C123x devices use 1-KB blocks but TM4C129x devices use 16-KB blocks. Please consult the device datasheet to determine the block size in use.
This function does not return until the block has been erased.
Definition at line 130 of file flash.c.
References ASSERT, FLASH_ERASE_SIZE, FLASH_FCMISC, FLASH_FCMISC_AMISC, FLASH_FCMISC_ERMISC, FLASH_FCMISC_VOLTMISC, FLASH_FCRIS, FLASH_FCRIS_ARIS, FLASH_FCRIS_ERRIS, FLASH_FCRIS_VOLTRIS, FLASH_FMA, FLASH_FMC, FLASH_FMC_ERASE, FLASH_FMC_WRKEY, and HWREG.
void FlashIntClear | ( | uint32_t | ui32IntFlags | ) |
Clears flash controller interrupt sources.
ui32IntFlags | is the bit mask of the interrupt sources to be cleared. |
The specified flash controller interrupt sources are cleared, so that they no longer assert. The ui32IntFlags parameter can be the logical OR of any of the following values:
This function must be called in the interrupt handler to keep the interrupt from being triggered again immediately upon exit.
Definition at line 838 of file flash.c.
References FLASH_FCMISC, and HWREG.
void FlashIntDisable | ( | uint32_t | ui32IntFlags | ) |
Disables individual flash controller interrupt sources.
ui32IntFlags | is a bit mask of the interrupt sources to be disabled. The ui32IntFlags parameter can be the logical OR of any of the following values: |
This function disables the indicated flash controller interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
Definition at line 757 of file flash.c.
References FLASH_FCIM, and HWREG.
void FlashIntEnable | ( | uint32_t | ui32IntFlags | ) |
Enables individual flash controller interrupt sources.
ui32IntFlags | is a bit mask of the interrupt sources to be enabled. The ui32IntFlags parameter can be the logical OR of any of the following values: |
This function enables the indicated flash controller interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
Definition at line 721 of file flash.c.
References FLASH_FCIM, and HWREG.
void FlashIntRegister | ( | void(*)(void) | pfnHandler | ) |
Registers an interrupt handler for the flash interrupt.
pfnHandler | is a pointer to the function to be called when the flash interrupt occurs. |
This function sets the handler to be called when the flash interrupt occurs. The flash controller can generate an interrupt when an invalid flash access occurs, such as trying to program or erase a read-only block, or trying to read from an execute-only block. It can also generate an interrupt when a program or erase operation has completed. The interrupt is automatically enabled when the handler is registered.
Definition at line 652 of file flash.c.
References INT_FLASH_TM4C123, IntEnable(), and IntRegister().
uint32_t FlashIntStatus | ( | bool | bMasked | ) |
Gets the current interrupt status.
bMasked | is false if the raw interrupt status is required and true if the masked interrupt status is required. |
This function returns the interrupt status for the flash controller. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.
Definition at line 783 of file flash.c.
References FLASH_FCMISC, FLASH_FCRIS, and HWREG.
void FlashIntUnregister | ( | void | ) |
Unregisters the interrupt handler for the flash interrupt.
This function clears the handler to be called when the flash interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler is no longer called.
Definition at line 680 of file flash.c.
References INT_FLASH_TM4C123, IntDisable(), and IntUnregister().
int32_t FlashProgram | ( | uint32_t * | pui32Data, |
uint32_t | ui32Address, | ||
uint32_t | ui32Count | ||
) |
Programs flash.
pui32Data | is a pointer to the data to be programmed. |
ui32Address | is the starting address in flash to be programmed. Must be a multiple of four. |
ui32Count | is the number of bytes to be programmed. Must be a multiple of four. |
This function programs a sequence of words into the on-chip flash. Because the flash is programmed one word at a time, the starting address and byte count must both be multiples of four. It is up to the caller to verify the programmed contents, if such verification is required.
This function does not return until the data has been programmed.
Definition at line 192 of file flash.c.
References ASSERT, FLASH_FCMISC, FLASH_FCMISC_AMISC, FLASH_FCMISC_INVDMISC, FLASH_FCMISC_PROGMISC, FLASH_FCMISC_VOLTMISC, FLASH_FCRIS, FLASH_FCRIS_ARIS, FLASH_FCRIS_INVDRIS, FLASH_FCRIS_PROGRIS, FLASH_FCRIS_VOLTRIS, FLASH_FMA, FLASH_FMC2, FLASH_FMC2_WRBUF, FLASH_FMC2_WRKEY, FLASH_FWBN, FLASH_FWBVAL, and HWREG.
tFlashProtection FlashProtectGet | ( | uint32_t | ui32Address | ) |
Gets the protection setting for a block of flash.
ui32Address | is the start address of the flash block to be queried. |
This function gets the current protection for the specified block of flash. Refer to the device data sheet to determine the granularity for each protection option. A block can be read/write, read-only, or execute-only. Read/write blocks can be read, executed, erased, and programmed. Read-only blocks can be read and executed. Execute-only blocks can only be executed; processor and debugger data reads are not allowed.
Definition at line 276 of file flash.c.
References ASSERT, FLASH_PROTECT_SIZE, FlashExecuteOnly, FlashReadOnly, FlashReadWrite, g_pui32FMPPERegs, g_pui32FMPRERegs, and HWREG.
int32_t FlashProtectSave | ( | void | ) |
Saves the flash protection settings.
This function makes the currently programmed flash protection settings permanent. This operation is non-reversible; a chip reset or power cycle does not change the flash protection.
This function does not return until the protection has been saved.
Definition at line 491 of file flash.c.
References FLASH_FMA, FLASH_FMC, FLASH_FMC_COMT, FLASH_FMC_WRKEY, and HWREG.
int32_t FlashProtectSet | ( | uint32_t | ui32Address, |
tFlashProtection | eProtect | ||
) |
Sets the protection setting for a block of flash.
ui32Address | is the start address of the flash block to be protected. |
eProtect | is the protection to be applied to the block. Can be one of FlashReadWrite, FlashReadOnly, or FlashExecuteOnly. |
This function sets the protection for the specified block of flash. Refer to the device data sheet to determine the granularity for each protection option. Blocks that are read/write can be made read-only or execute-only. Blocks that are read-only can be made execute-only. Blocks that are execute-only cannot have their protection modified. Attempts to make the block protection less stringent (that is, read-only to read/write) result in a failure (and are prevented by the hardware).
Changes to the flash protection are maintained only until the next reset. This protocol allows the application to be executed in the desired flash protection environment to check for inappropriate flash access (via the flash interrupt). To make the flash protection permanent, use the FlashProtectSave() function.
Definition at line 365 of file flash.c.
References ASSERT, FLASH_PROTECT_SIZE, FlashExecuteOnly, FlashReadOnly, FlashReadWrite, g_pui32FMPPERegs, g_pui32FMPRERegs, and HWREG.
int32_t FlashUserGet | ( | uint32_t * | pui32User0, |
uint32_t * | pui32User1 | ||
) |
Gets the user registers.
pui32User0 | is a pointer to the location to store USER Register 0. |
pui32User1 | is a pointer to the location to store USER Register 1. |
This function reads the contents of user registers 0 and 1, and stores them in the specified locations.
Definition at line 534 of file flash.c.
References ASSERT, FLASH_USERREG0, FLASH_USERREG1, and HWREG.
int32_t FlashUserSave | ( | void | ) |
Saves the user registers.
This function makes the currently programmed user register 0 and 1 settings permanent. This operation is non-reversible; a chip reset or power cycle does not change the flash protection.
This function does not return until the protection has been saved.
Definition at line 596 of file flash.c.
References FLASH_FMA, FLASH_FMC, FLASH_FMC_COMT, FLASH_FMC_WRKEY, and HWREG.
int32_t FlashUserSet | ( | uint32_t | ui32User0, |
uint32_t | ui32User1 | ||
) |
Sets the user registers.
ui32User0 | is the value to store in USER Register 0. |
ui32User1 | is the value to store in USER Register 1. |
This function sets the contents of the user registers 0 and 1 to the specified values.
Definition at line 568 of file flash.c.
References FLASH_USERREG0, FLASH_USERREG1, and HWREG.
|
static |
Definition at line 63 of file flash.c.
Referenced by FlashProtectGet(), and FlashProtectSet().
|
static |
Definition at line 89 of file flash.c.
Referenced by FlashProtectGet(), and FlashProtectSet().