LPCOpen Platform for LPC112X microcontrollers  112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
Data Structures | Macros | Enumerations | Functions
CHIP: LPC11xx IO Control driver

Detailed Description

Data Structures

struct  PINMUX_GRP_T
 Array of IOCON pin definitions passed to Chip_IOCON_SetPinMuxing() must be in this format. More...
 
struct  LPC_IOCON_T
 

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_SFI2C_EN   (0x0 << 8)
 
#define IOCON_STDI2C_EN   (0x1 << 8)
 
#define IOCON_FASTI2C_EN   (0x2 << 8)
 
#define IOCON_FILT_DIS   (0x1 << 8)
 
#define IOCON_OPENDRAIN_EN   (0x1 << 10)
 
#define MD_PLN   (0x0 << 3)
 
#define MD_PDN   (0x1 << 3)
 
#define MD_PUP   (0x2 << 3)
 
#define MD_BUK   (0x3 << 3)
 
#define MD_HYS   (0x1 << 5)
 
#define MD_INV   (0x1 << 6)
 
#define MD_ADMODE   (0x0 << 7)
 
#define MD_DIGMODE   (0x1 << 7)
 
#define MD_DISFIL   (0x0 << 8)
 
#define MD_ENFIL   (0x1 << 8)
 
#define MD_SFI2C   (0x0 << 8)
 
#define MD_STDI2C   (0x1 << 8)
 
#define MD_FASTI2C   (0x2 << 8)
 
#define MD_OPENDRAIN   (0x1 << 10)
 
#define FUNC0   0x0
 
#define FUNC1   0x1
 
#define FUNC2   0x2
 
#define FUNC3   0x3
 
#define FUNC4   0x4
 
#define FUNC5   0x5
 
#define FUNC6   0x6
 
#define FUNC7   0x7
 

Enumerations

enum  CHIP_IOCON_PIO_T {
  IOCON_PIO0_0 = (0x00C >> 2), IOCON_PIO0_1 = (0x010 >> 2), IOCON_PIO0_2 = (0x01C >> 2), IOCON_PIO0_3 = (0x02C >> 2),
  IOCON_PIO0_4 = (0x030 >> 2), IOCON_PIO0_5 = (0x034 >> 2), IOCON_PIO0_6 = (0x04C >> 2), IOCON_PIO0_7 = (0x050 >> 2),
  IOCON_PIO0_8 = (0x060 >> 2), IOCON_PIO0_9 = (0x064 >> 2), IOCON_PIO0_10 = (0x068 >> 2), IOCON_PIO0_11 = (0x074 >> 2),
  IOCON_PIO1_0 = (0x078 >> 2), IOCON_PIO1_1 = (0x07C >> 2), IOCON_PIO1_2 = (0x080 >> 2), IOCON_PIO1_3 = (0x090 >> 2),
  IOCON_PIO1_4 = (0x094 >> 2), IOCON_PIO1_5 = (0x0A0 >> 2), IOCON_PIO1_6 = (0x0A4 >> 2), IOCON_PIO1_7 = (0x0A8 >> 2),
  IOCON_PIO1_8 = (0x014 >> 2), IOCON_PIO1_9 = (0x038 >> 2), IOCON_PIO1_10 = (0x06C >> 2), IOCON_PIO1_11 = (0x098 >> 2),
  IOCON_PIO2_0 = (0x008 >> 2), IOCON_PIO2_1 = (0x028 >> 2), IOCON_PIO2_2 = (0x05C >> 2), IOCON_PIO2_3 = (0x08C >> 2),
  IOCON_PIO2_4 = (0x040 >> 2), IOCON_PIO2_5 = (0x044 >> 2), IOCON_PIO2_6 = (0x000 >> 2), IOCON_PIO2_7 = (0x020 >> 2),
  IOCON_PIO2_8 = (0x024 >> 2), IOCON_PIO2_9 = (0x054 >> 2), IOCON_PIO2_10 = (0x058 >> 2), IOCON_PIO3_0 = (0x084 >> 2),
  IOCON_PIO3_2 = (0x09C >> 2), IOCON_PIO3_3 = (0x0AC >> 2), IOCON_PIO3_4 = (0x03C >> 2), IOCON_PIO3_5 = (0x048 >> 2)
}
 LPC11XX I/O Configuration register offset. More...
 
