Начало
This commit is contained in:
commit
18b6ad616b
|
|
@ -0,0 +1,31 @@
|
||||||
|
//
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
//
|
||||||
|
// Created by cfif on 05.05.23.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef WATER_BOX_BSD_GPIOS_H
|
||||||
|
#define WATER_BOX_BSD_GPIOS_H
|
||||||
|
|
||||||
|
#include "SerialPorts.h"
|
||||||
|
#include "GpioPin.h"
|
||||||
|
#include "PowerManagement.h"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
tLed Led;
|
||||||
|
tRs485DirectionPins comIntDir;
|
||||||
|
} tGpios;
|
||||||
|
|
||||||
|
extern tGpios GPIOS;
|
||||||
|
|
||||||
|
void Gpios_Init();
|
||||||
|
|
||||||
|
#endif //WATER_BOX_BSD_GPIOS_H
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"dep": [
|
||||||
|
{
|
||||||
|
"type": "git",
|
||||||
|
"provider": "HVAC_DEV",
|
||||||
|
"repo": "GpioPin_ARTERY_AT32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "git",
|
||||||
|
"provider": "HVAC_DEV",
|
||||||
|
"repo": "SystemDelay_CMSIS_RTOS"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"cmake": {
|
||||||
|
"inc_dirs": [
|
||||||
|
"./"
|
||||||
|
],
|
||||||
|
"srcs": [
|
||||||
|
"Gpios.c"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue