LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CHIP: LPC17xx/40xx I/O configuration driver

Detailed Description

Data Structures

struct  LPC_IOCON_T
 IOCON register block. More...
 

Macros

#define IOCON_FUNC0   0x0
 
#define IOCON_FUNC1   0x1
 
#define IOCON_FUNC2   0x2
 
#define IOCON_FUNC3   0x3
 
#define IOCON_FUNC4   0x4
 
#define IOCON_FUNC5   0x5
 
#define IOCON_FUNC6   0x6
 
#define IOCON_FUNC7   0x7
 
#define IOCON_MODE_INACT   (0x0 << 3)
 
#define IOCON_MODE_PULLDOWN   (0x1 << 3)
 
#define IOCON_MODE_PULLUP   (0x2 << 3)
 
#define IOCON_MODE_REPEATER   (0x3 << 3)
 
#define IOCON_HYS_EN   (0x1 << 5)
 
#define IOCON_INV_EN   (0x1 << 6)
 
#define IOCON_ADMODE_EN   (0x0 << 7)
 
#define IOCON_DIGMODE_EN   (0x1 << 7)
 
#define IOCON_FILT_DIS   (0x1 << 8)
 
#define IOCON_HS_DIS   (0x1 << 8)
 
#define IOCON_HIDRIVE_EN   (0x1 << 9)
 
#define IOCON_FASTSLEW_EN   (0x1 << 9)
 
#define IOCON_OPENDRAIN_EN   (0x1 << 10)
 
#define IOCON_DAC_EN   (0x1 << 16)
 
#define FUNC0   0x0 /** Function 0 */
 
#define FUNC1   0x1 /** Function 1 */
 
#define FUNC2   0x2 /** Function 2 */
 
#define FUNC3   0x3 /** Function 3 */
 
#define MD_PLN   (0x0 << 3)
 
#define MD_PDN   (0x1 << 3)
 
#define MD_PUP   (0x2 << 3)
 
#define MD_RPT   (0x3 << 3)
 
#define MD_HYS_ENA   (0x1 << 5)
 
#define MD_HYS_DIS   (0x0 << 5)
 
#define MD_IINV_ENA   (0x1 << 6)
 
#define MD_IINV_DIS   (0x0 << 6)
 
#define MD_OD_ENA   (0x1 << 10)
 
#define MD_OD_DIS   (0x0 << 10)
 
#define MD_HS_ENA   (0x0 << 8)
 
#define MD_HS_DIS   (0x1 << 8)
 
#define MD_ANA_ENA   (0x0 << 7)
 
#define MD_ANA_DIS   (0x1 << 7)
 
#define MD_FILT_ENA   (0x0 << 8)
 
#define MD_FILT_DIS   (0x1 << 8)
 
#define MD_DAC_ENA   (0x1 << 16)
 
#define MD_DAC_DIS   (0x0 << 16)
 
#define MD_STD_SLEW_RATE   (0x0 << 9)
 
#define MD_FAST_SLEW_RATE   (0x1 << 9)
 
#define MD_HD_ENA   (0x1 << 9)
 
#define MD_HD_DIS   (0x0 << 9)
 
#define FUNC4   0x4 /** Function 4 */
 
#define FUNC5   0x5 /** Function 5 */
 
#define FUNC6   0x6 /** Function 6 */
 
#define FUNC7   0x7 /** Function 7 */
 

Functions

STATIC INLINE void Chip_IOCON_Init (LPC_IOCON_T *pIOCON)
 Initialize the IOCON peripheral.
 
STATIC INLINE void Chip_IOCON_PinMuxSet (LPC_IOCON_T *pIOCON, uint8_t port, uint8_t pin, uint32_t modefunc)
 Sets I/O Control pin mux.
 
STATIC INLINE void Chip_IOCON_PinMux (LPC_IOCON_T *pIOCON, uint8_t port, uint8_t pin, uint32_t mode, uint8_t func)
 Setup pin modes and function.
 

Macro Definition Documentation

#define FUNC0   0x0 /** Function 0 */

IOCON function and mode selection definitions (old) For backwards compatibility.

Definition at line 98 of file iocon_17xx_40xx.h.

#define FUNC1   0x1 /** Function 1 */

Definition at line 99 of file iocon_17xx_40xx.h.

#define FUNC2   0x2 /** Function 2 */

Definition at line 100 of file iocon_17xx_40xx.h.

#define FUNC3   0x3 /** Function 3 */

Definition at line 101 of file iocon_17xx_40xx.h.

#define FUNC4   0x4 /** Function 4 */

