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

Detailed Description

Data Structures

struct  LPC_SYSCON_T
 LPC1125 System Control block structure. More...
 

Macros

#define SYSCON_RST_POR   (1 << 0)
 
#define SYSCON_RST_EXTRST   (1 << 1)
 
#define SYSCON_RST_WDT   (1 << 2)
 
#define SYSCON_RST_BOD   (1 << 3)
 
#define SYSCON_RST_SYSRST   (1 << 4)
 
#define SYSCON_NMISRC_ENABLE   ((uint32_t) 1 << 31)
 
#define SYSCON_DEEPSLP_BOD_PD   (1 << 3)
 
#define SYSCON_DEEPSLP_WDTOSC_PD   (1 << 6)
 
#define SYSCON_SLPWAKE_IRCOUT_PD   (1 << 0)
 
#define SYSCON_SLPWAKE_IRC_PD   (1 << 1)
 
#define SYSCON_SLPWAKE_FLASH_PD   (1 << 2)
 
#define SYSCON_SLPWAKE_BOD_PD   (1 << 3)
 
#define SYSCON_SLPWAKE_ADC_PD   (1 << 4)
 
#define SYSCON_SLPWAKE_SYSOSC_PD   (1 << 5)
 
#define SYSCON_SLPWAKE_WDTOSC_PD   (1 << 6)
 
#define SYSCON_SLPWAKE_SYSPLL_PD   (1 << 7)
 
#define SYSCON_POWERDOWN_IRCOUT_PD   (1 << 0)
 
#define SYSCON_POWERDOWN_IRC_PD   (1 << 1)
 
#define SYSCON_POWERDOWN_FLASH_PD   (1 << 2)
 
#define SYSCON_POWERDOWN_BOD_PD   (1 << 3)
 
#define SYSCON_POWERDOWN_ADC_PD   (1 << 4)
 
#define SYSCON_POWERDOWN_SYSOSC_PD   (1 << 5)
 
#define SYSCON_POWERDOWN_WDTOSC_PD   (1 << 6)
 
#define SYSCON_POWERDOWN_SYSPLL_PD   (1 << 7)
 

Enumerations

enum  CHIP_SYSCON_BOOT_MODE_REMAP_T { REMAP_BOOT_LOADER_MODE, REMAP_USER_RAM_MODE, REMAP_USER_FLASH_MODE }
 
enum  CHIP_SYSCON_PERIPH_RESET_T { RESET_SSP0, RESET_I2C0, RESET_SSP1 }
 
enum  CHIP_SYSCON_BODRSTLVL_T { SYSCON_BODRSTLVL_1_46V, SYSCON_BODRSTLVL_2_06V, SYSCON_BODRSTLVL_2_35V, SYSCON_BODRSTLVL_2_63V }
 
enum  CHIP_SYSCON_BODRINTVAL_T { SYSCON_BODINTVAL_RESERVED1, SYSCON_BODINTVAL_2_22V, SYSCON_BODINTVAL_2_52V, SYSCON_BODINTVAL_2_80V }
 

Functions

STATIC INLINE void Chip_SYSCON_Map (CHIP_SYSCON_BOOT_MODE_REMAP_T remap)
 Re-map interrupt vectors. More...
 
STATIC INLINE void Chip_SYSCON_AssertPeriphReset (CHIP_SYSCON_PERIPH_RESET_T periph)
 Assert reset for a peripheral. More...
 
STATIC INLINE void Chip_SYSCON_DeassertPeriphReset (CHIP_SYSCON_PERIPH_RESET_T periph)
 De-assert reset for a peripheral. More...
 
STATIC INLINE void Chip_SYSCON_PeriphReset (CHIP_SYSCON_PERIPH_RESET_T periph)
 Resets a peripheral. More...
 
STATIC INLINE uint32_t Chip_SYSCON_GetSystemRSTStatus (void)
 Get system reset status. More...
 
STATIC INLINE void Chip_SYSCON_ClearSystemRSTStatus (uint32_t reset)
 Clear system reset status. More...
 
STATIC INLINE uint32_t Chip_SYSCON_GetPORPIOStatus (int index)
 Read POR captured PIO status. More...
 
