void hardware_init(void) { /* enable clock for PORTs */ CLOCK_SYS_EnablePortClock(PORTA_IDX); CLOCK_SYS_EnablePortClock(PORTB_IDX); CLOCK_SYS_EnablePortClock(PORTC_IDX); CLOCK_SYS_EnablePortClock(PORTD_IDX); CLOCK_SYS_EnablePortClock(PORTE_IDX); #if FSL_FEATURE_SIM_OPT_HAS_RTC_CLOCK_OUT_SELECTION configure_rtc_pins(0); #endif if(PMC_HAL_GetAckIsolation(PMC_BASE_PTR) != 0) { PMC_HAL_ClearAckIsolation(PMC_BASE_PTR); } /* Init board clock */ BOARD_ClockInit(); setup_uart_pins(kPortMuxAlt3); DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_LOW_POWER_UART_BAUD, kDebugConsoleUART); }
void hardware_init(void) { /* enable clock for PORTs */ CLOCK_SYS_EnablePortClock(PORTA_IDX); CLOCK_SYS_EnablePortClock(PORTC_IDX); CLOCK_SYS_EnablePortClock(PORTE_IDX); #if FSL_FEATURE_SIM_OPT_HAS_RTC_CLOCK_OUT_SELECTION configure_rtc_pins(0); #endif if(PMC_HAL_GetAckIsolation(PMC_BASE_PTR) != 0) { PMC_HAL_ClearAckIsolation(PMC_BASE_PTR); } /* Init board clock */ BOARD_ClockInit(); setup_uart_pins(kPortMuxAlt2); #if (CLOCK_INIT_CONFIG == CLOCK_VLPR) CLOCK_SYS_SetLpuartSrc(BOARD_DEBUG_UART_INSTANCE, kClockLpuartSrcMcgIrClk); #else CLOCK_SYS_SetLpuartSrc(BOARD_DEBUG_UART_INSTANCE, kClockLpuartSrcIrc48M); #endif DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_LOW_POWER_UART_BAUD, kDebugConsoleLPUART); }
void hardware_init(void) { /* enable clock for PORTs */ CLOCK_SYS_EnablePortClock(PORTA_IDX); CLOCK_SYS_EnablePortClock(PORTB_IDX); #if FSL_FEATURE_SIM_OPT_HAS_RTC_CLOCK_OUT_SELECTION configure_rtc_pins(0); #endif if(PMC_HAL_GetAckIsolation(PMC_BASE_PTR) != 0) { PMC_HAL_ClearAckIsolation(PMC_BASE_PTR); } /* Disable debug pins in release target */ #if defined (NDEBUG) setup_debug_pins(kPortPinDisabled); #endif /* Init board clock */ BOARD_ClockInit(); setup_uart_pins(kPortMuxAlt2); // Select different clock source for LPSCI. */ #if (CLOCK_INIT_CONFIG == CLOCK_VLPR) CLOCK_SYS_SetLpsciSrc(BOARD_DEBUG_UART_INSTANCE, kClockLpsciSrcMcgIrClk); #else CLOCK_SYS_SetLpsciSrc(BOARD_DEBUG_UART_INSTANCE, kClockLpsciSrcFll); #endif DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_LOW_POWER_UART_BAUD, kDebugConsoleLPSCI); }
/*! * @brief RTC init. * @param uint32_t instance : RTC instance */ void rtcInit(uint32_t instance, rtc_datetime_t *date) { #ifndef FRDM_K22F120M // Configure RTC pins configure_rtc_pins(instance); #endif // select the 1Hz for RTC_CLKOUT CLOCK_SYS_SetRtcOutSrc(kClockRtcoutSrc1Hz); RTC_DRV_Init(instance); RTC_DRV_SetDatetime(instance, date); }