#include "led.h"

#include "ownership.h"
MODULE_OWNS_PIN(GPIOA, PIN_LED_PINK);
MODULE_OWNS_PIN(GPIOA, PIN_LED_ORANGE);

void LED_Init(void)
{
    RCC->APB2ENR |= RCC_APB2ENR_IOPAEN;

    GPIOA->CRL = (GPIOA->CRL
        & ~(0x0f << (PIN_LED_PINK * 4))
        & ~(0x0f << (PIN_LED_ORANGE * 4)))
        | (0x02 << (PIN_LED_PINK * 4))      // 2 MHz push-pull output
        | (0x02 << (PIN_LED_ORANGE * 4))    // 2 MHz push-pull output
        ;
}

