pin_mux.h 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * The Clear BSD License
  3. * Copyright (c) 2016, Freescale Semiconductor, Inc.
  4. * Copyright 2016-2017 NXP
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without modification,
  8. * are permitted (subject to the limitations in the disclaimer below) provided
  9. * that the following conditions are met:
  10. *
  11. * o Redistributions of source code must retain the above copyright notice, this list
  12. * of conditions and the following disclaimer.
  13. *
  14. * o Redistributions in binary form must reproduce the above copyright notice, this
  15. * list of conditions and the following disclaimer in the documentation and/or
  16. * other materials provided with the distribution.
  17. *
  18. * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  24. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  25. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  27. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  28. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  29. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  30. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef _PIN_MUX_H_
  35. #define _PIN_MUX_H_
  36. /***********************************************************************************************************************
  37. * Definitions
  38. **********************************************************************************************************************/
  39. /*! @brief Direction type */
  40. typedef enum _pin_mux_direction
  41. {
  42. kPIN_MUX_DirectionInput = 0U, /* Input direction */
  43. kPIN_MUX_DirectionOutput = 1U, /* Output direction */
  44. kPIN_MUX_DirectionInputOrOutput = 2U /* Input or output direction */
  45. } pin_mux_direction_t;
  46. /*!
  47. * @addtogroup pin_mux
  48. * @{
  49. */
  50. /***********************************************************************************************************************
  51. * API
  52. **********************************************************************************************************************/
  53. #if defined(__cplusplus)
  54. extern "C" {
  55. #endif
  56. /*!
  57. * @brief Calls initialization functions.
  58. *
  59. */
  60. void BOARD_InitBootPins(void);
  61. #define IOCON_PIO_DIGITAL_EN 0x80u /*!<@brief Enables digital function */
  62. #define IOCON_PIO_FUNC1 0x01u /*!<@brief Selects pin function 1 */
  63. #define IOCON_PIO_INPFILT_OFF 0x0100u /*!<@brief Input filter disabled */
  64. #define IOCON_PIO_INV_DI 0x00u /*!<@brief Input function is not inverted */
  65. #define IOCON_PIO_MODE_INACT 0x00u /*!<@brief No addition pin function */
  66. #define IOCON_PIO_OPENDRAIN_DI 0x00u /*!<@brief Open drain is disabled */
  67. #define IOCON_PIO_SLEW_STANDARD 0x00u /*!<@brief Standard mode, output slew rate control is enabled */
  68. /*!
  69. * @brief Configures pin routing and optionally pin electrical features.
  70. *
  71. */
  72. void BOARD_InitPins(void); /* Function assigned for the Cortex-M0P */
  73. #if defined(__cplusplus)
  74. }
  75. #endif
  76. /*!
  77. * @}
  78. */
  79. #endif /* _PIN_MUX_H_ */
  80. /***********************************************************************************************************************
  81. * EOF
  82. **********************************************************************************************************************/