110 #include "mqxlite_prv.h"
128 #define AVAILABLE_EVENTS_MASK (LDD_TEventMask)(LDD_TIMERUNIT_ON_COUNTER_RESTART)
160 DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC;
168 SIM_SCGC6 |= SIM_SCGC6_PIT_MASK;
174 PIT_TFLG0 = PIT_TFLG_TIF_MASK;
176 PIT_LDVAL0 = PIT_LDVAL_TSV(0x016E35FF);
178 NVICIP48 = NVIC_IP_PRI48(0x70);
180 NVICISER1 |= NVIC_ISER_SETENA(0x00010000);
182 PIT_TCTRL0 = (PIT_TCTRL_TIE_MASK | PIT_TCTRL_TEN_MASK);
184 PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_BMTimer1_ID,DeviceDataPrv);
185 return ((LDD_TDeviceData *)DeviceDataPrv);
206 PIT_PDD_EnableDevice(PIT_BASE_PTR, PIT_PDD_CHANNEL_0, PDD_DISABLE);
210 (void)_int_install_isr(LDD_ivIndex_INT_PIT0, ((BMTimer1_TDeviceDataPtr)DeviceDataPrv)->SavedISRSettings_TUInterrupt.isrFunction, ((
BMTimer1_TDeviceDataPtr)DeviceDataPrv)->SavedISRSettings_TUInterrupt.isrData);
211 PIT_PDD_ModuleClock(PIT_BASE_PTR, PIT_PDD_CLOCK_DISABLED);
213 PE_LDD_UnregisterDeviceStructure(PE_LDD_COMPONENT_BMTimer1_ID);
240 PIT_PDD_EnableDevice(PIT_BASE_PTR, PIT_PDD_CHANNEL_0, PDD_ENABLE);
266 PIT_PDD_EnableDevice(PIT_BASE_PTR, PIT_PDD_CHANNEL_0, PDD_DISABLE);
300 PIT_PDD_WriteLoadReg(PIT_BASE_PTR, PIT_PDD_CHANNEL_0, (uint32_t)(Ticks-1));
331 *TicksPtr = (
BMTimer1_TValueType)(PIT_PDD_ReadLoadReg(PIT_BASE_PTR, PIT_PDD_CHANNEL_0) + 1U);
361 if ((PIT_PDD_GetEnableDeviceStatus(PIT_BASE_PTR, PIT_PDD_CHANNEL_0)) != 0U) {
362 PIT_PDD_EnableDevice(PIT_BASE_PTR, PIT_PDD_CHANNEL_0, PDD_DISABLE);
363 PIT_PDD_EnableDevice(PIT_BASE_PTR, PIT_PDD_CHANNEL_0, PDD_ENABLE);
408 PIT_PDD_ClearInterruptFlag(PIT_BASE_PTR, PIT_PDD_CHANNEL_0);
LDD_TUserData * UserDataPtr
LDD_TDeviceData * BMTimer1_Init(LDD_TUserData *UserDataPtr)
Initializes the device. Allocates memory for the device data structure, allocates interrupt vectors a...
LDD_TError BMTimer1_ResetCounter(LDD_TDeviceData *DeviceDataPtr)
Resets counter. If counter is counting up then it is set to zero. If counter is counting down then co...
BMTimer1_TDeviceData * BMTimer1_TDeviceDataPtr
void BMTimer1_Interrupt(LDD_RTOS_TISRParameter _isrParameter)
void BMTimer1_OnCounterRestart(LDD_TUserData *UserDataPtr)
uint32_t BMTimer1_TValueType
LDD_TError BMTimer1_Enable(LDD_TDeviceData *DeviceDataPtr)
Enables the component - it starts the signal generation. Events may be generated (see SetEventMask)...
This TimerUnit component provides a low level API for unified hardware access across various timer de...
BMTimer1_TValueType BMTimer1_GetCounterValue(LDD_TDeviceData *DeviceDataPtr)
Returns the content of counter register. This method can be used both if counter is enabled and if co...
void BMTimer1_Deinit(LDD_TDeviceData *DeviceDataPtr)
Deinitializes the device. Switches off the device, frees the device data structure memory...
LDD_RTOS_TISRVectorSettings SavedISRSettings_TUInterrupt
LDD_TError BMTimer1_GetPeriodTicks(LDD_TDeviceData *DeviceDataPtr, BMTimer1_TValueType *TicksPtr)
Returns the number of counter ticks before re-initialization. See also method [SetPeriodTicks]. This method is available only if the property ["Counter restart"] is switched to 'on-match' value.
LDD_TError BMTimer1_Disable(LDD_TDeviceData *DeviceDataPtr)
Disables the component - it stops signal generation and events calling. The method is not available i...
LDD_TError BMTimer1_SetPeriodTicks(LDD_TDeviceData *DeviceDataPtr, BMTimer1_TValueType Ticks)
The method sets timer re-initialization period (in timer ticks). This method is available only if the...