中科因仑“3+1”工程特种兵精英论坛
标题:
PIC32头文件疑惑
[打印本页]
作者:
liliuyang
时间:
2014-7-31 15:11
标题:
PIC32头文件疑惑
本人是刚接触PIC的,现在的编译环境是MPLAB X IDE 和MPLAB XC32
typedef union {
struct {
unsigned LATH0:1;
unsigned LATH1:1;
unsigned LATH2:1;
unsigned LATH3:1;
unsigned LATH4:1;
unsigned LATH5:1;
unsigned LATH6:1;
unsigned LATH7:1;
unsigned LATH8:1;
unsigned LATH9:1;
unsigned LATH10:1;
unsigned LATH11:1;
unsigned LATH12:1;
unsigned LATH13:1;
unsigned LATH14:1;
unsigned LATH15:1;
};
struct {
unsigned w:32;
};
} __LATHbits_t;
extern volatile __LATHbits_t LATHbits __asm__ ("LATH") __attribute__((section("sfrs")));
extern volatile unsigned int LATHCLR __attribute__((section("sfrs")));
extern volatile unsigned int LATHSET __attribute__((section("sfrs")));
extern volatile unsigned int LATHINV __attribute__((section("sfrs")));
extern volatile unsigned int ODCH __attribute__((section("sfrs")));
这个头文件有啥用???
#define _LATH_LATH0_POSITION 0x00000000
#define _LATH_LATH0_MASK 0x00000001
#define _LATH_LATH0_LENGTH 0x00000001
这个是用来实现一位操作的吗??
还有PIC32怎样实现像(TRI SAbits.TRI SA5=0;//设置RA5为输出)这样的一位操作??
我自己试了好久也不成功,希望有大牛解救
作者:
还你一世界
时间:
2014-8-4 09:38
define的估计是一个初始化~酱油路过
作者:
张衍波
时间:
2014-8-7 15:31
不懂啊,,
欢迎光临 中科因仑“3+1”工程特种兵精英论坛 (http://bbs.enlern.com/)
Powered by Discuz! X3.4