强仔00001 发表于 2014-7-3 15:22:38

PIC32头文件疑惑

本帖最后由 强仔00001 于 2014-7-3 15:25 编辑

本人是刚接触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为输出)这样的一位操作??
我自己试了好久也不成功,希望有大牛解救
页: [1]
查看完整版本: PIC32头文件疑惑