enum  CHIP_IOCON_PIN_LOC_T {
  IOCON_SCKLOC_PIO0_10 = (0xB0), IOCON_SCKLOC_PIO0_6 = (0xB0 | 2), IOCON_DSRLOC_PIO2_1 = (0xB4), IOCON_DCDLOC_PIO2_2 = (0xB8),
  IOCON_DCDLOC_PIO3_2 = (0xB8 | 1), IOCON_RILOC_PIO2_3 = (0xBC), IOCON_RILOC_PIO3_3 = (0xBC | 1), IOCON_SSEL1_LOC_PIO2_2 = (0x18),
  IOCON_SSEL1_LOC_PIO2_4 = (0x18 | 1), IOCON_CT16B0_CAP0_LOC_PIO0_2 = (0xC0), IOCON_CT16B0_CAP0_LOC_PIO3_3 = (0xC0 | 1), IOCON_SCK1_LOC_PIO2_1 = (0xC4),
  IOCON_SCK1_LOC_PIO3_2 = (0xC4 | 1), IOCON_MISO1_LOC_PIO2_2 = (0xC8), IOCON_MISO1_LOC_PIO1_10 = (0xC8 | 1), IOCON_MOSI1_LOC_PIO2_3 = (0xCC),
  IOCON_MOSI1_LOC_PIO1_9 = (0xCC), IOCON_CT326B0_CAP0_LOC_PIO1_5 = (0xD0), IOCON_CT326B0_CAP0_LOC_PIO2_9 = (0xD0 | 1), IOCON_U0_RXD_LOC_PIO1_6 = (0xD4),
  IOCON_U0_RXD_LOC_PIO2_7 = (0xD4 | 1), IOCON_U0_RXD_LOC_PIO3_4 = (0xD4 | 3)
}
 LPC11XX Pin location select. More...
 

Functions

STATIC INLINE void Chip_IOCON_PinMuxSet (LPC_IOCON_T *pIOCON, CHIP_IOCON_PIO_T pin, uint32_t modefunc)
 Sets I/O Control pin mux. More...
 
STATIC INLINE void Chip_IOCON_PinMux (LPC_IOCON_T *pIOCON, CHIP_IOCON_PIO_T pin, uint16_t mode, uint8_t func)
 I/O Control pin mux. More...
 
STATIC INLINE void Chip_IOCON_PinLocSel (LPC_IOCON_T *pIOCON, CHIP_IOCON_PIN_LOC_T sel)
 Select pin location. More...
 
void Chip_IOCON_SetPinMuxing (LPC_IOCON_T *pIOCON, const PINMUX_GRP_T *pinArray, uint32_t arrayLength)
 Set all I/O Control pin muxing. More...
 

Macro Definition Documentation

#define FUNC0   0x0

Definition at line 187 of file iocon_112x.h.

#define FUNC1   0x1

Definition at line 188 of file iocon_112x.h.

#define FUNC2   0x2

Definition at line 189 of file iocon_112x.h.

#define FUNC3   0x3

Definition at line 190 of file iocon_112x.h.

#define FUNC4   0x4

Definition at line 191 of file iocon_112x.h.

#define FUNC5   0x5

Definition at line 192 of file iocon_112x.h.

#define FUNC6   0x6

Definition at line 193 of file iocon_112x.h.

#define FUNC7   0x7

Definition at line 194 of file iocon_112x.h.

#define IOCON_ADMODE_EN   (0x0 << 7)

Enables analog input function (analog pins only)

Definition at line 161 of file iocon_112x.h.

#define IOCON_DIGMODE_EN   (0x1 << 7)

Enables digital function (analog pins only)

Definition at line 162 of file iocon_112x.h.

#define IOCON_FASTI2C_EN   (0x2 << 8)

I2C Fast-mode Plus

Definition at line 165 of file iocon_112x.h.

#define IOCON_FILT_DIS   (0x1 << 8)

Disables noise pulses filtering (10nS glitch filter)

Definition at line 166 of file iocon_112x.h.

#define IOCON_FUNC0   0x0

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

Definition at line 147 of file iocon_112x.h.

#define IOCON_FUNC1   0x1

Selects pin function 1

Definition at line 148 of file iocon_112x.h.

#define IOCON_FUNC2   0x2

Selects pin function 2

Definition at line 149 of file iocon_112x.h.

#define IOCON_FUNC3   0x3

Selects pin function 3

Definition at line 150 of file iocon_112x.h.

#define IOCON_FUNC4   0x4

Selects pin function 4

Definition at line 151 of file iocon_112x.h.

