4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-28 04:27:07 +08:00

[bsp][nxp] fix gpio and sw pin issue

This commit is contained in:
yandld 2024-02-19 18:36:06 +08:00 committed by Meco Man
parent 2748a6ada4
commit 66cc1f5da1
8 changed files with 1485 additions and 238 deletions

View File

@ -7,7 +7,7 @@
* Date Author Notes * Date Author Notes
* 2018-03-13 Liuguang the first version. * 2018-03-13 Liuguang the first version.
* 2018-03-19 Liuguang add GPIO interrupt mode support. * 2018-03-19 Liuguang add GPIO interrupt mode support.
* 2019-07-15 Magicoe The first version for LPC55S6x * 2019-07-15 yandld The first version for MCXN
*/ */
#ifndef __DRV_PIN_H__ #ifndef __DRV_PIN_H__

View File

@ -6,7 +6,7 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2017-08-08 Yang the first version * 2017-08-08 Yang the first version
* 2019-07-19 Magicoe The first version for LPC55S6x * 2019-07-19 yandld The first version for MCXN
* 2023-02-0 Alex Yang update driver * 2023-02-0 Alex Yang update driver
*/ */

View File

@ -5,7 +5,7 @@
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2019-07-15 Magicoe The first version for LPC55S6x * 2019-07-15 yandld The first version for MCXN
*/ */
#include "rtdevice.h" #include "rtdevice.h"

View File

@ -5,7 +5,7 @@
// * // *
// * Change Logs: // * Change Logs:
// * Date Author Notes // * Date Author Notes
// * 2019-07-15 Magicoe The first version for LPC55S6x // * 2019-07-15 yandld The first version for MCXN
// */ // */
#include <rtthread.h> #include <rtthread.h>

View File

@ -5,7 +5,7 @@
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2019-07-15 Magicoe The first version for LPC55S6x * 2019-07-15 yandld The first version for MCXN
*/ */
#ifndef __DRV_UART_H__ #ifndef __DRV_UART_H__

View File

@ -15,10 +15,10 @@
#include <rtdevice.h> #include <rtdevice.h>
#include "drv_pin.h" #include "drv_pin.h"
#define LEDB_PIN ((3*32)+4) #define LEDB_PIN ((0*32)+10)
#define BUTTON_PIN ((0*32)+29) #define BUTTON_PIN ((0*32)+23)
#include "fsl_lpuart.h" static void sw_pin_cb(void *args);
int main(void) int main(void)
{ {
@ -33,9 +33,14 @@ int main(void)
#endif #endif
rt_pin_mode(LEDB_PIN, PIN_MODE_OUTPUT); /* Set GPIO as Output */ rt_pin_mode(LEDB_PIN, PIN_MODE_OUTPUT); /* Set GPIO as Output */
rt_pin_mode(BUTTON_PIN, PIN_MODE_INPUT_PULLUP); rt_pin_mode(BUTTON_PIN, PIN_MODE_INPUT_PULLUP);
rt_pin_attach_irq(BUTTON_PIN, PIN_IRQ_MODE_FALLING, sw_pin_cb, RT_NULL);
rt_pin_irq_enable(BUTTON_PIN, 1);
rt_kprintf("MCXN947 HelloWorld\r\n"); rt_kprintf("MCXN947 HelloWorld\r\n");
#ifdef RT_USING_SDIO #ifdef RT_USING_SDIO
rt_thread_mdelay(2000); rt_thread_mdelay(2000);
if (dfs_mount("sd", "/", "elm", 0, NULL) == 0) if (dfs_mount("sd", "/", "elm", 0, NULL) == 0)
@ -57,4 +62,9 @@ int main(void)
} }
} }
static void sw_pin_cb(void *args)
{
rt_kprintf("sw pressed\r\n");
}
// end file // end file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff