gnuk/boards/STM32_PRIMER2/board.c

42 lines
589 B
C
Raw Normal View History

2010-10-14 08:08:09 +00:00
#include "config.h"
2010-09-09 00:51:09 +00:00
#include "ch.h"
#include "hal.h"
2010-10-20 01:00:37 +00:00
#include "../common/hwinit.c"
void
hwinit0(void)
{
hwinit0_common ();
2010-09-09 00:51:09 +00:00
}
2010-10-20 01:00:37 +00:00
void
hwinit1(void)
{
hwinit1_common ();
2010-09-12 07:16:08 +00:00
/*
* Clear LED and SHUTDOWN output.
*/
palClearPad (IOPORT5, GPIOE_LED);
palClearPad (IOPORT3, GPIOC_SHUTDOWN);
2010-09-09 00:51:09 +00:00
}
2010-10-19 04:56:43 +00:00
void
USB_Cable_Config (FunctionalState NewState)
{
if (NewState != DISABLE)
palClearPad (IOPORT4, GPIOD_DISC);
else
palSetPad (IOPORT4, GPIOD_DISC);
}
void
set_led (int value)
{
if (value)
palClearPad (IOPORT5, GPIOE_LEDR);
else
palSetPad (IOPORT5, GPIOE_LEDR);
}