#define IOCON_FUNC5   0x5

Selects pin function 5

Definition at line 152 of file iocon_112x.h.

#define IOCON_FUNC6   0x6

Selects pin function 6

Definition at line 153 of file iocon_112x.h.

#define IOCON_FUNC7   0x7

Selects pin function 7

Definition at line 154 of file iocon_112x.h.

#define IOCON_HYS_EN   (0x1 << 5)

Enables hysteresis

Definition at line 159 of file iocon_112x.h.

#define IOCON_INV_EN   (0x1 << 6)

Enables invert function on input

Definition at line 160 of file iocon_112x.h.

#define IOCON_MODE_INACT   (0x0 << 3)

No addition pin function

Definition at line 155 of file iocon_112x.h.

#define IOCON_MODE_PULLDOWN   (0x1 << 3)

Selects pull-down function

Definition at line 156 of file iocon_112x.h.

#define IOCON_MODE_PULLUP   (0x2 << 3)

Selects pull-up function

Definition at line 157 of file iocon_112x.h.

#define IOCON_MODE_REPEATER   (0x3 << 3)

Selects pin repeater function

Definition at line 158 of file iocon_112x.h.

#define IOCON_OPENDRAIN_EN   (0x1 << 10)

Enables open-drain function

Definition at line 167 of file iocon_112x.h.

#define IOCON_SFI2C_EN   (0x0 << 8)

I2C standard mode/fast-mode

Definition at line 163 of file iocon_112x.h.

#define IOCON_STDI2C_EN   (0x1 << 8)

I2C standard I/O functionality

Definition at line 164 of file iocon_112x.h.

#define MD_ADMODE   (0x0 << 7)

Select analog mode

Definition at line 179 of file iocon_112x.h.

#define MD_BUK   (0x3 << 3)

Enable pull-down and pull-up resistor at resistor at pad (repeater mode)

Definition at line 176 of file iocon_112x.h.

#define MD_DIGMODE   (0x1 << 7)

Select digitial mode

Definition at line 180 of file iocon_112x.h.

#define MD_DISFIL   (0x0 << 8)

Disable 10nS input glitch filter

Definition at line 181 of file iocon_112x.h.

#define MD_ENFIL   (0x1 << 8)

Enable 10nS input glitch filter

Definition at line 182 of file iocon_112x.h.

#define MD_FASTI2C   (0x2 << 8)

I2C Fast-mode Plus

Definition at line 185 of file iocon_112x.h.

#define MD_HYS   (0x1 << 5)

Enable hysteresis

Definition at line 177 of file iocon_112x.h.

#define MD_INV   (0x1 << 6)

Invert enable

Definition at line 178 of file iocon_112x.h.

#define MD_OPENDRAIN   (0x1 << 10)

Open drain mode bit

Definition at line 186 of file iocon_112x.h.

#define MD_PDN   (0x1 << 3)

Enable pull-down resistor at pad

Definition at line 174 of file iocon_112x.h.

#define MD_PLN   (0x0 << 3)

IOCON function and mode selection definitions (old) For backwards compatibility.Disable pull-down and pull-up resistor at resistor at pad

Definition at line 173 of file iocon_112x.h.

#define MD_PUP   (0x2 << 3)

Enable pull-up resistor at pad

Definition at line 175 of file iocon_112x.h.

#define MD_SFI2C   (0x0 << 8)

I2C standard mode/fast-mode

Definition at line 183 of file iocon_112x.h.

#define MD_STDI2C   (0x1 << 8)

I2C standard I/O functionality

Definition at line 184 of file iocon_112x.h.

Enumeration Type Documentation

LPC11XX Pin location select.

Enumerator
IOCON_SCKLOC_PIO0_10 

Selects SCK0 function in pin location PIO0_10

IOCON_SCKLOC_PIO0_6 

Selects SCK0 function in pin location PIO0_6

IOCON_DSRLOC_PIO2_1 

Selects DSR function in pin location PIO2_1

IOCON_DCDLOC_PIO2_2 

Selects DCD function in pin location PIO2_2

IOCON_DCDLOC_PIO3_2 

Selects DCD function in pin location PIO3_2

IOCON_RILOC_PIO2_3 

Selects RI function in pin location PIO2_3

IOCON_RILOC_PIO3_3 

Selects Ri function in pin location PIO3_3

IOCON_SSEL1_LOC_PIO2_2 

Selects SSEL1 function in pin location PIO2_2

