



将以下代码应用到例程中,参考该手册例程,KEA8只提供了一个简单的MCU寄存器头文件(类似8051单片机的开发),其他如KEA16 or more higher的例程会提供一些标准外设库,KEA8的开发也可以参考这些库。
https://www.nxp.com.cn/docs/en/application-note/AN5213.pdf
/*
* main implementation: use this 'C' sample to create your own application
*
*/
#include "derivative.h" /* include peripheral declarations SSKEAZN8M4 */
#define LED 1 /* Port PTE7, bit 7: output to blue LED */
int main(void)
{
GPIOA_PDDR |= 1<<LED;
GPIOA_PIDR &= 1<<LED;
for(;;) {
GPIOA_PSOR |= 1<<LED;
//GPIOA_PCOR |= 1<<LED;
}
/* to avoid the warning message for GHS: statement is unreachable*/
#if defined (__ghs__)
#pragma ghs nowarning 111
#endif
#if defined (__ICCARM__)
#pragma diag_suppress=Pe111
#endif
return 0;
}









网友评论