Class daisy::System¶
#include <system.h>
Classes¶
Type | Name |
---|---|
struct | BootInfo |
struct | Config |
Public Types¶
Type | Name |
---|---|
enum | BootloaderMode |
enum | MemoryRegion |
Public Static Attributes¶
Type | Name |
---|---|
constexpr uint32_t | kQspiBootloaderOffset = 0x40000U |
Public Functions¶
Type | Name |
---|---|
void | DeInit () |
const Config & | GetConfig () const |
void | Init () |
void | Init (const Config & config) |
void | JumpToQspi () |
System () |
|
~System () |
Public Static Functions¶
Type | Name |
---|---|
void | Delay (uint32_t delay_ms) |
void | DelayTicks (uint32_t delay_ticks) |
void | DelayUs (uint32_t delay_us) |
BootInfo::Version | GetBootloaderVersion () |
uint32_t | GetHClkFreq () |
MemoryRegion | GetMemoryRegion (uint32_t address) |
uint32_t | GetNow () |
uint32_t | GetPClk1Freq () |
uint32_t | GetPClk2Freq () |
MemoryRegion | GetProgramMemoryRegion () |
uint32_t | GetSysClkFreq () |
uint32_t | GetTick () |
uint32_t | GetTickFreq () |
uint32_t | GetUs () |
void | InitBackupSram () |
void | ResetToBootloader (BootloaderMode mode=BootloaderMode::STM) |
Detailed Description¶
A handle for interacting with the Core System. This includes the Clock tree, MPU, global DMA initialization, cache handling, and any other necessary global initiailzation
Author:
shensley
Public Types Documentation¶
enum BootloaderMode¶
Specify how the Daisy should return to the bootloader
Parameters:
STM
return to the STM32-provided bootloader to program internal flashDAISY
if the Daisy bootloader is used, this will return to itDAISY_NO_TIMEOUT
if the Daisy bootloader is used, this will return to it and skip the timeout window
enum MemoryRegion¶
enum daisy::System::MemoryRegion {
INTERNAL_FLASH = 0,
ITCMRAM,
DTCMRAM,
SRAM_D1,
SRAM_D2,
SRAM_D3,
SDRAM,
QSPI,
INVALID_ADDRESS
};
Describes the different regions of memory available to the Daisy
Public Static Attributes Documentation¶
variable kQspiBootloaderOffset¶
This constant indicates the Daisy bootloader's offset from the beginning of QSPI's address space. Data written within the first 256K will remain untouched by the Daisy bootloader.
Public Functions Documentation¶
function DeInit¶
Deinitializer Deinitializes all modules and peripherals set up with Init
.
function GetConfig¶
Returns a const reference to the Systems Configuration struct.
function Init [½]¶
Default Initializer with no input will create an internal config, and set everything to Defaults
function Init [2/2]¶
Configurable Initializer Initializes clock tree, DMA initializaiton and any necessary global inits.
function JumpToQspi¶
Jumps to the first address of the external flash chip (0x90000000) If there is no code there, the chip will likely fall through to the while() loop TODO: Documentation/Loader for using external flash coming soon.
function System¶
function ~System¶
Public Static Functions Documentation¶
function Delay¶
Blocking Delay that uses the SysTick (1ms callback) to wait.
Parameters:
delay_ms
Time to delay in ms
function DelayTicks¶
Blocking Delay using internal timer to wait
Parameters:
delay_ticks
Time to ddelay in microseconds
function DelayUs¶
Blocking Delay using internal timer to wait
Parameters:
delay_us
Time to ddelay in microseconds
function GetBootloaderVersion¶
Checks Daisy Bootloader version, if present.
function GetHClkFreq¶
Returns the frequency of the HCLK (AHB) clock. This is derived from the System clock, and used to clock the CPU, memory, and peripherals mapped on the AHB, and APB Bus.
function GetMemoryRegion¶
Returns an enum representing the the memory region that the given address belongs to.
Parameters:
address
The address to be checked
function GetNow¶
Returns:
a uint32_t value of milliseconds since the SysTick started
function GetPClk1Freq¶
Returns the frequency of the PCLK1 (APB1) clock This is used to clock various peripherals, and timers.
It's important to note that many timers run on a clock twice as fast as the peripheral clock for the timer.
function GetPClk2Freq¶
Returns the frequency of the PCLK2 (APB2) clock This is used to clock various peripherals, and timers.
It's important to note that many timers run on a clock twice as fast as the peripheral clock for the timer.
function GetProgramMemoryRegion¶
Returns an enum representing the current (primary) memory space used for executing the program.
function GetSysClkFreq¶
Returns the Frequency of the system clock in Hz This is the primary system clock that is used to generate AXI Peripheral, APB, and AHB clocks.
function GetTick¶
Returns:
a uint32_t of ticks at (PCLk1 * 2)Hz Useful for measuring the number of CPU ticks something is taking.
function GetTickFreq¶
Returns the tick rate in Hz with which GetTick() is incremented.
function GetUs¶
Returns:
a uint32_t of microseconds within the internal timer.
function InitBackupSram¶
Initializes the backup SRAM
function ResetToBootloader¶
Triggers a reset of the seed and starts in bootloader mode to allow firmware update.
The documentation for this class was generated from the following file external-docs/libDaisy/src/sys/system.h