GPIO
This commit is contained in:
8
1gpio/user/inc/gpio.h
Normal file
8
1gpio/user/inc/gpio.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef _GPIO_H
|
||||
#define _GPIO_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void user_gpio_setup(void);
|
||||
|
||||
#endif
|
||||
17
1gpio/user/inc/main.h
Normal file
17
1gpio/user/inc/main.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _MAIN_H
|
||||
#define _MAIN_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// 包含libopencm3内核的相关头文件
|
||||
#include <libopencm3/cm3/systick.h> // 系统滴答定时器相关定义
|
||||
#include <libopencm3/cm3/scb.h> // 系统控制块相关定义
|
||||
|
||||
// 包含STM32 H系列微控制器的相关头文件
|
||||
#include <libopencm3/stm32/rcc.h> // 复位和时钟控制相关定义
|
||||
#include <libopencm3/stm32/pwr.h> // 电源控制相关定义
|
||||
#include <libopencm3/stm32/gpio.h> // 通用输入输出相关定义
|
||||
#include <libopencm3/stm32/flash.h> // 闪存控制相关定义
|
||||
#include <libopencm3/stm32/h7/nvic.h> // 中断向量控制器相关定义
|
||||
|
||||
#endif
|
||||
11
1gpio/user/inc/systick.h
Normal file
11
1gpio/user/inc/systick.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _SYSTICK_H
|
||||
#define _SYSTICK_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
extern volatile uint32_t systick;
|
||||
|
||||
void user_delay_ms(uint32_t ms);
|
||||
void systick_init(uint32_t ticks);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user