Some qouestions about fsl_guts.h

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Some qouestions about fsl_guts.h

345 次查看
jackrubby
Contributor II

Hi anybody,

I read fsl_guts.h in powerpc architecture and saw Global Utility Registers like gpiocr as GPIO Control Register, gpindr as General-Purpose Input Data Register and gpoutdr as General-Purpose Output Data Register. But in GPIO registers in p1022 reference manual we have GPDIR register to set specify GPIO direction and GPDAT register for GPIO data register. We have only one register for data but fsl_guts.h defines two register for input an output data.

Does gpiocr work as GPDIR?

For GPDAT, which of the two registers I should use? gpindr or gpoutdr?

Thanks,

Regards.

标签 (1)
0 项奖励
1 回复

281 次查看
scottwood
NXP Employee
NXP Employee

Note the comment at the top of the struct that says, "Not all registers defined in this structure are available on all chips, so

you are expected to know whether a given register actually exists on your chip before you access it."  gpindr and gpoutdr are for the GPIO on MPC8641D and possibly other chips.

The GPIO block on P1022 is not located in fsl_guts, but rather a separate CCSR register block (offset 0xf000).  It is driven by drivers/gpio/gpio-mpc8xxx.c, where you'll find GPIO_DIR, GPIO_DAT, etc.

0 项奖励