当前位置:网站首页>华大4A0GPIO设置
华大4A0GPIO设置
2022-06-24 19:32:00 【纸带】
typedef struct
{
uint16_t u16PinState; /*!< Set pin state to High or Low, @ref GPIO_PinState_Sel for details */
uint16_t u16PinDir; /*!< Pin mode setting, @ref GPIO_PinDirection_Sel for details */
uint16_t u16PinOType; /*!< Output type setting, @ref GPIO_PinOutType_Sel for details */
uint16_t u16PinDrv; /*!< Pin drive capacity setting, @ref GPIO_PinDrv_Sel for details */
uint16_t u16Latch; /*!< Pin latch setting, @ref GPIO_PinLatch_Sel for details */
uint16_t u16PullUp; /*!< Internal pull-up resistor setting, @ref GPIO_PinPU_Sel for details */
uint16_t u16Invert; /*!< Pin input/output invert setting, @ref GPIO_PinInvert_Sel */
uint16_t u16PinIType; /*!< Input type setting, @ref GPIO_PinInType_Sel */
uint16_t u16ExInt; /*!< External interrupt pin setting, @ref GPIO_PinExInt_Sel for details */
uint16_t u16PinAttr; /*!< Digital or analog attribute setting, @ref GPIO_PinMode_Sel for details */
} stc_gpio_init_t;pstcGpioInit->u16PinState = PIN_STATE_RESET;//设置引脚状态是高低电平 pstcGpioInit->u16PinDir = PIN_DIR_IN;//设置输入还是输出 pstcGpioInit->u16PinOType = PIN_OTYPE_CMOS;//设置是NMOS还是PMOS输出 pstcGpioInit->u16PinDrv = PIN_DRV_LOW;//设置推挽输出方式,是高低中速输出 pstcGpioInit->u16Latch = PIN_LATCH_OFF;//锁存使能//锁存失能 pstcGpioInit->u16PullUp = PIN_PU_OFF;/内部上拉的使能调节 pstcGpioInit->u16Invert = PIN_INVERT_OFF;//输入输出。反转使能 pstcGpioInit->u16PinIType = PIN_ITYPE_SMT;//输入的方式分为SMT输入CMOS的输入 pstcGpioInit->u16ExInt = PIN_EXINT_OFF;//外部中断 pstcGpioInit->u16PinAttr = PIN_ATTR_DIGITAL;//数字和模拟属性
关于4A0的一个运用的一般步骤:
stc_gpio_init_t stcGpioInit;//声明一个gpio的配置struct.
/* Register write enable for some required peripherals. */
Peripheral_WE();
/* LED initialize */
(void)GPIO_StructInit(&stcGpioInit);//关于gpio各个属性的设置。
(void)GPIO_Init(LED_GREEN_PORT, LED_GREEN_PIN, &stcGpioInit);//某一个引脚的设置,在来一个初始化。
/* Register write protected for some required peripherals. */
Peripheral_WP();
/* "Turn off" LED before set to output */
GPIO_ResetPins(LED_GREEN_PORT, LED_GREEN_PIN);//设置单独的高低电平输出输入
/* Output enable */
GPIO_OE(LED_GREEN_PORT, LED_GREEN_PIN, Enable);//设置高低电平的输出
for (;;)
{
/* LED */
GPIO_SetPins(LED_GREEN_PORT, LED_GREEN_PIN);//
DDL_DelayMS(2000UL);//延时
GPIO_ResetPins(LED_GREEN_PORT, LED_GREEN_PIN);//
DDL_DelayMS(2000UL);//延时
/* De-init port if necessary */
//GPIO_DeInit();
}边栏推荐
- openGauss内核:简单查询的执行
- 堆排序和快速排序原理实现
- Find the maximum value in each tree row [extension of one of the hierarchical traversals]
- The leader of ERP software in printing industry
- Getting started with typescript
- [notes of Wu Enda] convolutional neural network
- 性能测试工具wrk安装使用详解
- dp问题集
- 第二批入围企业公示!年度TOP100智能网联供应商评选
- Multithreaded finalization
猜你喜欢

是真干不过00后,给我卷的崩溃,想离职了...

cv2导包时报Could not find a version that satisfies the requirement cv2 (from versions: none)
![leetcode:55. Jumping game [classic greed]](/img/da/16e4ab51320d68bd1ade0eb0a2dbc2.png)
leetcode:55. Jumping game [classic greed]

leetcode:45. 跳跃游戏 II【经典贪心】

一个女孩子居然做了十年硬件。。。

Balanced binary search tree

面试官:你说你精通Redis,你看过持久化的配置吗?

Opengauss kernel: simple query execution

我国SaaS产业的发展趋势与路径

Guava中这些Map的骚操作,让我的代码量减少了50%
随机推荐
火狐拖放后,总会默认打开百度搜索,如果是图片,则会打开图片。
基于kruskal的最小生成树
01--- conditions for interference of two trains of waves at the meeting place
Object.defineProperty和Reflect.defineProperty的容错问题
first-order-model实现照片动起来(附工具代码) | 机器学习
cv2导包时报Could not find a version that satisfies the requirement cv2 (from versions: none)
leetcode1720_ 2021-10-14
Principle and application of queue implementation
try-with-resources 中的一个坑,注意避让
我国SaaS产业的发展趋势与路径
Detailed installation and use of performance test tool wrk
Notes on writing questions (18) -- binary tree: common ancestor problem
排查到解决问题的过程:浏览器突然无法访问网页,错误代码:0x80004005,最终定位:“电脑打开热点,电脑就不能上网了”
Yida technology signed a contract with seven wolves to help the digital transformation of "Chinese men's wear leader"
LINQ query collection class introductory cases Wulin expert class
leetcode_ one thousand three hundred and sixty-five
Kubernetes 集群中流量暴露的几种方案
机器学习:线性回归
Flutter 库冲突问题解决
A deep learning model for urban traffic flow prediction with traffic events mined from twitter