IOCON_SSEL1_LOC_PIO2_4 

Selects SSEL1 function in pin location PIO2_4

IOCON_CT16B0_CAP0_LOC_PIO0_2 

Selects SSEL1 CTB16B0_CAP0 function in pin location PIO0_2

IOCON_CT16B0_CAP0_LOC_PIO3_3 

Selects SSEL1 CTB16B0_CAP0 function in pin location PIO3_3

IOCON_SCK1_LOC_PIO2_1 

Selects SCK1 function in pin location PIO2_1

IOCON_SCK1_LOC_PIO3_2 

Selects SCK1 function in pin location PIO3_2

IOCON_MISO1_LOC_PIO2_2 

Selects MISO1 function in pin location PIO2_2

IOCON_MISO1_LOC_PIO1_10 

Selects MISO1 function in pin location PIO1_10

IOCON_MOSI1_LOC_PIO2_3 

Selects MOSI1 function in pin location PIO2_3

IOCON_MOSI1_LOC_PIO1_9 

Selects MOSI1 function in pin location PIO1_9

IOCON_CT326B0_CAP0_LOC_PIO1_5 

Selects CT32B0_CAP0 function in pin location PIO1_5

IOCON_CT326B0_CAP0_LOC_PIO2_9 

Selects CT32B0_CAP0 function in pin location PIO2_9

IOCON_U0_RXD_LOC_PIO1_6 

Selects U0 RXD function in pin location PIO1_6

IOCON_U0_RXD_LOC_PIO2_7 

Selects U0 RXD function in pin location PIO2_7

IOCON_U0_RXD_LOC_PIO3_4 

Selects U0 RXD function in pin location PIO3_4

Definition at line 103 of file iocon_112x.h.

LPC11XX I/O Configuration register offset.

Enumerator
IOCON_PIO0_0 
IOCON_PIO0_1 
IOCON_PIO0_2 
IOCON_PIO0_3 
IOCON_PIO0_4 
IOCON_PIO0_5 
IOCON_PIO0_6 
IOCON_PIO0_7 
IOCON_PIO0_8 
IOCON_PIO0_9 
IOCON_PIO0_10 
IOCON_PIO0_11 
IOCON_PIO1_0 
IOCON_PIO1_1 
IOCON_PIO1_2 
IOCON_PIO1_3 
IOCON_PIO1_4 
IOCON_PIO1_5 
IOCON_PIO1_6 
IOCON_PIO1_7 
IOCON_PIO1_8 
IOCON_PIO1_9 
IOCON_PIO1_10 
IOCON_PIO1_11 
IOCON_PIO2_0 
IOCON_PIO2_1 
IOCON_PIO2_2 
IOCON_PIO2_3 
IOCON_PIO2_4 
IOCON_PIO2_5 
IOCON_PIO2_6 
IOCON_PIO2_7 
IOCON_PIO2_8 
IOCON_PIO2_9 
IOCON_PIO2_10 
IOCON_PIO3_0 
IOCON_PIO3_2 
IOCON_PIO3_3 
IOCON_PIO3_4 
IOCON_PIO3_5 

Definition at line 55 of file iocon_112x.h.

Function Documentation

STATIC INLINE void Chip_IOCON_PinLocSel ( LPC_IOCON_T pIOCON,
CHIP_IOCON_PIN_LOC_T  sel 
)

Select pin location.

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

Definition at line 227 of file iocon_112x.h.

STATIC INLINE void Chip_IOCON_PinMux ( LPC_IOCON_T pIOCON,
CHIP_IOCON_PIO_T  pin,
uint16_t  mode,
uint8_t  func 
)

I/O Control pin mux.

Parameters
pIOCON: The base of IOCON peripheral on the chip
pin: GPIO pin to mux
mode: OR'ed values or type IOCON_*
func: Pin function, value of type IOCON_FUNC?
Returns
Nothing

Definition at line 216 of file iocon_112x.h.

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

Sets I/O Control pin mux.

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

Definition at line 203 of file iocon_112x.h.

void Chip_IOCON_SetPinMuxing ( LPC_IOCON_T pIOCON,
const PINMUX_GRP_T pinArray,
uint32_t  arrayLength 
)

Set all I/O Control pin muxing.

Parameters
pIOCON: The base of IOCON peripheral on the chip
pinArray: Pointer to array of pin mux selections
arrayLength: Number of entries in pinArray
Returns
Nothing

Definition at line 48 of file iocon_112x.c.