Definition at line 131 of file iocon_17xx_40xx.h.

#define FUNC5   0x5 /** Function 5 */

Definition at line 132 of file iocon_17xx_40xx.h.

#define FUNC6   0x6 /** Function 6 */

Definition at line 133 of file iocon_17xx_40xx.h.

#define FUNC7   0x7 /** Function 7 */

Definition at line 134 of file iocon_17xx_40xx.h.

#define IOCON_ADMODE_EN   (0x0 << 7)

Enables analog input function (analog pins only)

Definition at line 84 of file iocon_17xx_40xx.h.

#define IOCON_DAC_EN   (0x1 << 16)

Enables DAC function

Definition at line 91 of file iocon_17xx_40xx.h.

#define IOCON_DIGMODE_EN   (0x1 << 7)

Enables digital function (analog pins only)

Definition at line 85 of file iocon_17xx_40xx.h.

#define IOCON_FASTSLEW_EN   (0x1 << 9)

Enables fast slew

Definition at line 89 of file iocon_17xx_40xx.h.

#define IOCON_FILT_DIS   (0x1 << 8)

Disables noise pulses filtering (10nS glitch filter)

Definition at line 86 of file iocon_17xx_40xx.h.

#define IOCON_FUNC0   0x0

IOCON function and mode selection definitions See the User Manual for specific modes and functions supoprted by the various LPC11xx devices. Functionality can vary per device.Selects pin function 0

Definition at line 64 of file iocon_17xx_40xx.h.

#define IOCON_FUNC1   0x1

Selects pin function 1

Definition at line 65 of file iocon_17xx_40xx.h.

#define IOCON_FUNC2   0x2

Selects pin function 2

Definition at line 66 of file iocon_17xx_40xx.h.

#define IOCON_FUNC3   0x3

Selects pin function 3

Definition at line 67 of file iocon_17xx_40xx.h.

#define IOCON_FUNC4   0x4

Selects pin function 4

Definition at line 74 of file iocon_17xx_40xx.h.

#define IOCON_FUNC5   0x5

Selects pin function 5

Definition at line 75 of file iocon_17xx_40xx.h.

#define IOCON_FUNC6   0x6

Selects pin function 6

Definition at line 76 of file iocon_17xx_40xx.h.

#define IOCON_FUNC7   0x7

Selects pin function 7

Definition at line 77 of file iocon_17xx_40xx.h.

#define IOCON_HIDRIVE_EN   (0x1 << 9)

Sink current is 20 mA

Definition at line 88 of file iocon_17xx_40xx.h.

#define IOCON_HS_DIS   (0x1 << 8)

I2C glitch filter and slew rate disabled

Definition at line 87 of file iocon_17xx_40xx.h.

#define IOCON_HYS_EN   (0x1 << 5)

Enables hysteresis

Definition at line 82 of file iocon_17xx_40xx.h.

#define IOCON_INV_EN   (0x1 << 6)

Enables invert function on input

Definition at line 83 of file iocon_17xx_40xx.h.

#define IOCON_MODE_INACT   (0x0 << 3)

No addition pin function

Definition at line 78 of file iocon_17xx_40xx.h.

#define IOCON_MODE_PULLDOWN   (0x1 << 3)

Selects pull-down function

Definition at line 79 of file iocon_17xx_40xx.h.

#define IOCON_MODE_PULLUP   (0x2 << 3)

Selects pull-up function

Definition at line 80 of file iocon_17xx_40xx.h.

#define IOCON_MODE_REPEATER   (0x3 << 3)

Selects pin repeater function

Definition at line 81 of file iocon_17xx_40xx.h.

#define IOCON_OPENDRAIN_EN   (0x1 << 10)

Enables open-drain function

Definition at line 90 of file iocon_17xx_40xx.h.

#define MD_ANA_DIS   (0x1 << 7)

Macro to disable analog mode (ADC)- use with Chip_IOCON_PinMux

Definition at line 122 of file iocon_17xx_40xx.h.

#define MD_ANA_ENA   (0x0 << 7)

Macro to enable analog mode (ADC)- use with Chip_IOCON_PinMux

Definition at line 121 of file iocon_17xx_40xx.h.

#define MD_DAC_DIS   (0x0 << 16)

Macro to disable DAC- use with Chip_IOCON_PinMux

Definition at line 126 of file iocon_17xx_40xx.h.

#define MD_DAC_ENA   (0x1 << 16)

Macro to enable DAC- use with Chip_IOCON_PinMux

Definition at line 125 of file iocon_17xx_40xx.h.

