c2000ware-core-sdk/driverlib/.meta/usb/usb.board.h.xdt
2023-07-24 14:44:00 +05:30

55 lines
2.2 KiB
Plaintext

% var moduleName = "usb"
% let Common = system.getScript("/driverlib/Common.js");
% var module = system.modules['/driverlib/' + moduleName + '.js'];
%if (module != null)
%{
//*****************************************************************************
//
// USB Configurations
//
//*****************************************************************************
% for(var i = 0; i < module.$instances.length; i++) {
% var instance = module.$instances[i];
% let modInst = instance[moduleName];
% let solution = modInst.$solution;
%let peripheral = system.deviceData.peripherals[solution.peripheralName];
% if (["F2838x"].includes(Common.getDeviceName())){
//
// Define to pass to SysCtl_setAuxClock(). Will configure the clock as follows:
// AUXPLLCLK =
// 25MHz (XTAL_OSC) * 48 (IMULT) / (2 (REFDIV) * 5 (ODIV) * 2(AUXPLLDIV) )
//
// AUXPLLRAWCLK = 120MHz (before the AUXCLK divider)
// USB clock = 60MHz (after the AUXCLK divider)
//
#define DEVICE_AUXSETCLOCK_CFG_USB (SYSCTL_AUXPLL_OSCSRC_XTAL | \
SYSCTL_AUXPLL_IMULT(48) | \
SYSCTL_REFDIV(2U) | SYSCTL_ODIV(5U) | \
SYSCTL_AUXPLL_DIV_2 | \
SYSCTL_AUXPLL_ENABLE | \
SYSCTL_DCC_BASE_0)
% } else if (["F28P65x"].includes(Common.getDeviceName())) {
//
// Define to pass to SysCtl_setAuxClock(). Will configure the clock as follows:
// AUXPLLCLK =
// 25MHz (XTAL_SE) * 12 (IMULT) / (5 (SYSDIV) )
//
#define DEVICE_AUXSETCLOCK_CFG_USB (SYSCTL_OSCSRC_XTAL_SE | SYSCTL_PLL_ENABLE |\
SYSCTL_IMULT(12) | SYSCTL_SYSDIV(5))
% } else {
//
// Define to pass to SysCtl_setAuxClock(). Will configure the clock as follows:
// AUXPLLCLK =
// 20MHz (XTAL_OSC) * 12 (IMULT) / (4 (SYSDIV) )
//
#define DEVICE_AUXSETCLOCK_CFG_USB (SYSCTL_OSCSRC_XTAL | SYSCTL_PLL_ENABLE |\
SYSCTL_IMULT(12) | SYSCTL_SYSDIV(4))
% }
#define `instance.$name`_BASE `peripheral.name`_BASE
void `instance.$name`_init();
% }
%}