Clemens Valens / board

Dependents:   kinetisizer

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers board_sysinit.c Source File

board_sysinit.c

00001 /*
00002  * @brief LPCXpresso 1347 Sysinit file
00003  *
00004  * @note
00005  * Copyright(C) NXP Semiconductors, 2013
00006  * All rights reserved.
00007  *
00008  * @par
00009  * Software that is described herein is for illustrative purposes only
00010  * which provides customers with programming information regarding the
00011  * LPC products.  This software is supplied "AS IS" without any warranties of
00012  * any kind, and NXP Semiconductors and its licensor disclaim any and
00013  * all warranties, express or implied, including all implied warranties of
00014  * merchantability, fitness for a particular purpose and non-infringement of
00015  * intellectual property rights.  NXP Semiconductors assumes no responsibility
00016  * or liability for the use of the software, conveys no license or rights under any
00017  * patent, copyright, mask work right, or any other intellectual property rights in
00018  * or to any products. NXP Semiconductors reserves the right to make changes
00019  * in the software without notification. NXP Semiconductors also makes no
00020  * representation or warranty that such application will be suitable for the
00021  * specified use without further testing or modification.
00022  *
00023  * @par
00024  * Permission to use, copy, modify, and distribute this software and its
00025  * documentation is hereby granted, under NXP Semiconductors' and its
00026  * licensor's relevant copyrights in the software, without fee, provided that it
00027  * is used in conjunction with NXP Semiconductors microcontrollers.  This
00028  * copyright, permission, and disclaimer notice must appear in all copies of
00029  * this code.
00030  */
00031 
00032 #include "board.h"
00033 #include "string.h"
00034 
00035 /* The System initialization code is called prior to the application and
00036    initializes the board for run-time operation. Board initialization
00037    includes clock setup and default pin muxing configuration. */
00038 
00039 /*****************************************************************************
00040  * Private types/enumerations/variables
00041  ****************************************************************************/
00042 
00043 /*****************************************************************************
00044  * Public types/enumerations/variables
00045  ****************************************************************************/
00046 
00047 /* Pin muxing table, only items that need changing from their default pin
00048    state are in this table. */
00049 /*STATIC const PINMUX_GRP_T pinmuxing[] = {
00050     { 0,  3, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7) }, // PIO0_3 used for USB_VBUS
00051     { 0,  4, (IOCON_FUNC1 | IOCON_SFI2C_EN) }, // PIO0_4 used for SCL 
00052     { 0,  5, (IOCON_FUNC1 | IOCON_SFI2C_EN) }, // PIO0_5 used for SDA 
00053     { 0,  6, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7) }, // PIO0_6 used for USB_CONNECT 
00054     { 0, 11, (IOCON_FUNC1 | IOCON_DIGMODE_EN) }, // PIO0_11 used for GPIO 
00055     { 0, 12, (IOCON_FUNC1 | IOCON_DIGMODE_EN) }, // PIO0_12 used for GPIO 
00056     { 0, 13, (IOCON_FUNC3 | IOCON_DIGMODE_EN) }, // PIO0_13 used for CT32B1_MAT0 
00057     { 0, 14, (IOCON_FUNC1 | IOCON_DIGMODE_EN) }, // PIO0_14 used for GPIO 
00058     { 0, 10, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7) }, // PIO0_10 used for GPIO 
00059     { 0, 15, (IOCON_FUNC3 | IOCON_DIGMODE_EN) }, // PIO0_15 used for CT32B1_MAT2 
00060     { 1, 13, (IOCON_FUNC3 | IOCON_RESERVED_BIT_7) }, // PIO1_13 used for TXD 
00061     { 1, 14, (IOCON_FUNC3 | IOCON_RESERVED_BIT_7) }, // PIO1_14 used for RXD 
00062     { 1, 27, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7) }, // PIO1_27 used for CT32B0_MAT3 
00063 };*/
00064 
00065 /*****************************************************************************
00066  * Private functions
00067  ****************************************************************************/
00068 
00069 /*****************************************************************************
00070  * Public functions
00071  ****************************************************************************/
00072 
00073 /* Sets up system pin muxing */
00074 void Board_SetupMuxing(void)
00075 {
00076     /* Enable IOCON clock */
00077     //Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON);
00078 
00079     //Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
00080 }
00081 
00082 /* Set up and initialize clocking prior to call to main */
00083 void Board_SetupClocking(void)
00084 {
00085     //Chip_SetupXtalClocking();
00086 }
00087 
00088 /* Set up and initialize hardware prior to call to main */
00089 void Board_SystemInit(void)
00090 {
00091     /* Booting from FLASH, so remap vector table to FLASH */
00092     //Chip_SYSCTL_Map(REMAP_USER_FLASH_MODE);
00093 
00094     /* Setup system clocking and muxing */
00095     Board_SetupMuxing();
00096     Board_SetupClocking();
00097 }