32 #ifndef __IOCON_17XX_40XX_H_
33 #define __IOCON_17XX_40XX_H_
48 #if defined(CHIP_LPC175X_6X)
64 #define IOCON_FUNC0 0x0
65 #define IOCON_FUNC1 0x1
66 #define IOCON_FUNC2 0x2
67 #define IOCON_FUNC3 0x3
68 #if defined(CHIP_LPC175X_6X)
69 #define IOCON_MODE_INACT (0x2 << 0)
70 #define IOCON_MODE_PULLDOWN (0x3 << 0)
71 #define IOCON_MODE_PULLUP (0x0 << 0)
72 #define IOCON_MODE_REPEATER (0x1 << 0)
74 #define IOCON_FUNC4 0x4
75 #define IOCON_FUNC5 0x5
76 #define IOCON_FUNC6 0x6
77 #define IOCON_FUNC7 0x7
78 #define IOCON_MODE_INACT (0x0 << 3)
79 #define IOCON_MODE_PULLDOWN (0x1 << 3)
80 #define IOCON_MODE_PULLUP (0x2 << 3)
81 #define IOCON_MODE_REPEATER (0x3 << 3)
82 #define IOCON_HYS_EN (0x1 << 5)
83 #define IOCON_INV_EN (0x1 << 6)
84 #define IOCON_ADMODE_EN (0x0 << 7)
85 #define IOCON_DIGMODE_EN (0x1 << 7)
86 #define IOCON_FILT_DIS (0x1 << 8)
87 #define IOCON_HS_DIS (0x1 << 8)
88 #define IOCON_HIDRIVE_EN (0x1 << 9)
89 #define IOCON_FASTSLEW_EN (0x1 << 9)
90 #define IOCON_OPENDRAIN_EN (0x1 << 10)
91 #define IOCON_DAC_EN (0x1 << 16)
102 #if defined(CHIP_LPC175X_6X)
109 #define MD_PLN (0x0 << 3)
110 #define MD_PDN (0x1 << 3)
111 #define MD_PUP (0x2 << 3)
112 #define MD_RPT (0x3 << 3)
113 #define MD_HYS_ENA (0x1 << 5)
114 #define MD_HYS_DIS (0x0 << 5)
115 #define MD_IINV_ENA (0x1 << 6)
116 #define MD_IINV_DIS (0x0 << 6)
117 #define MD_OD_ENA (0x1 << 10)
118 #define MD_OD_DIS (0x0 << 10)
119 #define MD_HS_ENA (0x0 << 8)
120 #define MD_HS_DIS (0x1 << 8)
121 #define MD_ANA_ENA (0x0 << 7)
122 #define MD_ANA_DIS (0x1 << 7)
123 #define MD_FILT_ENA (0x0 << 8)
124 #define MD_FILT_DIS (0x1 << 8)
125 #define MD_DAC_ENA (0x1 << 16)
126 #define MD_DAC_DIS (0x0 << 16)
127 #define MD_STD_SLEW_RATE (0x0 << 9)
128 #define MD_FAST_SLEW_RATE (0x1 << 9)
129 #define MD_HD_ENA (0x1 << 9)
130 #define MD_HD_DIS (0x0 << 9)
145 #if defined(CHIP_LPC175X_6X)
147 #define IOCON_REG_INDEX(port, pin) (2 * port + (pin / 16))
149 #define IOCON_BIT_INDEX(pin) ((pin % 16) * 2)
171 pIOCON->PINMODE_OD[port] |= (0x01UL << pin);
183 pIOCON->PINMODE_OD[port] &= ~(0x01UL << pin);
190 I2CPADCFG_STD_MODE = 0x00,
191 I2CPADCFG_FAST_MODE = I2CPADCFG_STD_MODE,
192 I2CPADCFG_FAST_MODE_PLUS = 0x05,
193 I2CPADCFG_NON_I2C = 0x0A,
194 } IOCON_I2CPINS_CONFIG;
204 pIOCON->I2CPADCFG = cfg;
218 pIOCON->
p[port][pin] = modefunc;