/*********************************************************************************************************************** * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. **********************************************************************************************************************/ /* clang-format off */ /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* !!GlobalInfo product: Peripherals v11.0 processor: LPC54102J512 package_id: LPC54102J512BD64 mcu_data: ksdk2_0 processor_version: 12.0.0 functionalGroups: - name: BOARD_InitPeripherals UUID: bf976c30-387a-4c02-956c-44a37954526e called_from_default_init: true selectedCore: cm4 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* component: - type: 'system' - type_id: 'system_54b53072540eeeb8f8e9343e71f28176' - global_system_definitions: - user_definitions: '' - user_includes: '' * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* component: - type: 'gpio_adapter_common' - type_id: 'gpio_adapter_common_57579b9ac814fe26bf95df0a384c36b6' - global_gpio_adapter_common: - quick_selection: 'default' * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* component: - type: 'uart_cmsis_common' - type_id: 'uart_cmsis_common_9cb8e302497aa696fdbb5a4fd622c2a8' - global_USART_CMSIS_common: - quick_selection: 'default' * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /* clang-format on */ /*********************************************************************************************************************** * Included files **********************************************************************************************************************/ #include "peripherals.h" /*********************************************************************************************************************** * BOARD_InitPeripherals functional group **********************************************************************************************************************/ /*********************************************************************************************************************** * NVIC initialization code **********************************************************************************************************************/ /* clang-format off */ /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* instance: - name: 'NVIC' - type: 'nvic' - mode: 'general' - custom_name_enabled: 'false' - type_id: 'nvic_57b5eef3774cc60acaede6f5b8bddc67' - functional_group: 'BOARD_InitPeripherals' - peripheral: 'NVIC' - config_sets: - nvic: - interrupt_table: - 0: [] - interrupts: [] * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /* clang-format on */ /* Empty initialization function (commented out) static void NVIC_init(void) { } */ /*********************************************************************************************************************** * I2C0 initialization code **********************************************************************************************************************/ /* clang-format off */ /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* instance: - name: 'I2C0' - type: 'lpc_i2c' - mode: 'I2C_Polling' - custom_name_enabled: 'false' - type_id: 'lpc_i2c_f5051a0134792729f1007113ec6ddccd' - functional_group: 'BOARD_InitPeripherals' - peripheral: 'I2C0' - config_sets: - fsl_i2c: - i2c_mode: 'kI2C_Master' - clockSource: 'FunctionClock' - clockSourceFreq: 'BOARD_BootClockPLL150M' - i2c_master_config: - enableMaster: 'true' - baudRate_Bps: '100000' - enableTimeout: 'false' * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /* clang-format on */ const i2c_master_config_t I2C0_config = { .enableMaster = true, .baudRate_Bps = 100000UL, .enableTimeout = false }; static void I2C0_init(void) { /* Initialization function */ I2C_MasterInit(I2C0_PERIPHERAL, &I2C0_config, I2C0_CLOCK_SOURCE); } /*********************************************************************************************************************** * PINT initialization code **********************************************************************************************************************/ /* clang-format off */ /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* instance: - name: 'PINT' - type: 'pint' - mode: 'interrupt_mode' - custom_name_enabled: 'false' - type_id: 'pint_cf4a806bb2a6c1ffced58ae2ed7b43af' - functional_group: 'BOARD_InitPeripherals' - peripheral: 'PINT' - config_sets: - general: - interrupt_array: - 0: - interrupt_id: 'INT_0' - interrupt_selection: 'PINT.0' - interrupt_type: 'kPINT_PinIntEnableFallEdge' - callback_function: 'bmm_drdy_callback' - enable_callback: 'true' - interrupt: - IRQn: 'PIN_INT0_IRQn' - enable_priority: 'true' - priority: '4' * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /* clang-format on */ static void PINT_init(void) { /* PINT initiation */ PINT_Init(PINT_PERIPHERAL); /* Interrupt vector PIN_INT0_IRQn priority settings in the NVIC. */ NVIC_SetPriority(PINT_PINT_0_IRQN, PINT_PINT_0_IRQ_PRIORITY); /* PINT PINT.0 configuration */ PINT_PinInterruptConfig(PINT_PERIPHERAL, PINT_INT_0, kPINT_PinIntEnableFallEdge, bmm_drdy_callback); /* Enable PINT PINT.0 callback */ PINT_EnableCallbackByIndex(PINT_PERIPHERAL, kPINT_PinInt0); } /*********************************************************************************************************************** * Initialization functions **********************************************************************************************************************/ void BOARD_InitPeripherals(void) { /* Initialize components */ I2C0_init(); PINT_init(); } /*********************************************************************************************************************** * BOARD_InitBootPeripherals function **********************************************************************************************************************/ void BOARD_InitBootPeripherals(void) { BOARD_InitPeripherals(); }