#define MD_FAST_SLEW_RATE   (0x1 << 9)

Macro to enable fast mode, slew rate control is disabled - use with Chip_IOCON_PinMux

Definition at line 128 of file iocon_17xx_40xx.h.

#define MD_FILT_DIS   (0x1 << 8)

Macro to disable input filter- use with Chip_IOCON_PinMux

Definition at line 124 of file iocon_17xx_40xx.h.

#define MD_FILT_ENA   (0x0 << 8)

Macro to enable input filter- use with Chip_IOCON_PinMux

Definition at line 123 of file iocon_17xx_40xx.h.

#define MD_HD_DIS   (0x0 << 9)

Macro to disable high drive output- use with Chip_IOCON_PinMux

Definition at line 130 of file iocon_17xx_40xx.h.

#define MD_HD_ENA   (0x1 << 9)

Macro to enable high drive output- use with Chip_IOCON_PinMux

Definition at line 129 of file iocon_17xx_40xx.h.

#define MD_HS_DIS   (0x1 << 8)

Macro to disable I2C 50ns glitch filter and slew rate control- use with Chip_IOCON_PinMux

Definition at line 120 of file iocon_17xx_40xx.h.

#define MD_HS_ENA   (0x0 << 8)

Macro to enable I2C 50ns glitch filter and slew rate control- use with Chip_IOCON_PinMux

Definition at line 119 of file iocon_17xx_40xx.h.

#define MD_HYS_DIS   (0x0 << 5)

Macro to disable hysteresis- use with Chip_IOCON_PinMux

Definition at line 114 of file iocon_17xx_40xx.h.

#define MD_HYS_ENA   (0x1 << 5)

Macro to enable hysteresis- use with Chip_IOCON_PinMux

Definition at line 113 of file iocon_17xx_40xx.h.

#define MD_IINV_DIS   (0x0 << 6)

Macro to disable input inversion- use with Chip_IOCON_PinMux

Definition at line 116 of file iocon_17xx_40xx.h.

#define MD_IINV_ENA   (0x1 << 6)

Macro to enable input inversion- use with Chip_IOCON_PinMux

Definition at line 115 of file iocon_17xx_40xx.h.

#define MD_OD_DIS   (0x0 << 10)

Macro to disable simulated open drain mode- use with Chip_IOCON_PinMux

Definition at line 118 of file iocon_17xx_40xx.h.

#define MD_OD_ENA   (0x1 << 10)

Macro to enable simulated open drain mode- use with Chip_IOCON_PinMux

Definition at line 117 of file iocon_17xx_40xx.h.

#define MD_PDN   (0x1 << 3)

Definition at line 110 of file iocon_17xx_40xx.h.

#define MD_PLN   (0x0 << 3)

Definition at line 109 of file iocon_17xx_40xx.h.

#define MD_PUP   (0x2 << 3)

Definition at line 111 of file iocon_17xx_40xx.h.

#define MD_RPT   (0x3 << 3)

Definition at line 112 of file iocon_17xx_40xx.h.

#define MD_STD_SLEW_RATE   (0x0 << 9)

Macro to enable standard mode, slew rate control is enabled - use with Chip_IOCON_PinMux

Definition at line 127 of file iocon_17xx_40xx.h.

Function Documentation

STATIC INLINE void Chip_IOCON_Init ( LPC_IOCON_T pIOCON)

Initialize the IOCON peripheral.

Parameters
pIOCON: The base of IOCON peripheral on the chip
Returns
Nothing

Definition at line 142 of file iocon_17xx_40xx.h.

STATIC INLINE void Chip_IOCON_PinMux ( LPC_IOCON_T pIOCON,
uint8_t  port,
uint8_t  pin,
uint32_t  mode,
uint8_t  func 
)

Setup pin modes and function.

Parameters
pIOCON: The base of IOCON peripheral on the chip
port: port number
pin: gpio pin number
mode: OR'ed values or type IOCON_*
func: Pin function, value of type IOCON_FUNC0 to IOCON_FUNC7
Returns
Nothing

Definition at line 230 of file iocon_17xx_40xx.h.

STATIC INLINE void Chip_IOCON_PinMuxSet ( LPC_IOCON_T pIOCON,
uint8_t  port,
uint8_t  pin,
uint32_t  modefunc 
)

Sets I/O Control pin mux.

Parameters
pIOCON: The base of IOCON peripheral on the chip
port: GPIO port to mux
pin: GPIO pin to mux
modefunc: OR'ed values or type IOCON_*
Returns
Nothing

Definition at line 216 of file iocon_17xx_40xx.h.