Перенос на новую организацию GONEC
This commit is contained in:
commit
f1c8696ec5
|
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by xemon on 29.08.22.
|
||||||
|
//
|
||||||
|
#include "Adcs.h"
|
||||||
|
#include "at32f435_437.h"
|
||||||
|
//#include "GpioPin.h"
|
||||||
|
|
||||||
|
tAdcs ADCS;
|
||||||
|
|
||||||
|
void Adcs_Init() {
|
||||||
|
tAdcs *env = &ADCS;
|
||||||
|
|
||||||
|
gpio_init_type gpio_initstructure;
|
||||||
|
crm_periph_clock_enable(CRM_GPIOF_PERIPH_CLOCK, TRUE);
|
||||||
|
crm_periph_clock_enable(CRM_ADC3_PERIPH_CLOCK, TRUE);
|
||||||
|
|
||||||
|
gpio_default_para_init(&gpio_initstructure);
|
||||||
|
|
||||||
|
/* config adc pin as analog input mode */
|
||||||
|
gpio_initstructure.gpio_mode = GPIO_MODE_ANALOG;
|
||||||
|
gpio_initstructure.gpio_pins = GPIO_PINS_8;
|
||||||
|
gpio_init(GPIOF, &gpio_initstructure);
|
||||||
|
|
||||||
|
env->vcc = ADC_Initial(ADC3, ADC_CHANNEL_6, 0, 1, 1);
|
||||||
|
env->vccIo = vAdcGetIo(&env->vcc);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
//
|
||||||
|
// Created by xemon on 29.08.22.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef UVEOS_DEMO_ON_NIIET_MCU_ADCS_H
|
||||||
|
#define UVEOS_DEMO_ON_NIIET_MCU_ADCS_H
|
||||||
|
|
||||||
|
#include "AdcArtery.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
tAdcArtery vcc;
|
||||||
|
tAdcIO vccIo;
|
||||||
|
} tAdcs;
|
||||||
|
|
||||||
|
extern tAdcs ADCS;
|
||||||
|
|
||||||
|
void Adcs_Init();
|
||||||
|
|
||||||
|
#endif //UVEOS_DEMO_ON_NIIET_MCU_ADCS_H
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"dep": [
|
||||||
|
{
|
||||||
|
"type": "git",
|
||||||
|
"provider": "GONEC",
|
||||||
|
"repo": "AdcInterface"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"cmake": {
|
||||||
|
"inc_dirs": [
|
||||||
|
"./"
|
||||||
|
],
|
||||||
|
"srcs": [
|
||||||
|
"*.c"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue