NXP 官方SDK移植

一、官方SDK移植
1、新建cc.h文件
sdk包里用到很多数据类型,所以我们要在cc.h里面定义一些常用的数据类型

linux下面新建4_ledc_sdk文件夹,并创建cc.h, start.S两个文件

cc.h

#ifndef __CC_H
#define __CC_H

#define __I volatile 
#define __O volatile 
#define __IO volatile 

typedef signed char  int8_t;
typedef signed short int16_t;
typedef signed int   int32_t;
typedef signed long long int64_t;
typedef signed char  uint8_t;
typedef signed short uint16_t;
typedef signed int   uint32_t;
typedef signed long long uint64_t;

typedef signed char  s8;
typedef signed short s16;
typedef signed int   s32;
typedef signed long long   s64;
typedef signed char  u8;
typedef signed short u16;
typedef signed int   u32;
typedef signed long long  u64;

#endif

start.S

.global _start  		/* 全局标号 */

/*
 * 描述:	_start函数,程序从此函数开始执行,此函数主要功能是设置C
 *		 运行环境。
 */
_start:

	/* 进入SVC模式 */
	mrs r0, cpsr
	bic r0, r0, #0x1f 	/* 将r0寄存器中的低5位清零,也就是cpsr的M0~M4 	*/
	orr r0

你可能感兴趣的:(ARM)