STBee Mini support.

This commit is contained in:
NIIBE Yutaka
2010-10-22 12:56:40 +09:00
parent 1d56c8d14f
commit 9869d2c110
8 changed files with 304 additions and 3 deletions

41
boards/STBEE_MINI/board.c Normal file
View File

@@ -0,0 +1,41 @@
#include "config.h"
#include "ch.h"
#include "hal.h"
#include "../common/hwinit.c"
void
hwinit0 (void)
{
hwinit0_common ();
}
void
hwinit1 (void)
{
hwinit1_common ();
/*
* Disable JTAG and SWD, done after hwinit1_common as HAL resets AFIO
*/
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_DISABLE;
/* We use LED2 as optional "error" indicator */
palSetPad (IOPORT1, GPIOA_LED2);
}
void
USB_Cable_Config (FunctionalState NewState)
{
if (NewState != DISABLE)
palSetPad (IOPORT1, GPIOA_USB_ENABLE);
else
palClearPad (IOPORT1, GPIOA_USB_ENABLE);
}
void
set_led (int value)
{
if (value)
palClearPad (IOPORT1, GPIOA_LED1);
else
palSetPad (IOPORT1, GPIOA_LED1);
}