[bsp][nxp] fix gpio and sw pin issue
This commit is contained in:
parent
2748a6ada4
commit
66cc1f5da1
|
@ -7,7 +7,7 @@
|
|||
* Date Author Notes
|
||||
* 2018-03-13 Liuguang the first version.
|
||||
* 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__
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2019-07-15 Magicoe The first version for LPC55S6x
|
||||
* 2019-07-15 yandld The first version for MCXN
|
||||
*/
|
||||
#include "rtdevice.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// *
|
||||
// * Change Logs:
|
||||
// * Date Author Notes
|
||||
// * 2019-07-15 Magicoe The first version for LPC55S6x
|
||||
// * 2019-07-15 yandld The first version for MCXN
|
||||
// */
|
||||
|
||||
#include <rtthread.h>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* Change Logs:
|
||||
* 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__
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
#include <rtdevice.h>
|
||||
#include "drv_pin.h"
|
||||
|
||||
#define LEDB_PIN ((3*32)+4)
|
||||
#define BUTTON_PIN ((0*32)+29)
|
||||
#define LEDB_PIN ((0*32)+10)
|
||||
#define BUTTON_PIN ((0*32)+23)
|
||||
|
||||
#include "fsl_lpuart.h"
|
||||
static void sw_pin_cb(void *args);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
@ -33,9 +33,14 @@ int main(void)
|
|||
#endif
|
||||
|
||||
rt_pin_mode(LEDB_PIN, PIN_MODE_OUTPUT); /* Set GPIO as Output */
|
||||
|
||||
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");
|
||||
|
||||
|
||||
#ifdef RT_USING_SDIO
|
||||
rt_thread_mdelay(2000);
|
||||
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
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue