在线时间400 小时
UID2075309
注册时间2014-2-25
NXP金币95
TA的每日心情 | 开心 2019-10-17 08:07 |
---|
签到天数: 273 天 连续签到: 1 天 [LV.8]以坛为家I
金牌会员
 
- 积分
- 7520
- 最后登录
- 2021-8-30
|
收到板子几天了,忙着玩,然后又忙着13号的展会,唉!反正就是忙
借加班的时间发个帖子吧,第一次接触LPC的板子,找个例程点个灯吧。
例程已以在之前分享过了,就不上传了,给个链接:
【LPC分享】LPC824例程及教程
https://www.nxpic.org.cn/module/ ... amp;fromuid=2075309
看看程序:
//定义LED引脚
#define LED_PIN PIO0_17
int demo_lpc82x_hw_gpio_entry (void)
{
uint8_t i;
/* 配置引脚方向为输出 */
amhw_lpc82x_gpio_pin_dir_output(AMHW_LPC82X_GPIO, LED_PIN);
/* 间隔0.5秒,LED闪烁5次 */
for (i = 0; i < 5; i++) {
amhw_lpc82x_gpio_pin_out_low(AMHW_LPC82X_GPIO,LED_PIN);
am_mdelay(500);
amhw_lpc82x_gpio_pin_out_high(AMHW_LPC82X_GPIO,LED_PIN);
am_mdelay(500);
}
while (1) {
/* LED以0.2秒一直闪烁 */
amhw_lpc82x_gpio_pin_out_tog(AMHW_LPC82X_GPIO,LED_PIN);
am_mdelay(200);
}
}
//翻转GPIO引脚输出的电平
am_static_inline
void amhw_lpc82x_gpio_pin_out_tog (amhw_lpc82x_gpio_t *p_hw_gpio, int pin)
{
p_hw_gpio->not0[0] = AM_BIT(pin);
}
int am_main (void)
{
AM_DBG_INFO("Start up successful!\r\n");
demo_lpc82x_hw_gpio_entry();
while (1) {
am_mdelay(100);
}
}
芯片用库文件还是很简单的
以下是实验结果:
|
|