STATIC INLINE void Chip_SYSCON_SetBODLevels (CHIP_SYSCON_BODRSTLVL_T rstlvl, CHIP_SYSCON_BODRINTVAL_T intlvl)
 Set brown-out detection interrupt and reset levels. More...
 
STATIC INLINE void Chip_SYSCON_EnableBODReset (void)
 Enable brown-out detection reset. More...
 
STATIC INLINE void Chip_SYSCON_DisableBODReset (void)
 Disable brown-out detection reset. More...
 
STATIC INLINE void Chip_SYSCON_SetSYSTCKCAL (uint32_t sysCalVal)
 Set System tick timer calibration value. More...
 
STATIC INLINE void Chip_SYSCON_SetIRQLatency (uint32_t latency)
 Set System IRQ latency. More...
 
STATIC INLINE uint32_t Chip_SYSCON_GetIRQLatency (void)
 Get System IRQ latency. More...
 
STATIC INLINE void Chip_SYSCON_SetNMISource (uint32_t intsrc)
 Set source for non-maskable interrupt (NMI) More...
 
STATIC INLINE void Chip_SYSCON_EnableNMISource (void)
 Enable interrupt used for NMI source. More...
 
STATIC INLINE void Chip_SYSCON_DisableNMISource (void)
 Disable interrupt used for NMI source. More...
 
STATIC INLINE void Chip_SYSCON_SetStartPin (uint32_t pin, uint32_t edge)
 Set edge for PIO start logic. More...
 
STATIC INLINE void Chip_SYSCON_EnableStartPin (uint32_t pin)
 Enable PIO start logic for a pin. More...
 
STATIC INLINE void Chip_SYSCON_DisableStartPin (uint32_t pin)
 Disable PIO start logic for a pin. More...
 
STATIC INLINE void Chip_SYSCON_ResetStartPin (uint32_t pin)
 Clear PIO start logic state. More...
 
STATIC INLINE bool Chip_SYSCON_GetStartPinStatus (uint32_t pin)
 Returns status of pin wakeup. More...
 
void Chip_SYSCON_SetDeepSleepPD (uint32_t sleepmask)
 Setup deep sleep behaviour for power down. More...
 
STATIC INLINE uint32_t Chip_SYSCON_GetDeepSleepPD (void)
 Returns current deep sleep mask. More...
 
void Chip_SYSCON_SetWakeup (uint32_t wakeupmask)
 Setup wakeup behaviour from deep sleep. More...
 
STATIC INLINE uint32_t Chip_SYSCON_GetWakeup (void)
 Return current wakeup mask. More...
 
void Chip_SYSCON_PowerDown (uint32_t powerdownmask)
 Power down one or more blocks or peripherals. More...
 
void Chip_SYSCON_PowerUp (uint32_t powerupmask)
 Power up one or more blocks or peripherals. More...
 
STATIC INLINE uint32_t Chip_SYSCON_GetPowerStates (void)
 Get power status. More...
 

Macro Definition Documentation

#define SYSCON_DEEPSLP_BOD_PD   (1 << 3)

Deep sleep setup valuesBOD power-down control in Deep-sleep mode, powered down

Definition at line 385 of file syscon_112x.h.

#define SYSCON_DEEPSLP_WDTOSC_PD   (1 << 6)

Watchdog oscillator power control in Deep-sleep, powered down

Definition at line 386 of file syscon_112x.h.

#define SYSCON_NMISRC_ENABLE   ((uint32_t) 1 << 31)

Non-Maskable Interrupt Enable/Disable valueEnable the Non-Maskable Interrupt (NMI) source

Definition at line 173 of file syscon_112x.h.

#define SYSCON_POWERDOWN_ADC_PD   (1 << 4)

ADC power down

Definition at line 451 of file syscon_112x.h.

#define SYSCON_POWERDOWN_BOD_PD   (1 << 3)

BOD power down

Definition at line 450 of file syscon_112x.h.

#define SYSCON_POWERDOWN_FLASH_PD   (1 << 2)

Flash power down

Definition at line 449 of file syscon_112x.h.

