void IrTherm_Init(void){ /* Enable clocks to SWM and IOCON to save power */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON); Chip_SWM_MovablePinAssign(SWM_I2C_SDA_IO, 11); Chip_SWM_MovablePinAssign(SWM_I2C_SCL_IO, 10); #if (I2C_BITRATE > 400000) /* Enable Fast Mode Plus for I2C pins */ Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO10, PIN_I2CMODE_FASTPLUS); Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO11, PIN_I2CMODE_FASTPLUS); #else Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO10, PIN_I2CMODE_STDFAST); Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO11, PIN_I2CMODE_STDFAST); #endif /* Enable I2C clock and reset I2C peripheral - the boot ROM does not do this */ Chip_I2C_Init(); /* Setup the I2C handle */ i2cHandleMaster = LPC_I2CD_API->i2c_setup(LPC_I2C_BASE, i2cMasterHandleMEM); /* Set I2C bitrate */ LPC_I2CD_API->i2c_set_bitrate(i2cHandleMaster, Chip_Clock_GetSystemClockRate(), I2C_BITRATE); /* Disable the interrupt for the I2C */ NVIC_DisableIRQ(I2C_IRQn); /* Disable clocks to SWM and IOCON to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_IOCON); }
/* De-Initialize GPIO block */ void Chip_GPIO_DeInit(LPC_GPIO_T *pGPIO) { Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_GPIO0); Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_GPIO1); Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_GPIO2); Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_MUX); }
/* Initializes pin muxing for SPI1 interface - note that SystemInit() may already setup your pin muxing at system startup */ static void Init_SPI_PinMux(void) { #if (defined(BOARD_NXP_LPCXPRESSO_812) || defined(BOARD_LPC812MAX)) /* Enable the clock to the Switch Matrix */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); /* * Initialize SSP0 pins connect * SCK1: PINASSIGN4[31:24]: Select P0.12 * MOSI1: PINASSIGN5[7:0]: Select P0.14 * MISO1: PINASSIGN5[15:8] : Select P0.6 * SSEL1: PINASSIGN5[23:16]: Select P0.13 */ Chip_SWM_DisableFixedPin(SWM_FIXED_VDDCMP); Chip_SWM_MovablePinAssign(SWM_SPI0_SCK_IO, 12); Chip_SWM_MovablePinAssign(SWM_SPI1_SCK_IO, 7); Chip_SWM_MovablePinAssign(SWM_SPI0_MOSI_IO, 14); Chip_SWM_MovablePinAssign(SWM_SPI1_MOSI_IO, 9); #if defined(BOARD_LPC812MAX) Chip_SWM_MovablePinAssign(SWM_SPI0_MISO_IO, 15); Chip_SWM_MovablePinAssign(SWM_SPI1_MISO_IO, 0); #else Chip_SWM_MovablePinAssign(SWM_SPI0_MISO_IO, 6); Chip_SWM_MovablePinAssign(SWM_SPI1_MISO_IO, 1); #endif Chip_SWM_DisableFixedPin(SWM_FIXED_ACMP_I1); Chip_SWM_MovablePinAssign(SWM_SPI0_SSEL_IO, 13); Chip_SWM_MovablePinAssign(SWM_SPI1_SSEL_IO, 10); /* Disable the clock to the Switch Matrix to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); #elif defined(BOARD_NXP_LPCXPRESSO_824) /* Enable the clock to the Switch Matrix */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); /* Master Pins for SPI0 */ Chip_SWM_MovablePinAssign(SWM_SPI0_SSEL0_IO, 15); Chip_SWM_MovablePinAssign(SWM_SPI0_SCK_IO, 24); Chip_SWM_MovablePinAssign(SWM_SPI0_MISO_IO, 25); Chip_SWM_MovablePinAssign(SWM_SPI0_MOSI_IO, 26); /* Slave Pins for SPI1 */ Chip_SWM_MovablePinAssign(SWM_SPI1_SSEL0_IO, 17); Chip_SWM_MovablePinAssign(SWM_SPI1_SCK_IO, 18); Chip_SWM_MovablePinAssign(SWM_SPI1_MISO_IO, 28); Chip_SWM_MovablePinAssign(SWM_SPI1_MOSI_IO, 16); /* Disable the clock to the Switch Matrix to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); #else /* Configure your own SPI pin muxing here if needed */ #warning "No SPI pin muxing defined" #endif }
void Earphone_Init(void) { Chip_IOCON_PinSetMode(LPC_IOCON, IOCON_PIO14, PIN_MODE_INACTIVE); Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, 0, 14); 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); Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_IOCON); }
/* Shutdown ADC */ void Chip_ADC_DeInit(LPC_ADC_T *pADC) { pADC->INTEN = 0; pADC->CTRL = 0; /* Stop ADC clock and then power down ADC */ if (pADC == LPC_ADC0) { Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_ADC0); Chip_SYSCTL_PowerDown(SYSCTL_POWERDOWN_ADC0_PD); } else { Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_ADC1); Chip_SYSCTL_PowerDown(SYSCTL_POWERDOWN_ADC1_PD); } }
/* Shutdown the SDC card controller */ void Chip_SDC_DeInit(LPC_SDC_T *pSDC) { /* Power-off */ Chip_SDC_PowerControl(pSDC, SDC_POWER_OFF, 0); Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SDC); }
/* De-initializes the I2C peripheral registers to their default reset values */ void Chip_I2C_DeInit(I2C_ID_T id) { IP_I2C_DeInit(i2c[id].ip); /* Disable I2C clocking */ Chip_Clock_DisablePeriphClock(i2c[id].clk); }
/* Shuts down the I2C controller block */ void Chip_I2C_DeInit(LPC_I2C_T *pI2C) { int clkIndex = returnClkIdx(pI2C); /* Disable clock to I2C peripheral */ Chip_Clock_DisablePeriphClock((CHIP_SYSCON_CLOCK_T) ClockIdx[clkIndex]); }
/* Board Debug UART Initialisation function */ STATIC void Board_UART_Init(void) { /* Enable the clock to the Switch Matrix */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); /* Connect the U0_TXD_O and U0_RXD_I signals to port pins(P0.07, P0.18) */ Chip_SWM_DisableFixedPin(SWM_FIXED_ADC0); Chip_SWM_DisableFixedPin(SWM_FIXED_ADC8); /* Enable UART Divider clock, divided by 1 */ Chip_Clock_SetUARTClockDiv(1); /* Divided by 1 */ if (DEBUG_UART == LPC_USART0) { Chip_SWM_MovablePinAssign(SWM_U0_TXD_O, 7); Chip_SWM_MovablePinAssign(SWM_U0_RXD_I, 18); } else if (DEBUG_UART == LPC_USART1) { Chip_SWM_MovablePinAssign(SWM_U1_TXD_O, 7); Chip_SWM_MovablePinAssign(SWM_U1_RXD_I, 18); } else { Chip_SWM_MovablePinAssign(SWM_U2_TXD_O, 7); Chip_SWM_MovablePinAssign(SWM_U2_RXD_I, 18); } /* Disable the clock to the Switch Matrix to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); }
/* Shutdown ADC */ void Chip_ADC_DeInit(LPC_ADC_T *pADC) { pADC->INTEN = 0x00000100; pADC->CR = 0; Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_ADC); Chip_SYSCTL_PowerDown(SYSCTL_POWERDOWN_ADC_PD); }
/* Initializes pin muxing for SPI interface - note that SystemInit() may already setup your pin muxing at system startup */ static void Init_SPI_PinMux(void) { #if (defined(BOARD_NXP_LPCXPRESSO_1549)) /* Enable the clock to the Switch Matrix */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); /* * Initialize SPI0 pins connect * SCK0: PINASSIGN3[15:8]: Select P0.0 * MOSI0: PINASSIGN3[23:16]: Select P0.16 * MISO0: PINASSIGN3[31:24] : Select P0.10 * SSEL0: PINASSIGN4[7:0]: Select P0.9 */ Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 0, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)); Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 16, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)); Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 10, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)); Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 9, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)); Chip_SWM_MovablePinAssign(SWM_SPI0_SCK_IO, 0); /* P0.0 */ Chip_SWM_MovablePinAssign(SWM_SPI0_MOSI_IO, 16);/* P0.16 */ Chip_SWM_MovablePinAssign(SWM_SPI0_MISO_IO, 10);/* P0.10 */ Chip_SWM_MovablePinAssign(SWM_SPI0_SSELSN_0_IO, 9); /* P0.9 */ /* Disable the clock to the Switch Matrix to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); #else /* Configure your own SPI pin muxing here if needed */ #warning "No SPI pin muxing defined" #endif }
/* UART clock disable */ static void Chip_UARTN_DisableClock(LPC_USARTN_T *pUART) { CHIP_SYSCTL_CLOCK_T clk = getUARTClockID(pUART); /* Special handling for shared UART 3/4 clock */ if (clk != SYSCTL_CLOCK_USART3_4) { Chip_Clock_DisablePeriphClock(clk); } else { /* Does not handle unbalanced Init() and DeInit() calls */ uart_3_4_cnt--; if (uart_3_4_cnt == 0) { Chip_Clock_DisablePeriphClock(clk); } } }
static void pwm_2_init(void) { uint8_t i = 0; /* Setup Board specific output pin */ /* Enable SWM clock before altering SWM */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); /* Connect SCT outputs. */ for(i = 2; i < 4; i++) { Chip_SWM_MovablePortPinAssign(pwm_config[i].pin_mov, pwm_config[i].port, pwm_config[i].pin); } /* Disable SWM clock after altering SWM */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); Chip_SCTPWM_Init(LPC_SCT2); Chip_SCTPWM_SetRate(LPC_SCT2, PWM_2_RATE); for(i = 2; i < 4; i++) { /* Use SCT2_OUTx pin. */ Chip_SCTPWM_SetOutPin(pwm_config[i].sct, pwm_config[i].index, i - 2); /* Start with 0% duty cycle */ Chip_SCTPWM_SetDutyCycle(pwm_config[i].sct, pwm_config[i].index, 0); } Chip_SCTPWM_Start(LPC_SCT2); return; }
/* Shutdown SCT */ void Chip_SCT_DeInit(LPC_SCT_T *pSCT) { sctUsedCount--; if (sctUsedCount == 0) { /* Does not handle unbalanced Init() and DeInit() calls */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SCT0_1); } }
/* De-initializes the pUART peripheral */ void Chip_UART_DeInit(LPC_USART_T *pUART) { IP_UART_ID_T UARTPort = Chip_UART_Get_UARTNum(pUART); IP_UART_DeInit(pUART, UARTPort); /* Disable UART clocking */ Chip_Clock_DisablePeriphClock(Chip_UART_DetermineClk(pUART)); }
/* Shutdown ADC */ void Chip_ADC_DeInit(LPC_ADC_T *pADC) { pADC->INTEN = 0; pADC->CTRL = 0; /* Stop ADC clock and then power down ADC */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_ADC); Chip_SYSCTL_PowerDown(SYSCTL_SLPWAKE_ADC_PD); }
/* De-initializes the ACMP */ void Chip_ACMP_Deinit(LPC_CMP_T *pACMP) { IP_ACMP_Deinit(pACMP); /* Disable the clock to the register interface */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_ACOMP); /* Enable the power to the analog comparator */ Chip_SYSCTL_PowerDown(SYSCTL_SLPWAKE_ACMP_PD); }
/* 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); }
/* De-initializes the ACMP */ void Chip_ACMP_Deinit(LPC_CMP_T *pACMP) { IP_ACMP_Deinit(pACMP); /* Disable ACMP clock */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_ACOMP); /* Enable the power to the analog comparator */ Chip_SYSCTL_PowerDown(SYSCTL_POWERDOWN_ACOMP_PD); }
/* Initializes pin muxing for I2C interface - note that SystemInit() may already setup your pin muxing at system startup */ static void Init_I2C_PinMux(void) { /* Enable the clock to the Switch Matrix */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); /* Connect the I2C_SDA and I2C_SCL signals to port pins(P0.10, P0.11) */ Chip_SWM_MovablePinAssign(SWM_I2C_SDA_IO, 10); Chip_SWM_MovablePinAssign(SWM_I2C_SCL_IO, 11); /* Disable the clock to the Switch Matrix to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); }
/** * Configure the pinmuxing for the MultiSensor board. * * only the special functions are set here, default the pins are gpio. */ void PINMUX_Init() { /* Enable the clock to the Switch Matrix */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); /* DISconnect the XTALIN and XTALOUT signals to port pins(P0.8, P0.9), as these will be used for gpio purposes */ /* these are fixed location pins */ Chip_SWM_FixedPinEnable(SWM_FIXED_XTALIN, false); Chip_SWM_FixedPinEnable(SWM_FIXED_XTALOUT, false); /* connect the fixed reset_n pin to P0.5 */ Chip_SWM_EnableFixedPin(SWM_FIXED_RST); /* Connect the I2C_SDA0 and I2C_SCL0 signals to port pins(P0.10, P0.11) */ /* these are fixed location pins */ Chip_SWM_EnableFixedPin(SWM_FIXED_I2C0_SDA); Chip_SWM_EnableFixedPin(SWM_FIXED_I2C0_SCL); /* Connect the ADC0 (P0.7) and ADC1 (P0.6) */ /* these are fixed location pins */ Chip_SWM_EnableFixedPin(SWM_FIXED_ADC0); Chip_SWM_EnableFixedPin(SWM_FIXED_ADC1); /* Connect the USART0 TX & RX signals to port pins(P0.16, P0.26) */ /* these are movable location pins */ Chip_SWM_MovablePinAssign(SWM_U0_TXD_O, 16); Chip_SWM_MovablePinAssign(SWM_U0_RXD_I, 26); /* Connect the USART1 RX signal to port pins(P0.25) */ /* these are movable location pins */ Chip_SWM_MovablePinAssign(SWM_U1_RXD_I, 25); /* Connect the SCT OUTPUT 1,2,3 (PWM : RGB) signal to port pin(P0.1, P0.9, P0.8) --> this is the RGB led*/ /* these are movable location pins */ Chip_SWM_MovablePinAssign(SWM_SCT_OUT1_O, 1); Chip_SWM_MovablePinAssign(SWM_SCT_OUT2_O, 9); Chip_SWM_MovablePinAssign(SWM_SCT_OUT3_O, 8); /* make sure to disable fixed pin functionality for HUMIDITY dht22 data pin */ Chip_SWM_DisableFixedPin(SWM_FIXED_ADC10); //Chip_SWM_MovablePinAssign(SWM_SCT_IN1_I, 13); /* Disable the clock to the Switch Matrix to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); }
/* Initialize FlexCOMM to a given peripheral */ void Chip_FLEXCOMM_DeInit(LPC_FLEXCOMM_T *pFCOMM) { int idx = Chip_FLEXCOMM_GetIndex(pFCOMM); if (idx < 0) return ; /* Disable source clock to this flexcomm */ Chip_Clock_SetFLEXCOMMClockSource(idx, SYSCON_FLEXCOMMCLKSELSRC_NONE); /* Disable wakeup from this FlexCOMM */ Chip_SYSCON_DisableWakeup((CHIP_SYSCON_WAKEUP_T) (SYSCON_STARTER_FLEXCOMM0 + idx)); if (Chip_FLEXCOMM_IsLocked(pFCOMM)) { /* Reset FlexCOMM */ Chip_SYSCON_PeriphReset((CHIP_SYSCON_PERIPH_RESET_T) (RESET_FLEXCOMM0 + idx)); } Chip_FLEXCOMM_SetPeriph(pFCOMM, FLEXCOMM_PERIPH_NONE, 0); Chip_Clock_DisablePeriphClock((CHIP_SYSCON_CLOCK_T) (SYSCON_CLOCK_FLEXCOMM0 + idx)); }
/* Setup board specific pin muxing */ static void app_setup_pin(void) { /* Enable SWM clock before altering SWM */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); #if (defined(BOARD_NXP_LPCXPRESSO_812) || defined(BOARD_LPC812MAX)) /* Connect SCT output 0 to LED pin PIO7, SCT output 1 to PIO17 */ Chip_SWM_MovablePinAssign(SWM_CTOUT_1_O, 6); Chip_SWM_MovablePinAssign(SWM_CTOUT_0_O, 7); #elif defined(BOARD_NXP_LPCXPRESSO_824) /* Connect SCT output 0 to LED pin PIO7, SCT output 1 to PIO17 */ Chip_SWM_MovablePinAssign(SWM_SCT_OUT1_O, 12); Chip_SWM_MovablePinAssign(SWM_SCT_OUT0_O, 16); #else /* Configure your own SCT pin muxing here if needed */ #warning "No SCT pin muxing defined" #endif Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); }
/* Initializes pin muxing for I2C interface - note that SystemInit() may already setup your pin muxing at system startup */ static void Init_I2C_PinMux(void) { #if (defined(BOARD_NXP_XPRESSO_812) || defined(BOARD_LPC812MAX)) /* Enable the clock to the Switch Matrix */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); /* Connect the I2C_SDA and I2C_SCL signals to port pins(P0.10, P0.11) */ Chip_SWM_MovablePinAssign(SWM_I2C_SDA_IO, 10); Chip_SWM_MovablePinAssign(SWM_I2C_SCL_IO, 11); /* Enable Fast Mode Plus for I2C pins */ Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO10, PIN_I2CMODE_FASTPLUS); Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO11, PIN_I2CMODE_FASTPLUS); /* Disable the clock to the Switch Matrix to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); #else /* Configure your own I2C pin muxing here if needed */ #warning "No I2C pin muxing defined" #endif }
/* Initialize pin muxing for SPI interface */ void Board_SPI_Init(LPC_SPI_T *pSPI) { /* Enable the clock to the Switch Matrix */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM); if (pSPI == LPC_SPI0) { /* * Initialize SSP0 pins connect * SCK0: PINASSIGN3[31:24] : Select P0.12 * MOSI: PINASSIGN4[7:0] : Select P0.14 * MISO0: PINASSIGN4[15:8]: Select P0.6 * SSEL0: PINASSIGN4[23:16] : Select P0.13 */ Chip_SWM_FixedPinEnable(VDDCMP, DISABLE); Chip_SWM_MovablePinAssign(SWM_SPI0_SCK_IO, PIO12); Chip_SWM_MovablePinAssign(SWM_SPI0_MOSI_IO, PIO14); Chip_SWM_MovablePinAssign(SWM_SPI0_MISO_IO, PIO6); Chip_SWM_MovablePinAssign(SWM_SPI0_SSEL_IO, PIO13); } else { /* * Initialize SSP0 pins connect * SCK1: PINASSIGN4[31:24]: Select P0.12 * MOSI1: PINASSIGN5[7:0]: Select P0.14 * MISO1: PINASSIGN5[15:8] : Select P0.6 * SSEL1: PINASSIGN5[23:16]: Select P0.13 */ Chip_SWM_FixedPinEnable(VDDCMP, DISABLE); Chip_SWM_MovablePinAssign(SWM_SPI1_SCK_IO, PIO12); Chip_SWM_MovablePinAssign(SWM_SPI1_MOSI_IO, PIO14); Chip_SWM_MovablePinAssign(SWM_SPI1_MISO_IO, PIO6); Chip_SWM_MovablePinAssign(SWM_SPI1_SSEL_IO, PIO13); } /* Disable the clock to the Switch Matrix to save power */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM); }
/* De-initializes the pUART peripheral */ void Chip_UART_DeInit(LPC_USART_T *pUART) { Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_UART0); }
/* Shutdown a timer */ void Chip_TIMER_DeInit(LPC_TIMER_T *pTMR) { /* Disable timer clock */ Chip_Clock_DisablePeriphClock(Chip_Timer_GetClock(pTMR)); }
/* Shutdown SCT */ void Chip_SCT_DeInit(LPC_SCT_T *pSCT) { Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SCT); }
/* Shutdown I2C Interface */ void Chip_I2C_DeInit(void) { /* Disable I2C clock */ Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_I2C); }
/* Shutdown ADC */ void Chip_ADC_DeInit(LPC_ADC_T *pADC) { IP_ADC_DeInit(pADC); Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_ADC); }