/*
 * main.c
 */
#include <stdbool.h>
#include <stdint.h>
#include<stdlib.h>
#include <inc/hw_ints.h>
#include <inc/hw_memmap.h>
#include <inc/hw_types.h>
#include <driverlib/gpio.h>
#include <driverlib/interrupt.h>
#include <driverlib/pin_map.h>
#include <driverlib/sysctl.h>
#include <driverlib/usb.h>
#include <usblib/usblib.h>
#include <usblib/device/usbdevice.h>
#include "customusbd_structs.h"


int main(void) {
	
	 SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
	                       SYSCTL_XTAL_16MHZ);
	 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
	 SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);
	 GPIOPinTypeUSBAnalog(GPIO_PORTD_BASE, GPIO_PIN_4 | GPIO_PIN_5);
	 USBStackModeSet(0, eUSBModeForceDevice, 0);
	 USBIntRegister(USB0_BASE,USB0DeviceIntHandler);
	 IntMasterEnable();
	 USBDCDInit(0,&CustomUSBDevice,NULL);
    while(1);
	return 0;
}
