How to get GPIO Port Address (Lcd08-Lcd15) in i.mx233

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get GPIO Port Address (Lcd08-Lcd15) in i.mx233

Jump to solution
1,068 Views
PramodKumar
Contributor IV

Dear friends..

currently I have connected 8 LEDs on these GPIO pins and easily i can access them bit by bit using WRITE_PIN and READ_PIN using gpio-mmap.h file,

These LEDs are glowing according to given values,.

But I want to access all pin at once as a GPIO Port so that I can read all 8 bits in single cycle When I use GPIO_BASE macro from gpio-mmap.h , it given an error "Segmentation fault"..

I am unable to read them, any body can help regarding this topic....

Thanks and Regards,

PRAMOD

Labels (1)
0 Kudos
1 Solution
680 Views
JackyAtFreescal
Senior Contributor II

HW_PINCTRL_DOUTx registers can change all pins in one shot.

HW_PINCTRL_DOUT0 is defined in arch/arm/mach-mx23/regs-pinctrl.h:

#define HW_PINCTRL_DOUT0    (0x00000500)

#define HW_PINCTRL_DOUT0_SET    (0x00000504)

#define HW_PINCTRL_DOUT0_CLR    (0x00000508)

#define HW_PINCTRL_DOUT0_TOG    (0x0000050c)

I would suggest you to add a new method in arch/arm/mach-mx23/gpio.c which can access the whole HW_PINCTRL_DOUTx register.

You may look into mx23_gpio_set() 's implementation and add your new method.

Regards,

Jacky

View solution in original post

0 Kudos
2 Replies
680 Views
YixingKong
Senior Contributor IV

Please click Correct Answer if your question has been answered.

Thanks,

Yixing

0 Kudos
681 Views
JackyAtFreescal
Senior Contributor II

HW_PINCTRL_DOUTx registers can change all pins in one shot.

HW_PINCTRL_DOUT0 is defined in arch/arm/mach-mx23/regs-pinctrl.h:

#define HW_PINCTRL_DOUT0    (0x00000500)

#define HW_PINCTRL_DOUT0_SET    (0x00000504)

#define HW_PINCTRL_DOUT0_CLR    (0x00000508)

#define HW_PINCTRL_DOUT0_TOG    (0x0000050c)

I would suggest you to add a new method in arch/arm/mach-mx23/gpio.c which can access the whole HW_PINCTRL_DOUTx register.

You may look into mx23_gpio_set() 's implementation and add your new method.

Regards,

Jacky

0 Kudos