#define SYSCON_POWERDOWN_IRC_PD   (1 << 1)

IRC oscillator power-down

Definition at line 448 of file syscon_112x.h.

#define SYSCON_POWERDOWN_IRCOUT_PD   (1 << 0)

Power down configuration valuesIRC oscillator output power down

Definition at line 447 of file syscon_112x.h.

#define SYSCON_POWERDOWN_SYSOSC_PD   (1 << 5)

System oscillator power down

Definition at line 452 of file syscon_112x.h.

#define SYSCON_POWERDOWN_SYSPLL_PD   (1 << 7)

System PLL power down

Definition at line 454 of file syscon_112x.h.

#define SYSCON_POWERDOWN_WDTOSC_PD   (1 << 6)

Watchdog oscillator power down

Definition at line 453 of file syscon_112x.h.

#define SYSCON_RST_BOD   (1 << 3)

Brown-out detect reset status

Definition at line 167 of file syscon_112x.h.

#define SYSCON_RST_EXTRST   (1 << 1)

External reset status

Definition at line 165 of file syscon_112x.h.

#define SYSCON_RST_POR   (1 << 0)

System reset statusPOR reset status

Definition at line 164 of file syscon_112x.h.

#define SYSCON_RST_SYSRST   (1 << 4)

software system reset status

Definition at line 168 of file syscon_112x.h.

#define SYSCON_RST_WDT   (1 << 2)

Watchdog reset status

Definition at line 166 of file syscon_112x.h.

#define SYSCON_SLPWAKE_ADC_PD   (1 << 4)

ADC wake-up configuration

Definition at line 417 of file syscon_112x.h.

#define SYSCON_SLPWAKE_BOD_PD   (1 << 3)

BOD wake-up configuration

Definition at line 416 of file syscon_112x.h.

#define SYSCON_SLPWAKE_FLASH_PD   (1 << 2)

Flash wake-up configuration

Definition at line 415 of file syscon_112x.h.

#define SYSCON_SLPWAKE_IRC_PD   (1 << 1)

IRC oscillator power-down wake-up configuration

Definition at line 414 of file syscon_112x.h.

#define SYSCON_SLPWAKE_IRCOUT_PD   (1 << 0)

Deep sleep to wakeup setup valuesIRC oscillator output wake-up configuration

Definition at line 413 of file syscon_112x.h.

#define SYSCON_SLPWAKE_SYSOSC_PD   (1 << 5)

System oscillator wake-up configuration

Definition at line 418 of file syscon_112x.h.

#define SYSCON_SLPWAKE_SYSPLL_PD   (1 << 7)

System PLL wake-up configuration

Definition at line 420 of file syscon_112x.h.

#define SYSCON_SLPWAKE_WDTOSC_PD   (1 << 6)

Watchdog oscillator wake-up configuration

Definition at line 419 of file syscon_112x.h.

Enumeration Type Documentation

Brown-out detector interrupt level

Enumerator
SYSCON_BODINTVAL_RESERVED1 
SYSCON_BODINTVAL_2_22V 

Brown-out interrupt at 2.22v

SYSCON_BODINTVAL_2_52V 

Brown-out interrupt at 2.52v

SYSCON_BODINTVAL_2_80V 

Brown-out interrupt at 2.8v

Definition at line 220 of file syscon_112x.h.

Brown-out detector reset level

Enumerator
SYSCON_BODRSTLVL_1_46V 

Brown-out reset at 1.46v

SYSCON_BODRSTLVL_2_06V 

Brown-out reset at 2.06v

SYSCON_BODRSTLVL_2_35V 

Brown-out reset at 2.35v

SYSCON_BODRSTLVL_2_63V 

Brown-out reset at 2.63v

Definition at line 210 of file syscon_112x.h.

System memory remap modes used to remap interrupt vectors

Enumerator
REMAP_BOOT_LOADER_MODE 

Interrupt vectors are re-mapped to Boot ROM

REMAP_USER_RAM_MODE 

Interrupt vectors are re-mapped to Static RAM

REMAP_USER_FLASH_MODE 

Interrupt vectors are not re-mapped and reside in Flash

Definition at line 103 of file syscon_112x.h.

