gpio-lpc32xx.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Author: Kevin Wells <kevin.wells@nxp.com>
  3. *
  4. * Copyright (C) 2010 NXP Semiconductors
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #ifndef __MACH_GPIO_LPC32XX_H
  17. #define __MACH_GPIO_LPC32XX_H
  18. /*
  19. * Note!
  20. * Muxed GP pins need to be setup to the GP state in the board level
  21. * code prior to using this driver.
  22. * GPI pins : 28xP3 group
  23. * GPO pins : 24xP3 group
  24. * GPIO pins: 8xP0 group, 24xP1 group, 13xP2 group, 6xP3 group
  25. */
  26. #define LPC32XX_GPIO_P0_MAX 8
  27. #define LPC32XX_GPIO_P1_MAX 24
  28. #define LPC32XX_GPIO_P2_MAX 13
  29. #define LPC32XX_GPIO_P3_MAX 6
  30. #define LPC32XX_GPI_P3_MAX 29
  31. #define LPC32XX_GPO_P3_MAX 24
  32. #define LPC32XX_GPIO_P0_GRP 0
  33. #define LPC32XX_GPIO_P1_GRP (LPC32XX_GPIO_P0_GRP + LPC32XX_GPIO_P0_MAX)
  34. #define LPC32XX_GPIO_P2_GRP (LPC32XX_GPIO_P1_GRP + LPC32XX_GPIO_P1_MAX)
  35. #define LPC32XX_GPIO_P3_GRP (LPC32XX_GPIO_P2_GRP + LPC32XX_GPIO_P2_MAX)
  36. #define LPC32XX_GPI_P3_GRP (LPC32XX_GPIO_P3_GRP + LPC32XX_GPIO_P3_MAX)
  37. #define LPC32XX_GPO_P3_GRP (LPC32XX_GPI_P3_GRP + LPC32XX_GPI_P3_MAX)
  38. /*
  39. * A specific GPIO can be selected with this macro
  40. * ie, GPIO_05 can be selected with LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5)
  41. * See the LPC32x0 User's guide for GPIO group numbers
  42. */
  43. #define LPC32XX_GPIO(x, y) ((x) + (y))
  44. #endif /* __MACH_GPIO_LPC32XX_H */