#pragma once
#include <stdint.h>
//*****************************************************************************
//
// Defines related to clock configuration
//
//*****************************************************************************
//
// Launchpad Configuration
//
#ifdef _LAUNCHXL_F28379D
//
// 10MHz XTAL on LaunchPad. For use with SysCtl_getClock().
//
#define DEVICE_OSCSRC_FREQ 10000000U
//
// Define to pass to SysCtl_setClock(). Will configure the clock as follows:
// PLLSYSCLK = 10MHz (XTAL_OSC) * 40 (IMULT) * 1 (FMULT) / 2 (PLLCLK_BY_2)
//
#define DEVICE_SETCLOCK_CFG (SYSCTL_OSCSRC_XTAL | SYSCTL_IMULT(40) | \
SYSCTL_FMULT_NONE | SYSCTL_SYSDIV(2) | \
SYSCTL_PLL_ENABLE)
//
// 200MHz SYSCLK frequency based on the above DEVICE_SETCLOCK_CFG. Update the
// code below if a different clock configuration is used!
//
#define DEVICE_SYSCLK_FREQ ((DEVICE_OSCSRC_FREQ * 40 * 1) / 2)
//
// ControlCARD Configuration
//
#else
//
// 20MHz XTAL on controlCARD. For use with SysCtl_getClock().
//
#define DEVICE_OSCSRC_FREQ 20000000U
//
// Define to pass to SysCtl_setClock(). Will configure the clock as follows:
// PLLSYSCLK = 20MHz (XTAL_OSC) * 20 (IMULT) * 1 (FMULT) / 2 (PLLCLK_BY_2)
//
#define DEVICE_SETCLOCK_CFG (SYSCTL_OSCSRC_XTAL | SYSCTL_IMULT(20) | \
SYSCTL_FMULT_NONE | SYSCTL_SYSDIV(2) | \
SYSCTL_PLL_ENABLE)
//
// 200MHz SYSCLK frequency based on the above DEVICE_SETCLOCK_CFG. Update the
// code below if a different clock configuration is used!
//
#define DEVICE_SYSCLK_FREQ ((DEVICE_OSCSRC_FREQ * 20 * 1) / 2)
#endif
//
// 50MHz LSPCLK frequency based on the above DEVICE_SYSCLK_FREQ and a default
// low speed peripheral clock divider of 4. Update the code below if a
// different LSPCLK divider is used!
//
#define DEVICE_LSPCLK_FREQ (DEVICE_SYSCLK_FREQ / 4)
//*****************************************************************************
// Macro to call SysCtl_delay() to achieve a delay in microseconds. The macro
// will convert the desired delay in microseconds to the count value expected
// by the function. \b x is the number of microseconds to delay.
//*****************************************************************************
#define DEVICE_DELAY_US(x) SysCtl_delay( ((x)*(DEVICE_SYSCLK_FREQ/1000000) - 9) / 5)
// Macros used as return value by the Device_bootCPU2 function
//#define STATUS_FAIL 0x0001
//#define STATUS_PASS 0x0000
#ifdef _FLASH
#include <stddef.h>
extern uint16_t RamfuncsLoadStart;
extern uint16_t RamfuncsLoadEnd;
extern uint16_t RamfuncsLoadSize;
extern uint16_t RamfuncsRunStart;
extern uint16_t RamfuncsRunEnd;
extern uint16_t RamfuncsRunSize;
#define DEVICE_FLASH_WAITSTATES 3
#endif
namespace Device{
// The macros that can be used as parameter to the function Device_bootCPU2
enum bootmode{ // enum class geht nicht (anschließend zu adressieren), Mist!
PARALLEL=0x00,
SCI =0x01,
SPI =0x04,
I2C =0x05,
CAN =0x07,
RAM =0x0A,
FLASH =0x0B,
MAX_VALUE=0x0B,
};
void init();
void initGPIO();
bool bootCPU2(bootmode);
}
extern "C" void __error__(const char*filename, uint32_t line,const char*);
// Define to pass to SysCtl_setAuxClock(). Will configure the clock as follows:
// AUXPLLCLK =
// 10MHz (XTAL_OSC) * 12 (IMULT) / (2 (SYSDIV) )
//
#define DEVICE_AUXSETCLOCK_CFG_USB (SYSCTL_OSCSRC_XTAL | SYSCTL_PLL_ENABLE |\
SYSCTL_IMULT(12) | SYSCTL_SYSDIV(2))
void CPUTimerInit();
namespace usb{
void GPIOEnable();
void Delay(uint32_t ui32Delay);
void DeviceIntHandler();
}
Detected encoding: UTF-8 | 0
|