ioc.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /******************************************************************************
  2. * Filename: ioc.h
  3. * Revised: $Date: 2013-01-21 15:25:21 +0100 (Mon, 21 Jan 2013) $
  4. * Revision: $Revision: 9178 $
  5. *
  6. * Description: Prototypes for the I/O driver.
  7. *
  8. * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
  9. *
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions
  13. * are met:
  14. *
  15. * Redistributions of source code must retain the above copyright
  16. * notice, this list of conditions and the following disclaimer.
  17. *
  18. * Redistributions in binary form must reproduce the above copyright
  19. * notice, this list of conditions and the following disclaimer in the
  20. * documentation and/or other materials provided with the distribution.
  21. *
  22. * Neither the name of Texas Instruments Incorporated nor the names of
  23. * its contributors may be used to endorse or promote products derived
  24. * from this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  27. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  28. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  29. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  30. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  31. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  32. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  33. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  34. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  35. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  36. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. ******************************************************************************/
  39. #ifndef __IOC_H__
  40. #define __IOC_H__
  41. //*****************************************************************************
  42. //
  43. // If building with a C++ compiler, make all of the definitions in this header
  44. // have a C binding.
  45. //
  46. //*****************************************************************************
  47. #ifdef __cplusplus
  48. extern "C"
  49. {
  50. #endif
  51. #include "hw_types.h"
  52. //*****************************************************************************
  53. //
  54. // The following values define the bit field for the ui8Pins and ui8Pin arguments
  55. // to all of the APIs.
  56. //
  57. //*****************************************************************************
  58. #define IOC_PIN_0 0x00000001 // IO pin 0
  59. #define IOC_PIN_1 0x00000002 // IO pin 1
  60. #define IOC_PIN_2 0x00000004 // IO pin 2
  61. #define IOC_PIN_3 0x00000008 // IO pin 3
  62. #define IOC_PIN_4 0x00000010 // IO pin 4
  63. #define IOC_PIN_5 0x00000020 // IO pin 5
  64. #define IOC_PIN_6 0x00000040 // IO pin 6
  65. #define IOC_PIN_7 0x00000080 // IO pin 7
  66. //*****************************************************************************
  67. //
  68. // Defined values for the ui32OutputSignal parameter of the
  69. // IOCPinConfigPeriphOutput() function. These are the valid values for the
  70. // signal select registers.
  71. // (The registers are in the addr range: IOC_PA0 - IOC_PD7).
  72. //
  73. //*****************************************************************************
  74. #define IOC_MUX_OUT_SEL_UART0_TXD 0x00000000 // iuarttxd_uart0
  75. #define IOC_MUX_OUT_SEL_UART1_RTS 0x00000001 // iuartrts_uart1
  76. #define IOC_MUX_OUT_SEL_UART1_TXD 0x00000002 // iuarttxd_uart1
  77. #define IOC_MUX_OUT_SEL_SSI0_TXD 0x00000003 // issitxd_ssi0
  78. #define IOC_MUX_OUT_SEL_SSI0_CLKOUT 0x00000004 // issiclkout_ssi0
  79. #define IOC_MUX_OUT_SEL_SSI0_FSSOUT 0x00000005 // issifssout_ssi0
  80. #define IOC_MUX_OUT_SEL_SSI0_STXSER_EN 0x00000006 // istxser_en_ssi0
  81. #define IOC_MUX_OUT_SEL_SSI1_TXD 0x00000007 // issitxd_ssi1
  82. #define IOC_MUX_OUT_SEL_SSI1_CLKOUT 0x00000008 // issiclkout_ssi1
  83. #define IOC_MUX_OUT_SEL_SSI1_FSSOUT 0x00000009 // issifssout_ssi1
  84. #define IOC_MUX_OUT_SEL_SSI1_STXSER_EN 0x0000000A // istxser_en_ssi1
  85. #define IOC_MUX_OUT_SEL_I2C_CMSSDA 0x0000000B // ii2cmssda
  86. #define IOC_MUX_OUT_SEL_I2C_CMSSCL 0x0000000C // ii2cmsscl
  87. #define IOC_MUX_OUT_SEL_GPT0_ICP1 0x0000000D // gpt0icp1
  88. #define IOC_MUX_OUT_SEL_GPT0_ICP2 0x0000000E // gpt0icp2
  89. #define IOC_MUX_OUT_SEL_GPT1_ICP1 0x0000000F // gpt1icp1
  90. #define IOC_MUX_OUT_SEL_GPT1_ICP2 0x00000010 // gpt1icp2
  91. #define IOC_MUX_OUT_SEL_GPT2_ICP1 0x00000011 // gpt2icp1
  92. #define IOC_MUX_OUT_SEL_GPT2_ICP2 0x00000012 // gpt2icp2
  93. #define IOC_MUX_OUT_SEL_GPT3_ICP1 0x00000013 // gpt3icp1
  94. #define IOC_MUX_OUT_SEL_GPT3_ICP2 0x00000014 // gpt3icp2
  95. //*****************************************************************************
  96. //
  97. // Defined bits in the value for the pin drive type returned by the
  98. // IOCPadConfigGet() function and used in the ui32PinDrive parameter for the
  99. // IOCPadConfigSet() function.
  100. //
  101. //*****************************************************************************
  102. #define IOC_OVERRIDE_DIS 0x00000000 // PAD Config Override Disabled
  103. #define IOC_OVERRIDE_ANA 0x00000001 // PAD Config Override Analog Enable
  104. #define IOC_OVERRIDE_PDE 0x00000002 // PAD Config Override Pull Down Enable
  105. #define IOC_OVERRIDE_PUE 0x00000004 // PAD Config Override Pull Up Enable
  106. #define IOC_OVERRIDE_OE 0x00000008 // PAD Config Override Output Enable
  107. //*****************************************************************************
  108. //
  109. // Prototypes for the APIs.
  110. //
  111. //*****************************************************************************
  112. extern void IOCPinConfigPeriphOutput(uint32_t ui32Port,
  113. uint8_t ui8Pins,
  114. uint32_t ui32OutputSignal);
  115. extern void IOCPinConfigPeriphInput(uint32_t ui32Port,
  116. uint8_t ui8Pin,
  117. uint32_t ui32PinSelectReg);
  118. extern void IOCPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins,
  119. uint32_t ui32PinDrive);
  120. extern uint32_t IOCPadConfigGet(uint32_t ui32Port,
  121. uint8_t ui8Pin);
  122. //*****************************************************************************
  123. //
  124. // Mark the end of the C bindings section for C++ compilers.
  125. //
  126. //*****************************************************************************
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130. #endif // __IOC_H__