F2837xD_Gpio_defines.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_Gpio_defines.h
  4. //
  5. // TITLE: F2837xD GPIO support definitions
  6. //
  7. //###########################################################################
  8. // $TI Release: F2837xD Support Library v3.05.00.00 $
  9. // $Release Date: Tue Jun 26 03:15:23 CDT 2018 $
  10. // $Copyright:
  11. // Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/
  12. //
  13. // Redistribution and use in source and binary forms, with or without
  14. // modification, are permitted provided that the following conditions
  15. // are met:
  16. //
  17. // Redistributions of source code must retain the above copyright
  18. // notice, this list of conditions and the following disclaimer.
  19. //
  20. // Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the
  23. // distribution.
  24. //
  25. // Neither the name of Texas Instruments Incorporated nor the names of
  26. // its contributors may be used to endorse or promote products derived
  27. // from this software without specific prior written permission.
  28. //
  29. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  30. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  31. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  32. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  33. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  34. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  35. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  36. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  37. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. // $
  41. //###########################################################################
  42. #ifndef F2837xD_GPIO_DEFINES_H
  43. #define F2837xD_GPIO_DEFINES_H
  44. //
  45. // Defines
  46. //
  47. //
  48. //CPU pin masters for GPIO_SelectPinMux()
  49. //
  50. #define GPIO_MUX_CPU1 0x0
  51. #define GPIO_MUX_CPU1CLA 0x1
  52. #define GPIO_MUX_CPU2 0x2
  53. #define GPIO_MUX_CPU2CLA 0x3
  54. //
  55. //Flags for GPIO_SetupPinOptions(). The qualification flags (SYNC, QUAL3,
  56. //QUAL6, and ASYNC) take up two bits and must be in the order specified.
  57. //
  58. #define GPIO_INPUT 0
  59. #define GPIO_OUTPUT 1
  60. #define GPIO_PUSHPULL 0
  61. #define GPIO_PULLUP (1 << 0)
  62. #define GPIO_INVERT (1 << 1)
  63. #define GPIO_OPENDRAIN (1 << 2)
  64. #define GPIO_SYNC (0x0 << 4)
  65. #define GPIO_QUAL3 (0x1 << 4)
  66. #define GPIO_QUAL6 (0x2 << 4)
  67. #define GPIO_ASYNC (0x3 << 4)
  68. //
  69. //Flags for GPIO_SetupLock().
  70. //
  71. #define GPIO_UNLOCK 0
  72. #define GPIO_LOCK 1
  73. //
  74. //Commands for the CPU2->CPU1 GPIO configuration interrupt handler
  75. //
  76. #define GPIO_CMD_INIT 1L
  77. #define GPIO_CMD_PINMUX 2L
  78. #define GPIO_CMD_PINOPTS 3L
  79. #define GPIO_CMD_WRITE32 4L
  80. #define GPIO_CMD_WRITE16 5L
  81. #define GPIO_CMD_READ32 6L
  82. #define GPIO_CMD_READ16 7L
  83. //
  84. //Helpful constants for array-based access to GPIO registers
  85. //
  86. #define GPY_CTRL_OFFSET (0x40/2)
  87. #define GPY_DATA_OFFSET (0x8/2)
  88. #define GPYQSEL (0x2/2)
  89. #define GPYMUX (0x6/2)
  90. #define GPYDIR (0xA/2)
  91. #define GPYPUD (0xC/2)
  92. #define GPYINV (0x10/2)
  93. #define GPYODR (0x12/2)
  94. #define GPYGMUX (0x20/2)
  95. #define GPYCSEL (0x28/2)
  96. #define GPYLOCK (0x3C/2)
  97. #define GPYCR (0x3E/2)
  98. #define GPYDAT (0x0/2)
  99. #define GPYSET (0x2/2)
  100. #define GPYCLEAR (0x4/2)
  101. #define GPYTOGGLE (0x6/2)
  102. #endif // end of F2837xD_GPIO_DEFINES_H definition
  103. //
  104. // End of file
  105. //