STM32 Primer 2 support.

This commit is contained in:
NIIBE Yutaka
2010-09-09 09:51:09 +09:00
parent 90a1f0379a
commit 975157c9d8
14 changed files with 464 additions and 12 deletions

View File

@@ -0,0 +1,56 @@
/* Hardware specific USB functions */
/*
* For detail, please see the documentation of
* STM32F10x USB Full Speed Device Library (USB-FS-Device_Lib)
* by STMicroelectronics' MCD Application Team
*/
#include "ch.h"
#include "hal.h"
#include "board.h"
#include "usb_lib.h"
#include "usb_prop.h"
#include "usb_desc.h"
#include "hw_config.h"
#include "platform_config.h"
#include "usb_pwr.h"
void
Enter_LowPowerMode (void)
{
bDeviceState = SUSPENDED;
}
void
Leave_LowPowerMode (void)
{
DEVICE_INFO *pInfo = &Device_Info;
if (pInfo->Current_Configuration != 0)
bDeviceState = CONFIGURED;
else
bDeviceState = ATTACHED;
}
void
USB_Cable_Config (FunctionalState NewState)
{
if (NewState != DISABLE)
palClearPad (IOPORT4, GPIOC_DISC);
else
palSetPad (IOPORT4, GPIOC_DISC);
}
void
Get_SerialNum (void)
{
}
void
set_led (int value)
{
if (value)
palClearPad (IOPORT5, GPIOC_LEDR);
else
palSetPad (IOPORT5, GPIOC_LEDR);
}