Peripheral reset identifiers, not available on all devices

Enumerator
RESET_SSP0 

SSP0 reset control

RESET_I2C0 

I2C0 reset control

RESET_SSP1 

SSP1 reset control

Definition at line 122 of file syscon_112x.h.

Function Documentation

STATIC INLINE void Chip_SYSCON_AssertPeriphReset ( CHIP_SYSCON_PERIPH_RESET_T  periph)

Assert reset for a peripheral.

Parameters
periph: Peripheral to assert reset for
Returns
Nothing
Note
The peripheral will stay in reset until reset is de-asserted. Call Chip_SYSCON_DeassertPeriphReset() to de-assert the reset.

Definition at line 135 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_ClearSystemRSTStatus ( uint32_t  reset)

Clear system reset status.

Parameters
reset: An Or'ed value of SYSCON_RST_* status to clear
Returns
Nothing
Note
This function returns the detected reset source(s).

Definition at line 191 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_DeassertPeriphReset ( CHIP_SYSCON_PERIPH_RESET_T  periph)

De-assert reset for a peripheral.

Parameters
periph: Peripheral to de-assert reset for
Returns
Nothing

Definition at line 145 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_DisableBODReset ( void  )

Disable brown-out detection reset.

Returns
Nothing

Definition at line 254 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_DisableNMISource ( void  )

Disable interrupt used for NMI source.

Returns
Nothing

Definition at line 316 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_DisableStartPin ( uint32_t  pin)

Disable PIO start logic for a pin.

Parameters
pin: PIO pin number
Returns
Nothing
Note
Different devices support different pins, see the user manual for supported pins.

Definition at line 355 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_EnableBODReset ( void  )

Enable brown-out detection reset.

Returns
Nothing

Definition at line 245 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_EnableNMISource ( void  )

Enable interrupt used for NMI source.

Returns
Nothing

Definition at line 307 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_EnableStartPin ( uint32_t  pin)

Enable PIO start logic for a pin.

Parameters
pin: PIO pin number
Returns
Nothing
Note
Different devices support different pins, see the user manual for supported pins.

Definition at line 344 of file syscon_112x.h.

STATIC INLINE uint32_t Chip_SYSCON_GetDeepSleepPD ( void  )

Returns current deep sleep mask.

Returns
OR'ed values of SYSCON_DEEPSLP_* values
Note
A high bit indicates the peripheral will power down on deep sleep.

Definition at line 405 of file syscon_112x.h.

STATIC INLINE uint32_t Chip_SYSCON_GetIRQLatency ( void  )

Get System IRQ latency.

Returns
Latency in clock ticks

Definition at line 286 of file syscon_112x.h.

STATIC INLINE uint32_t Chip_SYSCON_GetPORPIOStatus ( int  index)

Read POR captured PIO status.

Parameters
index: POR register index, 0 or 1
Returns
captured POR PIO status
Note
Some devices only support index 0.

Definition at line 202 of file syscon_112x.h.

STATIC INLINE uint32_t Chip_SYSCON_GetPowerStates ( void  )

Get power status.

Returns
OR'ed values of SYSCON_POWERDOWN_* values
Note
A high state indicates the peripheral is powered down.

Definition at line 475 of file syscon_112x.h.

STATIC INLINE bool Chip_SYSCON_GetStartPinStatus ( uint32_t  pin)

Returns status of pin wakeup.

Parameters
pin: PIO pin number
Returns
true if a pin start signal is pending, otherwise false
Note
Different devices support different pins, see the user manual for supported pins.

Definition at line 377 of file syscon_112x.h.

STATIC INLINE uint32_t Chip_SYSCON_GetSystemRSTStatus ( void  )

Get system reset status.

Returns
An Or'ed value of SYSCON_RST_*
Note
This function returns the detected reset source(s).

Definition at line 180 of file syscon_112x.h.

STATIC INLINE uint32_t Chip_SYSCON_GetWakeup ( void  )

Return current wakeup mask.

Returns
OR'ed values of SYSCON_SLPWAKE_* values
Note
A high state indicates the peripehral will powerup on wakeup.

