你好,我感兴趣的是“自定义模块”在“PIN模块”中的意思。根据我在http://MyCHIPPravestDeave:West:GPIOORD中发现的描述,这就像是PIN的另一个给定名称,这将是在编写配置中未覆盖的任何附加代码时使用的名称。这个页面还说,如果EQ为PIN设置了自定义名称,下面的宏应该在Pin管理器中。在生成代码后,我检查了PixMault.h。我可以看到这些宏//GET/SET RC4过程,定义了RC4xSETHEE():{LATCITS.LATC4=1;}(0)定义了RC4SETWORLVER()DO LATCITS.LATC4=0;}(0)定义了RC4x ToGeLe[()的定义:{LaCTBIT.LATC4= ~LATCITS.LATC4;}(0)α定义。cRb4xStudioDigalIdPUTPUTE()DO TrigCalbId.TrISC4=1;}(0)*定义RC4xStudioDigalOutPututer()DO TrccBist.TrISC4=0;}(0)*定义RC4SeToPulCuffle()DO {WPUCITBES.WPUC4=1;}(0)*定义RC4SeReTePULPULL()DO {WPUCPITS.WPUC4= 0;}(0)RC4GETValuy()端口请让我知道,我是否误解了自定义名称的含义,或者只是做错了什么?MPALBX IDE:4.15xC8:1.45谢谢您的帮助,/ Robi
以上来自于百度翻译
以下为原文
hello,
I was interested what the "custom name" means in the "Pin Module". According to the descrip
tion I found in
http://microchipdeveloper...ress:gpiointroduction, this is like a additional given name for the pin, and this will be the name used while writing any additional code not covered in configuration. Also this page says if eq I set the Custom Name for a PIN, the following macros should be in the pin_manager.h:
_SetHigh()
_SetLow()
...
In my project I configured RA4 as digital output, and give the "PWR_STATUS" Custom Name. I checked the pin_manager.h after generated the code, and I can see these macros
// get/set RC4 procedures
#define RC4_SetHigh() do { LATCbits.LATC4 = 1; } while(0)
#define RC4_SetLow() do { LATCbits.LATC4 = 0; } while(0)
#define RC4_Toggle() do { LATCbits.LATC4 = ~LATCbits.LATC4; } while(0)
#define RC4_GetValue() PORTCbits.RC4
#define RC4_SetDigitalInput() do { TRISCbits.TRISC4 = 1; } while(0)
#define RC4_SetDigitalOutput() do { TRISCbits.TRISC4 = 0; } while(0)
#define RC4_SetPullup() do { WPUCbits.WPUC4 = 1; } while(0)
#define RC4_ResetPullup() do { WPUCbits.WPUC4 = 0; } while(0)
Could you please let me know, did I misunderstand the meaning of Custom Name, or just did something wrong?
MPALBX IDE: 4.15
XC8: 1.45
Thanks for your help,
/Robi