#include "usb_hal.h"
#include "usblib/usbdma.h"
//******************************************************************************
//! Configure the CPU Timer.
//******************************************************************************
void CPUTimerInit() {
// Initialize timer period to maximum.
CPUTimer_setPeriod(CPUTIMER0_BASE,0xFFFFFFFF);
// Initialize Pre-scale counter to divide by 1.
CPUTimer_setPreScaler(CPUTIMER0_BASE, 0U);
// Make sure timer is stopped.
CPUTimer_stopTimer(CPUTIMER0_BASE);
// Reload all counter register with period value:
CPUTimer_reloadTimerCounter(CPUTIMER0_BASE);
}
namespace usb{
void GPIOEnable() { // Set the USB DM and DP.
GPIO_setMasterCore(42, GPIO_CORE_CPU1);
GPIO_setAnalogMode(42, GPIO_ANALOG_ENABLED);
GPIO_setMasterCore(43, GPIO_CORE_CPU1);
GPIO_setAnalogMode(43, GPIO_ANALOG_ENABLED);
}
__interrupt void DeviceIntHandler() {
tDevice::USB0DeviceIntHandler();
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
}
}
Detected encoding: ASCII (7 bit) | 2
|