Definition at line 439 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_Map ( CHIP_SYSCON_BOOT_MODE_REMAP_T  remap)

Re-map interrupt vectors.

Parameters
remap: system memory map value
Returns
Nothing

Definition at line 114 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_PeriphReset ( CHIP_SYSCON_PERIPH_RESET_T  periph)

Resets a peripheral.

Parameters
periph: Peripheral to reset
Returns
Nothing

Definition at line 155 of file syscon_112x.h.

void Chip_SYSCON_PowerDown ( uint32_t  powerdownmask)

Power down one or more blocks or peripherals.

Parameters
powerdownmask: OR'ed values of SYSCON_POWERDOWN_* values
Returns
Nothing

Definition at line 75 of file syscon_112x.c.

void Chip_SYSCON_PowerUp ( uint32_t  powerupmask)

Power up one or more blocks or peripherals.

Parameters
powerupmask: OR'ed values of SYSCON_POWERDOWN_* values
Returns
Nothing

Definition at line 86 of file syscon_112x.c.

STATIC INLINE void Chip_SYSCON_ResetStartPin ( uint32_t  pin)

Clear PIO start logic state.

Parameters
pin: PIO pin number
Returns
Nothing
Note
Different devices support different pins, see the user manual for supported pins.

Definition at line 366 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_SetBODLevels ( CHIP_SYSCON_BODRSTLVL_T  rstlvl,
CHIP_SYSCON_BODRINTVAL_T  intlvl 
)

Set brown-out detection interrupt and reset levels.

Parameters
rstlvl: Brown-out detector reset level
intlvl: Brown-out interrupt level
Returns
Nothing
Note
Brown-out detection reset will be disabled upon exiting this function. Use Chip_SYSCON_EnableBODReset() to re-enable.

Definition at line 235 of file syscon_112x.h.

void Chip_SYSCON_SetDeepSleepPD ( uint32_t  sleepmask)

Setup deep sleep behaviour for power down.

Parameters
sleepmask: OR'ed values of SYSCON_DEEPSLP_* values (high to powerdown on deepsleep)
Returns
Nothing
Note
This must be setup prior to using deep sleep. See the user manual (PDSLEEPCFG register) for more info on setting this up. This function selects which peripherals are powered down on deep sleep. This function should only be called once with all options for power-down in that call.

Definition at line 61 of file syscon_112x.c.

STATIC INLINE void Chip_SYSCON_SetIRQLatency ( uint32_t  latency)

Set System IRQ latency.

Parameters
latency: Latency in clock ticks
Returns
Nothing
Note
Sets the IRQ latency, a value between 0 and 255 clocks. Lower values allow better latency.

Definition at line 277 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_SetNMISource ( uint32_t  intsrc)

Set source for non-maskable interrupt (NMI)

Parameters
intsrc: IRQ number to assign to the NMI
Returns
Nothing
Note
The NMI source will be disabled upon exiting this function. use the Chip_SYSCON_EnableNMISource() function to enable the NMI source.

Definition at line 298 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_SetStartPin ( uint32_t  pin,
uint32_t  edge 
)

Set edge for PIO start logic.

Parameters
pin: PIO pin number
edge: 0 for falling edge, 1 for rising edge
Returns
Nothing
Note
Different devices support different pins, see the user manual for supported pins.

Definition at line 328 of file syscon_112x.h.

STATIC INLINE void Chip_SYSCON_SetSYSTCKCAL ( uint32_t  sysCalVal)

Set System tick timer calibration value.

Parameters
sysCalVal: System tick timer calibration value
Returns
Nothing

Definition at line 265 of file syscon_112x.h.

void Chip_SYSCON_SetWakeup ( uint32_t  wakeupmask)

Setup wakeup behaviour from deep sleep.

Parameters
wakeupmask: OR'ed values of SYSCON_SLPWAKE_* values (high is powered down)
Returns
Nothing
Note
This must be setup prior to using deep sleep. See the user manual (PDWAKECFG register) for more info on setting this up. This function selects which peripherals are powered up on exit from deep sleep. This function should only be called once with all options for wakeup in that call.

Definition at line 68 of file syscon_112x.c.