You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
457 B
32 lines
457 B
7 years ago
|
#include <libopencm3/stm32/gpio.h>
|
||
|
|
||
|
#include <led.h>
|
||
|
#include <macros.h>
|
||
|
|
||
|
struct led leds[] = {
|
||
|
{ GPIOC, GPIO8, 0 },
|
||
|
};
|
||
|
size_t nleds = count_of(leds);
|
||
|
|
||
|
void led_enable(struct led *led)
|
||
|
{
|
||
|
if (!led)
|
||
|
return;
|
||
|
|
||
|
if (led->invert)
|
||
|
gpio_clear(led->port, led->pin);
|
||
|
else
|
||
|
gpio_set(led->port, led->pin);
|
||
|
}
|
||
|
|
||
|
void led_disable(struct led *led)
|
||
|
{
|
||
|
if (!led)
|
||
|
return;
|
||
|
|
||
|
if (led->invert)
|
||
|
gpio_set(led->port, led->pin);
|
||
|
else
|
||
|
gpio_clear(led->port, led->pin);
|
||
|
}
|