/* Set up and initialize all required blocks and functions related to the board hardware */ void Board_Init(void) { /* Sets up DEBUG UART */ DEBUGINIT(); /* Updates SystemCoreClock global var with current clock speed */ SystemCoreClockUpdate(); /* Initializes GPIO */ Chip_GPIO_Init(LPC_GPIO_PORT); /* Setup GPIOs for USB demos */ Chip_SCU_PinMuxSet(0x2, 6, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC4)); /* P2_6 USB1_PWR_EN, USB1 VBus function */ Chip_SCU_PinMuxSet(0x2, 5, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2)); /* P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION */ Chip_SCU_PinMuxSet(0x1, 7, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC4)); /* P1_7 USB0_PWR_EN, USB0 VBus function Xplorer */ Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 6); /* GPIO5[6] = USB1_PWR_EN */ Chip_GPIO_SetPinState(LPC_GPIO_PORT, 5, 6, true); /* GPIO5[6] output high */ /* Initialize LEDs */ Board_LED_Init(); #if defined(USE_RMII) Chip_ENET_RMIIEnable(LPC_ETHERNET); #else Chip_ENET_MIIEnable(LPC_ETHERNET); #endif }
/* Sets up system hardware */ static void prvSetupHardware(void) { /* LED0 is used for the link status, on = PHY cable detected */ Board_Init(); Board_LED_Init(); /* Initial LED state is off to show an unconnected cable state */ Board_LED_Set(0, false); }
/* Set up and initialize all required blocks and functions related to the board hardware */ void Board_Init(void) { /* Sets up DEBUG UART */ DEBUGINIT(); /* Initialize GPIO */ Chip_GPIO_Init(LPC_GPIO); /* Initialize LEDs */ Board_LED_Init(); }
/* Set up and initialize all required blocks and functions related to the board hardware */ void Board_Init(void) { /* Sets up DEBUG UART */ DEBUGINIT(); /* Initializes GPIO */ Chip_GPIO_Init(LPC_GPIO_PORT); /* Initialize LEDs */ Board_LED_Init(); Chip_ENET_RMIIEnable(LPC_ETHERNET); }
/* Set up and initialize all required blocks and functions related to the board hardware */ void Board_Init(void) { /* Initialize the system core clock variable */ SystemCoreClockUpdate(); /* Sets up DEBUG UART */ DEBUGINIT(); /* Initialize GPIO */ Chip_GPIO_Init(LPC_GPIO_PORT); /* Initialize the LEDs */ Board_LED_Init(); }
/* Set up and initialize all required blocks and functions related to the board hardware */ void Board_Init(void) { /* INMUX and IOCON are used by many apps, enable both INMUX and IOCON clock bits here. */ Chip_Clock_EnablePeriphClock(SYSCON_CLOCK_INPUTMUX); Chip_Clock_EnablePeriphClock(SYSCON_CLOCK_IOCON); /* Sets up DEBUG UART */ DEBUGINIT(); /* Initialize GPIO */ Chip_GPIO_Init(LPC_GPIO); /* Initialize the LEDs. Be careful with below routine, once it's called some of the I/O will be set to output. */ Board_LED_Init(); }
/* Set up and initialize all required blocks and functions related to the board hardware */ void Board_Init(void) { /* Sets up DEBUG UART */ DEBUGINIT(); /* Updates SystemCoreClock global var with current clock speed */ SystemCoreClockUpdate(); /* Initializes GPIO */ Chip_GPIO_Init(LPC_GPIO); Chip_IOCON_Init(LPC_IOCON); /* Initialize LEDs */ Board_LED_Init(); }
/** * @details Initializes board peripherals */ void Init_Board(void) { // ------------------------------------------------ // Board Periph Init Board_LED_Init(); Board_LED_On(); Board_Switch_Init(); Board_Contactors_Init(); // ------------------------------------------------ // Communication Init Board_UART_Init(UART_BAUD); Board_SPI_Init(SPI_BAUD); Board_CCAN_Init(CCAN_BAUD, CAN_rx, CAN_tx, CAN_error); }
/* Set up and initialize all required blocks and functions related to the board hardware */ void Board_Init(void) { /* Sets up DEBUG UART */ DEBUGINIT(); /* Initializes GPIO */ Chip_GPIO_Init(LPC_GPIO_PORT); Board_GPIOs_Init(); /* Initialize LEDs */ Board_LED_Init(); /* Initialize uarts */ Board_UART_Init(LPC_USART0); //RS 485 Board_UART_Init(LPC_USART3); // rs232 /* Initialize buttons */ Board_Buttons_Init(); /* Initialize DAC */ Board_DAC_Init(); /* Initialize Timers */ Board_TIMER_Init(); /* Initialize ADCs */ Board_ADC_Init(); /* Initialize Keyboard disabled */ Board_KEYBOARD_disable(); /* Initilize EEPROM */ Board_EEPROM_init(); /* Initialize SPI pins */ Board_SSP_Init(); /* Initialize RTC module */ //Board_RTC_Init(); /* Initialize I2C0 module */ Board_I2C_Master_Init(); Chip_ENET_RMIIEnable(LPC_ETHERNET); }
/* Set up and initialize all required blocks and functions related to the board hardware */ void Board_Init(void) { QUICKJACK_IO_Init(); /* Initialize GPIO */ Chip_GPIO_Init(LPC_GPIO_PORT); /* Initialize the LEDs */ Board_LED_Init(); // init sensor switch SensorSwitch_Init(); /* Configure GPIO pin as input pin */ Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, 0, 0); /* MCU Tx Pin initialize */ Chip_IOCON_PinSetMode(LPC_IOCON, QUICKJACKTXPIN, PIN_MODE_INACTIVE); Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, QUICKJACKTXPINNUM); Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, QUICKJACKTXPINNUM, 1); /* MCU Rx Pin initialize */ Chip_IOCON_PinSetMode(LPC_IOCON, QUICKJACKRXPIN, PIN_MODE_INACTIVE); /* Configure analog comparator for Manchester Rx */ Chip_SWM_FixedPinEnable(SWM_FIXED_ACMP_I1, 1); Chip_ACMP_Init(LPC_CMP); Chip_ACMP_SetPosVoltRef(LPC_CMP, ACMP_POSIN_ACMP_I1); Chip_ACMP_SetNegVoltRef(LPC_CMP, ACMP_NEGIN_VLO); Chip_ACMP_SetupVoltLadder(LPC_CMP, (15<<1), false); Chip_ACMP_EnableVoltLadder(LPC_CMP); Chip_ACMP_SetHysteresis(LPC_CMP, ACMP_HYS_10MV); Chip_ACMP_SetEdgeSelection(LPC_CMP, ACMP_EDGESEL_RISING); /* Uncomment below 2 lines to connect analog comparator output to P1_0 (not needed for normal operation) */ // Chip_SWM_FixedPinEnable(SWM_FIXED_ACMP_I2, 0); // Chip_SWM_MovablePinAssign(SWM_ACMP_O_O, 1); Chip_ACMP_EdgeClear(LPC_CMP); NVIC_EnableIRQ(CMP_IRQn); /* Disable clocks to SWM and IOCON to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_IOCON); }