Module sam4l::flashcalw
[−]
[src]
Implementation of the SAM4L flash controller.
This implementation of the flash controller for the SAM4L uses interrupts to handle main tasks of a flash -- write, reads, and erases. If modifying this file, you should check whether the flash commands (issued via issue_command) generates an interrupt and design a higher level function based off of that.
Although the datasheet says that when the FRDY interrupt is on, an interrupt will be generated after a command is complete, it doesn't appear to occur for some commands.
A clean interface for reading from flash, writing pages and erasing pages is defined below and should be used to handle the complexity of these tasks.
The driver should be configure()
'd before use, and a Client should be set
to enable a callback after a command is completed.
Almost all of the flash controller functionality is implemented (except for general purpose fuse bits, and more granular control of the cache).
- Author: Kevin Baichoo kbaichoo@cs.stanford.edu
- Date: July 27, 2016
Reexports
use core::cell::Cell; |
use core::ops::Index; |
use core::ops::IndexMut; |
use helpers::DeferredCall; |
use helpers::Task; |
use kernel::ReturnCode; |
use kernel::common::VolatileCell; |
use kernel::common::take_cell::TakeCell; |
use kernel::hil; |
use pm; |
Structs
FLASHCALW | |
FlashcalwRegisters |
Struct of the FLASHCALW registers. Section 14.10 of the datasheet. |
Sam4lPage |
This is a wrapper around a u8 array that is sized to a single page for the
SAM4L. Users of this module must pass an object of this type to use the
|
Enums
FlashCMD |
There are 18 recognized commands for the flash. These are "bare-bones" commands and values that are written to the Flash's command register to inform the flash what to do. Table 14-5. |
FlashState |
FlashState is used to track the current state and command of the flash. |
RegKey | |
Speed |
The two Flash speeds. |
Constants
FLASHCALW_BASE_ADDRS | |
FLASHCALW_CMD_KEY | |
FREQ_PS2_FWS_0_MAX_FREQ | |
NB_OF_REGIONS | |
PAGE_SIZE |
Statics
DEFERRED_CALL | |
FLASH_CONTROLLER |