My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lpc17xx_pinsel.h 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /**********************************************************************
  2. * $Id$ lpc17xx_pinsel.h 2010-05-21
  3. *//**
  4. * @file lpc17xx_pinsel.h
  5. * @brief Contains all macro definitions and function prototypes
  6. * support for Pin connect block firmware library on LPC17xx
  7. * @version 2.0
  8. * @date 21. May. 2010
  9. * @author NXP MCU SW Application Team
  10. *
  11. * Copyright(C) 2010, NXP Semiconductor
  12. * All rights reserved.
  13. *
  14. ***********************************************************************
  15. * Software that is described herein is for illustrative purposes only
  16. * which provides customers with programming information regarding the
  17. * products. This software is supplied "AS IS" without any warranties.
  18. * NXP Semiconductors assumes no responsibility or liability for the
  19. * use of the software, conveys no license or title under any patent,
  20. * copyright, or mask work right to the product. NXP Semiconductors
  21. * reserves the right to make changes in the software without
  22. * notification. NXP Semiconductors also make no representation or
  23. * warranty that such application will be suitable for the specified
  24. * use without further testing or modification.
  25. * Permission to use, copy, modify, and distribute this software and its
  26. * documentation is hereby granted, under NXP Semiconductors'
  27. * relevant copyright in the software, without fee, provided that it
  28. * is used in conjunction with NXP Semiconductors microcontrollers. This
  29. * copyright, permission, and disclaimer notice must appear in all copies of
  30. * this code.
  31. **********************************************************************/
  32. /* Peripheral group ----------------------------------------------------------- */
  33. /** @defgroup PINSEL PINSEL (Pin Selection)
  34. * @ingroup LPC1700CMSIS_FwLib_Drivers
  35. * @{
  36. */
  37. #ifndef LPC17XX_PINSEL_H_
  38. #define LPC17XX_PINSEL_H_
  39. /* Includes ------------------------------------------------------------------- */
  40. #include "LPC17xx.h"
  41. #include "lpc_types.h"
  42. #ifdef __cplusplus
  43. extern "C"
  44. {
  45. #endif
  46. /* Public Macros -------------------------------------------------------------- */
  47. /** @defgroup PINSEL_Public_Macros PINSEL Public Macros
  48. * @{
  49. */
  50. /*********************************************************************//**
  51. *!< Macros define for PORT Selection
  52. ***********************************************************************/
  53. #define PINSEL_PORT_0 ((0)) /**< PORT 0*/
  54. #define PINSEL_PORT_1 ((1)) /**< PORT 1*/
  55. #define PINSEL_PORT_2 ((2)) /**< PORT 2*/
  56. #define PINSEL_PORT_3 ((3)) /**< PORT 3*/
  57. #define PINSEL_PORT_4 ((4)) /**< PORT 4*/
  58. /***********************************************************************
  59. * Macros define for Pin Function selection
  60. **********************************************************************/
  61. #define PINSEL_FUNC_0 ((0)) /**< default function*/
  62. #define PINSEL_FUNC_1 ((1)) /**< first alternate function*/
  63. #define PINSEL_FUNC_2 ((2)) /**< second alternate function*/
  64. #define PINSEL_FUNC_3 ((3)) /**< third or reserved alternate function*/
  65. /***********************************************************************
  66. * Macros define for Pin Number of Port
  67. **********************************************************************/
  68. #define PINSEL_PIN_0 ((0)) /**< Pin 0 */
  69. #define PINSEL_PIN_1 ((1)) /**< Pin 1 */
  70. #define PINSEL_PIN_2 ((2)) /**< Pin 2 */
  71. #define PINSEL_PIN_3 ((3)) /**< Pin 3 */
  72. #define PINSEL_PIN_4 ((4)) /**< Pin 4 */
  73. #define PINSEL_PIN_5 ((5)) /**< Pin 5 */
  74. #define PINSEL_PIN_6 ((6)) /**< Pin 6 */
  75. #define PINSEL_PIN_7 ((7)) /**< Pin 7 */
  76. #define PINSEL_PIN_8 ((8)) /**< Pin 8 */
  77. #define PINSEL_PIN_9 ((9)) /**< Pin 9 */
  78. #define PINSEL_PIN_10 ((10)) /**< Pin 10 */
  79. #define PINSEL_PIN_11 ((11)) /**< Pin 11 */
  80. #define PINSEL_PIN_12 ((12)) /**< Pin 12 */
  81. #define PINSEL_PIN_13 ((13)) /**< Pin 13 */
  82. #define PINSEL_PIN_14 ((14)) /**< Pin 14 */
  83. #define PINSEL_PIN_15 ((15)) /**< Pin 15 */
  84. #define PINSEL_PIN_16 ((16)) /**< Pin 16 */
  85. #define PINSEL_PIN_17 ((17)) /**< Pin 17 */
  86. #define PINSEL_PIN_18 ((18)) /**< Pin 18 */
  87. #define PINSEL_PIN_19 ((19)) /**< Pin 19 */
  88. #define PINSEL_PIN_20 ((20)) /**< Pin 20 */
  89. #define PINSEL_PIN_21 ((21)) /**< Pin 21 */
  90. #define PINSEL_PIN_22 ((22)) /**< Pin 22 */
  91. #define PINSEL_PIN_23 ((23)) /**< Pin 23 */
  92. #define PINSEL_PIN_24 ((24)) /**< Pin 24 */
  93. #define PINSEL_PIN_25 ((25)) /**< Pin 25 */
  94. #define PINSEL_PIN_26 ((26)) /**< Pin 26 */
  95. #define PINSEL_PIN_27 ((27)) /**< Pin 27 */
  96. #define PINSEL_PIN_28 ((28)) /**< Pin 28 */
  97. #define PINSEL_PIN_29 ((29)) /**< Pin 29 */
  98. #define PINSEL_PIN_30 ((30)) /**< Pin 30 */
  99. #define PINSEL_PIN_31 ((31)) /**< Pin 31 */
  100. /***********************************************************************
  101. * Macros define for Pin mode
  102. **********************************************************************/
  103. #define PINSEL_PINMODE_PULLUP ((0)) /**< Internal pull-up resistor*/
  104. #define PINSEL_PINMODE_TRISTATE ((2)) /**< Tri-state */
  105. #define PINSEL_PINMODE_PULLDOWN ((3)) /**< Internal pull-down resistor */
  106. /***********************************************************************
  107. * Macros define for Pin mode (normal/open drain)
  108. **********************************************************************/
  109. #define PINSEL_PINMODE_NORMAL ((0)) /**< Pin is in the normal (not open drain) mode.*/
  110. #define PINSEL_PINMODE_OPENDRAIN ((1)) /**< Pin is in the open drain mode */
  111. /***********************************************************************
  112. * Macros define for I2C mode
  113. ***********************************************************************/
  114. #define PINSEL_I2C_Normal_Mode ((0)) /**< The standard drive mode */
  115. #define PINSEL_I2C_Fast_Mode ((1)) /**< Fast Mode Plus drive mode */
  116. /**
  117. * @}
  118. */
  119. /* Private Macros ------------------------------------------------------------- */
  120. /** @defgroup PINSEL_Private_Macros PINSEL Private Macros
  121. * @{
  122. */
  123. /* Pin selection define */
  124. /* I2C Pin Configuration register bit description */
  125. #define PINSEL_I2CPADCFG_SDADRV0 _BIT(0) /**< Drive mode control for the SDA0 pin, P0.27 */
  126. #define PINSEL_I2CPADCFG_SDAI2C0 _BIT(1) /**< I2C mode control for the SDA0 pin, P0.27 */
  127. #define PINSEL_I2CPADCFG_SCLDRV0 _BIT(2) /**< Drive mode control for the SCL0 pin, P0.28 */
  128. #define PINSEL_I2CPADCFG_SCLI2C0 _BIT(3) /**< I2C mode control for the SCL0 pin, P0.28 */
  129. /**
  130. * @}
  131. */
  132. /* Public Types --------------------------------------------------------------- */
  133. /** @defgroup PINSEL_Public_Types PINSEL Public Types
  134. * @{
  135. */
  136. /** @brief Pin configuration structure */
  137. typedef struct
  138. {
  139. uint8_t Portnum; /**< Port Number, should be PINSEL_PORT_x,
  140. where x should be in range from 0 to 4 */
  141. uint8_t Pinnum; /**< Pin Number, should be PINSEL_PIN_x,
  142. where x should be in range from 0 to 31 */
  143. uint8_t Funcnum; /**< Function Number, should be PINSEL_FUNC_x,
  144. where x should be in range from 0 to 3 */
  145. uint8_t Pinmode; /**< Pin Mode, should be:
  146. - PINSEL_PINMODE_PULLUP: Internal pull-up resistor
  147. - PINSEL_PINMODE_TRISTATE: Tri-state
  148. - PINSEL_PINMODE_PULLDOWN: Internal pull-down resistor */
  149. uint8_t OpenDrain; /**< OpenDrain mode, should be:
  150. - PINSEL_PINMODE_NORMAL: Pin is in the normal (not open drain) mode
  151. - PINSEL_PINMODE_OPENDRAIN: Pin is in the open drain mode */
  152. } PINSEL_CFG_Type;
  153. /**
  154. * @}
  155. */
  156. /* Public Functions ----------------------------------------------------------- */
  157. /** @defgroup PINSEL_Public_Functions PINSEL Public Functions
  158. * @{
  159. */
  160. void PINSEL_ConfigPin(PINSEL_CFG_Type *PinCfg);
  161. void PINSEL_ConfigTraceFunc (FunctionalState NewState);
  162. void PINSEL_SetI2C0Pins(uint8_t i2cPinMode, FunctionalState filterSlewRateEnable);
  163. /**
  164. * @}
  165. */
  166. #ifdef __cplusplus
  167. }
  168. #endif
  169. #endif /* LPC17XX_PINSEL_H_ */
  170. /**
  171. * @}
  172. */
  173. /* --------------------------------- End Of File ------------------------------ */