MKM34Z256VLx7 Bare Metal Software Drivers  R4.1.6
Reference Manual
PIT Example

This example shows typical use of the Periodic Interrupt Timer (PIT) module.

Source code:
/******************************************************************************
* (c) Copyright 2010-2015, Freescale Semiconductor Inc.
* ALL RIGHTS RESERVED.
******************************************************************************
* pit_test.c
******************************************************************************/
#include "drivers.h"
/* PIT callback declarations */
void pit_callback (PIT_CALLBACK_TYPE type);
void main(void)
{
PIT_InstallCallback (PRI_LVL0,pit_callback);
PIT_Init (PIT0, CH0, PIT_CH_TMR_EN_CONFIG, 1000000);
while(1);
}
/* PIT callback definition */
void pit_callback (PIT_CALLBACK_TYPE type)
{
if (type == PIT0CH0_CALLBACK) { GPIO_Tgl (GPIOJ, PIN3); }
}
/***************************************************************************
* END OF MODULE
****************************************************************************/
Toolchain support:
IAR EWARM 7.40.7KEIL uVision 5.15CrossWorks 3.6ATOLLIC TrueStudio 5.3.0Kinetis Design Studio 3.0.0