| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Adding platform definitions using sys_config.h

All LPCOPen code includes the sys_config.h file. The sys_config.h is used to setup definitions for how the code builds for a specific platform such as crystal frequency, debug support, and chip variants. It is recommended to use the sys_config.h file for definitions instead of the compiler argument list for static configuration definitions, as this file is shared across all files - even across multiple projects.

To add a definition in sys_config.h, just add the definition with or without a value in the file. Note that some definitions, such as CORE_M0 must be defined in the compiler's definition list.

CHIP: LPC8xx Chip driver build time options
CHIP: LPC11xx Chip driver build time options
CHIP: LPC13xx Chip driver build time options
CHIP: LPC17xx/40xx Chip driver build time options
CHIP: LPC18xx/43xx Chip driver build time options

Common build definitions on all platforms

Example:

    /* Build for 407x/8x chip family */
    #define CHIP_LPC407X_8X

    /* Build for RMII interface */
    #define USE_RMII

    /* Un-comment DEBUG_ENABLE for IO support via the UART */
    #define DEBUG_ENABLE

    /* Board UART used for debug output */
    #define DEBUG_UART LPC_UART0

    /* Crystal frequency into device */
    #define CRYSTAL_MAIN_FREQ_IN (12000000)

    /* Crystal frequency into device for RTC/32K input */
    #define CRYSTAL_32K_FREQ_IN (32768)

    /* Enable DMA in SDC driver */
    #define SDC_DMA_ENABLE

Definitions can also be added to the compiler definition list instead of being in sys_config.h
Adding platform definitions using the compiler