/* ===================================================================*/ void ACompLdd1_Deinit(LDD_TDeviceData *DeviceDataPtr) { (void)DeviceDataPtr; /* Parameter not used, suppress not used argument warning */ CMP_PDD_EnableDevice(CMP1_BASE_PTR,PDD_DISABLE); /* Disable device */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_ACompLdd1_ID); /* Deallocation of the device structure */ /* {FreeRTOS RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ }
/* ** =================================================================== ** Method : PwmLdd1_Deinit (component PWM_LDD) ** ** Description : ** Deinitializes the device. Switches off the device, frees the ** device data structure memory, interrupts vectors, etc. ** Parameters : ** NAME - DESCRIPTION ** * DeviceDataPtr - Device data structure ** pointer returned by Init method ** Returns : Nothing ** =================================================================== */ void PwmLdd1_Deinit(LDD_TDeviceData *DeviceDataPtr) { PwmLdd1_TDeviceData *DeviceDataPrv = (PwmLdd1_TDeviceData *)DeviceDataPtr; TU1_Deinit(DeviceDataPrv->LinkedDeviceDataPtr); /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_PwmLdd1_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ }
/* ===================================================================*/ void Blue_LED_Deinit(LDD_TDeviceData *DeviceDataPtr) { (void)DeviceDataPtr; /* Parameter is not used, suppress unused argument warning */ /* GPIOD_PDDR: PDD&=~2 */ GPIOD_PDDR &= (uint32_t)~(uint32_t)(GPIO_PDDR_PDD(0x02)); /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_Blue_LED_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ }
/* ===================================================================*/ void DMAT_S_SPI_RX_Deinit(LDD_TDeviceData *DeviceDataPtr) { ((DMAT_S_SPI_RX_TDeviceData *)DeviceDataPtr)->DescriptorPtr = NULL; /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_DMAT_S_SPI_RX_ID); /* Deallocation of the Transfer descriptor structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ }
/* ** =================================================================== ** Method : WDog1_Deinit (component WatchDog_LDD) ** ** Description : ** De-initializes the device and frees the device data ** structure memory. ** Note: De-initialization on some devices is impossible. ** Method Deinit does nothing in this case. ** Parameters : ** NAME - DESCRIPTION ** * DeviceDataPtr - Device data structure ** pointer returned by Init method ** Returns : Nothing ** =================================================================== */ void WDog1_Deinit(LDD_TDeviceData *DeviceDataPtr) { WDog1_TDeviceData *DeviceDataPrv = (WDog1_TDeviceData *)DeviceDataPtr; (void)DeviceDataPrv; /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_WDog1_ID); /* Deallocation of the device structure */ /* {MQX RTOS Adapter} Driver memory deallocation: RTOS function call is defined by MQX RTOS Adapter property */ _mem_free(DeviceDataPrv); }
/* ===================================================================*/ void DMA1_Deinit(LDD_TDeviceData *DeviceDataPtr) { (void)DeviceDataPtr; /* Parameter not used, suppress not used argument warning */ /* Restoring the interrupt vectors */ /* {Default RTOS Adapter} Restore interrupt vector: IVT is static, no code is generated */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_DMA1_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ /* Disable device clock gate */ /* SIM_SCGC7: DMA=0 */ SIM_SCGC7 &= (uint32_t)~(uint32_t)(SIM_SCGC7_DMA_MASK); }
/* ** =================================================================== ** Method : PWMMotor_Deinit (component TimerUnit_LDD) ** ** Description : ** Deinitializes the device. Switches off the device, frees the ** device data structure memory, interrupts vectors, etc. ** Parameters : ** NAME - DESCRIPTION ** * DeviceDataPtr - Device data structure ** pointer returned by Init method ** Returns : Nothing ** =================================================================== */ void PWMMotor_Deinit(LDD_TDeviceData *DeviceDataPtr) { PWMMotor_TDeviceData *DeviceDataPrv = (PWMMotor_TDeviceData *)DeviceDataPtr; (void)DeviceDataPrv; FTM_PDD_SelectPrescalerSource(FTM0_BASE_PTR, FTM_PDD_DISABLED); /* Interrupt vector(s) deallocation */ /* {Default RTOS Adapter} Restore interrupt vector: IVT is static, no code is generated */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_PWMMotor_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ }
/* ===================================================================*/ void SS1_Deinit(LDD_TDeviceData *DeviceDataPtr) { (void)DeviceDataPtr; /* Parameter is not used, suppress unused argument warning */ /* SPI1_C1: SPIE=0,SPE=0,SPTIE=0,MSTR=0,CPOL=0,CPHA=1,SSOE=0,LSBFE=0 */ SPI1_C1 = SPI_C1_CPHA_MASK; /* Disable device */ /* Restoring the interrupt vector */ /* {Default RTOS Adapter} Restore interrupt vector: IVT is static, no code is generated */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_SS1_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ /* SIM_SCGC4: SPI1=0 */ SIM_SCGC4 &= (uint32_t)~(uint32_t)(SIM_SCGC4_SPI1_MASK); }
/* ===================================================================*/ void I2C2_Deinit(LDD_TDeviceData *DeviceDataPtr) { (void)DeviceDataPtr; /* Parameter is not used, suppress unused argument warning */ /* I2C0_C1: IICEN=0,IICIE=0,MST=0,TX=0,TXAK=0,RSTA=0,WUEN=0,DMAEN=0 */ I2C0_C1 = 0x00U; /* Reset I2C Control register */ /* Restoring the interrupt vector */ /* {Default RTOS Adapter} Restore interrupt vector: IVT is static, no code is generated */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_I2C2_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ /* SIM_SCGC4: I2C0=0 */ SIM_SCGC4 &= (uint32_t)~(uint32_t)(SIM_SCGC4_I2C0_MASK); }
/* ===================================================================*/ void LEDGreen_Deinit(LDD_TDeviceData *DeviceDataPtr) { (void)DeviceDataPtr; /* Parameter is not used, suppress unused argument warning */ /* PORTC_PCR10: ISF=0,IRQC=0 */ PORTC_PCR10 &= (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK | PORT_PCR_IRQC(0x0F) ); /* GPIOC_PDDR: PDD&=~0x0400 */ GPIOC_PDDR &= (uint32_t)~(uint32_t)(GPIO_PDDR_PDD(0x0400)); /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_LEDGreen_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ }
/* ===================================================================*/ void SystemTimer1_Deinit(LDD_TDeviceData *DeviceDataPtr) { SystemTimer1_TDeviceData *DeviceDataPrv = (SystemTimer1_TDeviceData *)DeviceDataPtr; (void)DeviceDataPrv; SysTick_PDD_EnableDevice(SysTick_BASE_PTR, PDD_DISABLE); /* Interrupt vector(s) deallocation */ /* {MQXLite RTOS Adapter} Restore interrupt vector (function handler and ISR parameter) */ /* Note: Exception handler for interrupt is not restored, because it was not modified */ (void)_int_install_isr(LDD_ivIndex_INT_SysTick, ((SystemTimer1_TDeviceDataPtr)DeviceDataPrv)->SavedISRSettings_TUInterrupt.isrFunction, ((SystemTimer1_TDeviceDataPtr)DeviceDataPrv)->SavedISRSettings_TUInterrupt.isrData); /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_SystemTimer1_ID); /* Deallocation of the device structure */ /* {MQXLite RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ }
/* ** =================================================================== ** Method : DrvI2c0_Deinit (component I2C_LDD) ** ** Description : ** Deinitializes the device. Switches off the device, frees the ** device data structure memory, interrupts vectors, etc. ** Parameters : ** NAME - DESCRIPTION ** * DeviceDataPtr - Device data structure ** pointer returned by <Init> method. ** Returns : Nothing ** =================================================================== */ void DrvI2c0_Deinit(LDD_TDeviceData *DeviceDataPtr) { (void)DeviceDataPtr; /* Parameter is not used, suppress unused argument warning */ /* I2C0_C1: IICEN=0,IICIE=0,MST=0,TX=0,TXAK=0,RSTA=0,WUEN=0,DMAEN=0 */ I2C0_C1 = 0x00U; /* Reset I2C Control register */ /* Restoring the interrupt vector */ /* {MQXLite RTOS Adapter} Restore interrupt vector (function handler and ISR parameter) */ /* Note: Exception handler for interrupt is not restored, because it was not modified */ (void)_int_install_isr(LDD_ivIndex_INT_I2C0, ((DrvI2c0_TDeviceDataPtr)DeviceDataPtr)->SavedISRSettings.isrFunction, ((DrvI2c0_TDeviceDataPtr)DeviceDataPtr)->SavedISRSettings.isrData); /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_DrvI2c0_ID); /* Deallocation of the device structure */ /* {MQXLite RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ /* SIM_SCGC4: I2C0=0 */ SIM_SCGC4 &= (uint32_t)~(uint32_t)(SIM_SCGC4_I2C0_MASK); }
/* ===================================================================*/ void SM1_Deinit(LDD_TDeviceData *DeviceDataPtr) { (void)DeviceDataPtr; /* Parameter is not used, suppress unused argument warning */ /* SPI1_MCR: MSTR=0,CONT_SCKE=0,DCONF=0,FRZ=0,MTFE=0,PCSSE=0,ROOE=0,??=0,??=0,PCSIS=0,DOZE=0,MDIS=1,DIS_TXF=0,DIS_RXF=0,CLR_TXF=0,CLR_RXF=0,SMPL_PT=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,HALT=1 */ SPI1_MCR = SPI_MCR_DCONF(0x00) | SPI_MCR_PCSIS(0x00) | SPI_MCR_MDIS_MASK | SPI_MCR_SMPL_PT(0x00) | SPI_MCR_HALT_MASK; /* Disable device */ /* Restoring the interrupt vector */ /* {Default RTOS Adapter} Restore interrupt vector: IVT is static, no code is generated */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_SM1_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ /* SIM_SCGC6: SPI1=0 */ SIM_SCGC6 &= (uint32_t)~(uint32_t)(SIM_SCGC6_SPI1_MASK); }
/* ===================================================================*/ void ETH1_Deinit(LDD_TDeviceData *DeviceDataPtr) { ETH1_TDeviceData *DeviceDataPrv = (ETH1_TDeviceData*)DeviceDataPtr; (void)DeviceDataPrv; /* Supress unused variable warning if needed */ /* Reset the device */ ENET_PDD_ResetDevice(ENET_BASE_PTR); while (!ENET_PDD_IsResetFinished(ENET_BASE_PTR)) {} /* Restore the interrupt vector */ /* {FreeRTOS RTOS Adapter} Restore interrupt vector: IVT is static, no code is generated */ /* {FreeRTOS RTOS Adapter} Restore interrupt vector: IVT is static, no code is generated */ /* {FreeRTOS RTOS Adapter} Restore interrupt vector: IVT is static, no code is generated */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_ETH1_ID); /* Deallocation of the internal device data structure */ /* {FreeRTOS RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ /* SIM_SCGC2: ENET=0 */ SIM_SCGC2 &= (uint32_t)~(uint32_t)(SIM_SCGC2_ENET_MASK); }
/* ===================================================================*/ LDD_TDeviceData* FC1_Init(LDD_TUserData *UserDataPtr) { /* Allocate device structure */ FC1_TDeviceData *DeviceDataPrv; /* {MQXLite RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */ DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC; DeviceDataPrv->UserDataPtr = UserDataPtr; /* Store the RTOS device structure */ DeviceDataPrv->EnUser = TRUE; /* Set the flag "device enabled" */ /* Registration of the device structure */ PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_FC1_ID,DeviceDataPrv); DeviceDataPrv->LinkedDeviceDataPtr = TU1_Init((LDD_TUserData *)NULL); if (DeviceDataPrv->LinkedDeviceDataPtr == NULL) { /* Is initialization of TimerUnit unsuccessful? */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_FC1_ID); /* Deallocation of the device structure */ /* {MQXLite RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ return NULL; /* If so, then the FreeCntr initialization is also unsuccessful */ } return ((LDD_TDeviceData *)DeviceDataPrv); /* Return pointer to the device data structure */ }
/* ===================================================================*/ LDD_TDeviceData* TimerIntLdd3_Init(LDD_TUserData *UserDataPtr) { /* Allocate device structure */ TimerIntLdd3_TDeviceData *DeviceDataPrv; /* {Default RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */ DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC; DeviceDataPrv->UserDataPtr = UserDataPtr; /* Store the RTOS device structure */ DeviceDataPrv->EnUser = TRUE; /* Set the flag "device enabled" */ /* Registration of the device structure */ PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_TimerIntLdd3_ID,DeviceDataPrv); DeviceDataPrv->LinkedDeviceDataPtr = TU3_Init((LDD_TUserData *)NULL); if (DeviceDataPrv->LinkedDeviceDataPtr == NULL) { /* Is initialization of TimerUnit unsuccessful? */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_TimerIntLdd3_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ return NULL; /* If so, then the TimerInt initialization is also unsuccessful */ } TimerIntLdd3_SetClockConfiguration(DeviceDataPrv, Cpu_GetClockConfiguration()); /* Set Initial according clock configuration */ return ((LDD_TDeviceData *)DeviceDataPrv); /* Return pointer to the device data structure */ }
/* ===================================================================*/ LDD_TDeviceData* TimerIntLdd1_Init(LDD_TUserData *UserDataPtr) { /* Allocate device structure */ TimerIntLdd1_TDeviceData *DeviceDataPrv; /* {Default RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */ DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC; DeviceDataPrv->UserDataPtr = UserDataPtr; /* Store the RTOS device structure */ DeviceDataPrv->EnEvents = 0x01u; /* Initial event mask */ DeviceDataPrv->EnUser = TRUE; /* Set the flag "device enabled" */ DeviceDataPrv->CmpVal = 0xBB80U; /* Initial value periodically addded to compare register */ /* Registration of the device structure */ PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_TimerIntLdd1_ID,DeviceDataPrv); DeviceDataPrv->LinkedDeviceDataPtr = TU1_Init((LDD_TUserData *)NULL); if (DeviceDataPrv->LinkedDeviceDataPtr == NULL) { /* Is initialization of TimerUnit unsuccessful? */ /* Unregistration of the device structure */ PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_TimerIntLdd1_ID); /* Deallocation of the device structure */ /* {Default RTOS Adapter} Driver memory deallocation: Dynamic allocation is simulated, no deallocation code is generated */ return NULL; /* If so, then the TimerInt initialization is also unsuccessful */ } (void)TU1_SetEventMask(DeviceDataPrv->LinkedDeviceDataPtr, TU1_GetEventMask(DeviceDataPrv->LinkedDeviceDataPtr) | LDD_TIMERUNIT_ON_CHANNEL_0); /* Enable TimerUnit event */ return ((LDD_TDeviceData *)DeviceDataPrv); /* Return pointer to the device data structure */ }