31 lines
1.0 KiB
C
31 lines
1.0 KiB
C
//
|
|
// Created by cfif on 05.05.23.
|
|
//
|
|
#include "Gpios.h"
|
|
#include "SystemDelayInterface.h"
|
|
|
|
tGpios GPIOS;
|
|
|
|
static void Gpios_Led(tLed *env) {
|
|
env->ledR = InitGpioPin(GPIOB, GPIO_PINS_10, GPIO_MODE_OUTPUT, GPIO_PIN_NOREVERSE);
|
|
env->ledG = InitGpioPin(GPIOD, GPIO_PINS_13, GPIO_MODE_OUTPUT, GPIO_PIN_NOREVERSE);
|
|
env->ledB = InitGpioPin(GPIOB, GPIO_PINS_5, GPIO_MODE_OUTPUT, GPIO_PIN_NOREVERSE);
|
|
}
|
|
|
|
void Gpios_Init() {
|
|
|
|
crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
|
|
crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
|
|
crm_periph_clock_enable(CRM_GPIOC_PERIPH_CLOCK, TRUE);
|
|
crm_periph_clock_enable(CRM_GPIOD_PERIPH_CLOCK, TRUE);
|
|
crm_periph_clock_enable(CRM_GPIOE_PERIPH_CLOCK, TRUE);
|
|
crm_periph_clock_enable(CRM_GPIOF_PERIPH_CLOCK, TRUE);
|
|
crm_periph_clock_enable(CRM_GPIOH_PERIPH_CLOCK, TRUE);
|
|
crm_periph_clock_enable(CRM_GPIOG_PERIPH_CLOCK, TRUE);
|
|
|
|
tGpios *env = &GPIOS;
|
|
|
|
env->comIntDir.de = InitGpioPin(GPIOD, GPIO_PINS_12, GPIO_MODE_OUTPUT, GPIO_PIN_NOREVERSE);
|
|
|
|
Gpios_Led(&env->Led);
|
|
} |