Skip to content

Class daisy::System

ClassList > daisy > System

More...

  • #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

enum daisy::System::BootloaderMode {
    STM = 0,
    DAISY,
    DAISY_SKIP_TIMEOUT,
    DAISY_INFINITE_TIMEOUT
};

Specify how the Daisy should return to the bootloader

Parameters:

  • STM return to the STM32-provided bootloader to program internal flash
  • DAISY if the Daisy bootloader is used, this will return to it
  • DAISY_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

constexpr uint32_t daisy::System::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

void daisy::System::DeInit () 

Deinitializer Deinitializes all modules and peripherals set up with Init.


function GetConfig

inline const  Config & daisy::System::GetConfig () const

Returns a const reference to the Systems Configuration struct.


function Init [½]

void daisy::System::Init () 

Default Initializer with no input will create an internal config, and set everything to Defaults


function Init [2/2]

void daisy::System::Init (
    const  Config & config
) 

Configurable Initializer Initializes clock tree, DMA initializaiton and any necessary global inits.


function JumpToQspi

void daisy::System::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

inline daisy::System::System () 

function ~System

inline daisy::System::~System () 

Public Static Functions Documentation

function Delay

static void daisy::System::Delay (
    uint32_t delay_ms
) 

Blocking Delay that uses the SysTick (1ms callback) to wait.

Parameters:

  • delay_ms Time to delay in ms

function DelayTicks

static void daisy::System::DelayTicks (
    uint32_t delay_ticks
) 

Blocking Delay using internal timer to wait

Parameters:

  • delay_ticks Time to ddelay in microseconds

function DelayUs

static void daisy::System::DelayUs (
    uint32_t delay_us
) 

Blocking Delay using internal timer to wait

Parameters:

  • delay_us Time to ddelay in microseconds

function GetBootloaderVersion

static BootInfo::Version daisy::System::GetBootloaderVersion () 

Checks Daisy Bootloader version, if present.


function GetHClkFreq

static uint32_t daisy::System::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

static MemoryRegion daisy::System::GetMemoryRegion (
    uint32_t address
) 

Returns an enum representing the the memory region that the given address belongs to.

Parameters:

  • address The address to be checked

function GetNow

static uint32_t daisy::System::GetNow () 

Returns:

a uint32_t value of milliseconds since the SysTick started


function GetPClk1Freq

static uint32_t daisy::System::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

static uint32_t daisy::System::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

static MemoryRegion daisy::System::GetProgramMemoryRegion () 

Returns an enum representing the current (primary) memory space used for executing the program.


function GetSysClkFreq

static uint32_t daisy::System::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

static uint32_t daisy::System::GetTick () 

Returns:

a uint32_t of ticks at (PCLk1 * 2)Hz Useful for measuring the number of CPU ticks something is taking.


function GetTickFreq

static uint32_t daisy::System::GetTickFreq () 

Returns the tick rate in Hz with which GetTick() is incremented.


function GetUs

static uint32_t daisy::System::GetUs () 

Returns:

a uint32_t of microseconds within the internal timer.


function InitBackupSram

static void daisy::System::InitBackupSram () 

Initializes the backup SRAM


function ResetToBootloader

static void daisy::System::ResetToBootloader (
    BootloaderMode mode=BootloaderMode::STM
) 

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