Kinetis SDK v.2.0 API Reference Manual Freescale Semiconductor, Inc. Document Number: KSDK20APIRM Rev. 0 Jan 2016
Kinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor, Inc.
Document Number: KSDK20APIRMRev. 0
Jan 2016
ContentsChapter Introduction
Chapter Driver errors status
Chapter Architectural Overview
Chapter Trademarks
Chapter ADC16: 16-bit SAR Analog-to-Digital Converter Driver
5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115.2.1 Polling Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115.2.2 Interrupt Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.3 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145.3.1 struct adc16_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145.3.2 struct adc16_hardware_compare_config_t . . . . . . . . . . . . . . . . . . . . . 155.3.3 struct adc16_channel_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.4 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 165.4.1 FSL_ADC16_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.5 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 165.5.1 _adc16_channel_status_flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165.5.2 _adc16_status_flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165.5.3 adc16_clock_divider_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165.5.4 adc16_resolution_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.5.5 adc16_clock_source_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.5.6 adc16_long_sample_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.5.7 adc16_reference_voltage_source_t . . . . . . . . . . . . . . . . . . . . . . . . . 175.5.8 adc16_hardware_compare_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.6 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185.6.1 ADC16_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185.6.2 ADC16_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185.6.3 ADC16_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
iii
SectionNumber
ContentsTitle
PageNumber
5.6.4 ADC16_EnableHardwareTrigger . . . . . . . . . . . . . . . . . . . . . . . . . . 195.6.5 ADC16_SetHardwareCompareConfig . . . . . . . . . . . . . . . . . . . . . . . . 195.6.6 ADC16_GetStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195.6.7 ADC16_ClearStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195.6.8 ADC16_SetChannelConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205.6.9 ADC16_GetChannelConversionValue . . . . . . . . . . . . . . . . . . . . . . . . 205.6.10 ADC16_GetChannelStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Chapter Clock Driver
6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.2 Get frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.3 External clock frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.4 Multipurpose Clock Generator Lite (MCGLITE) . . . . . . . . . . . . . . . . . 246.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246.4.2 Function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246.4.3 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296.4.4 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 316.4.5 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 356.4.6 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376.4.7 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Chapter CMP: Analog Comparator Driver
7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477.2.1 Polling Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477.2.2 Interrupt Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.3 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507.3.1 struct cmp_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507.3.2 struct cmp_filter_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517.3.3 struct cmp_dac_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.4 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 527.4.1 FSL_CMP_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7.5 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 527.5.1 _cmp_interrupt_enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527.5.2 _cmp_status_flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527.5.3 cmp_hysteresis_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527.5.4 cmp_reference_voltage_source_t . . . . . . . . . . . . . . . . . . . . . . . . . . 52
ivKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
7.6 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537.6.1 CMP_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537.6.2 CMP_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537.6.3 CMP_Enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537.6.4 CMP_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547.6.5 CMP_SetInputChannels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547.6.6 CMP_SetFilterConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547.6.7 CMP_SetDACConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557.6.8 CMP_EnableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557.6.9 CMP_DisableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557.6.10 CMP_GetStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557.6.11 CMP_ClearStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Chapter CMT: Carrier Modulator Transmitter Driver
8.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
8.2 Clock formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
8.3 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
8.4 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608.4.1 struct cmt_modulate_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608.4.2 struct cmt_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8.5 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 618.5.1 FSL_CMT_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 618.6.1 cmt_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618.6.2 cmt_primary_clkdiv_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628.6.3 cmt_second_clkdiv_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628.6.4 cmt_infrared_output_polarity_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 638.6.5 cmt_infrared_output_state_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638.6.6 _cmt_interrupt_enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638.7.1 CMT_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638.7.2 CMT_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638.7.3 CMT_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648.7.4 CMT_SetMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648.7.5 CMT_GetMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648.7.6 CMT_GetCMTFrequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658.7.7 CMT_SetCarrirGenerateCountOne . . . . . . . . . . . . . . . . . . . . . . . . . 668.7.8 CMT_SetCarrirGenerateCountTwo . . . . . . . . . . . . . . . . . . . . . . . . . 668.7.9 CMT_SetModulateMarkSpace . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
v
SectionNumber
ContentsTitle
PageNumber
8.7.10 CMT_EnableExtendedSpace . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678.7.11 CMT_SetIroState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688.7.12 CMT_EnableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698.7.13 CMT_DisableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698.7.14 CMT_GetStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Chapter COP: Watchdog Driver
9.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
9.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729.2.1 struct cop_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
9.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 729.3.1 FSL_COP_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 72
9.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 729.4.1 cop_clock_source_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729.4.2 cop_timeout_cycles_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
9.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739.5.1 COP_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739.5.2 COP_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739.5.3 COP_Disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739.5.4 COP_Refresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Chapter CRC: Cyclic Redundancy Check Driver
10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.2 CRC Driver Initialization and Configuration . . . . . . . . . . . . . . . . . . . . 75
10.3 CRC Write Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.4 CRC Get Checksum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.5 Comments about API usage in RTOS . . . . . . . . . . . . . . . . . . . . . . . . 76
10.6 Comments about API usage in interrupt handler . . . . . . . . . . . . . . . . . . 76
10.7 CRC Driver Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
10.8 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8010.8.1 struct crc_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.9 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 8010.9.1 FSL_CRC_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 80
viKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
10.9.2 CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT . . . . . . . . . . 81
10.10 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 8110.10.1 crc_bits_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8110.10.2 crc_result_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.11 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8110.11.1 CRC_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8110.11.2 CRC_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8110.11.3 CRC_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8210.11.4 CRC_WriteData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8210.11.5 CRC_Get32bitResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8210.11.6 CRC_Get16bitResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Chapter DAC: Digital-to-Analog Converter Driver
11.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8811.2.1 struct dac_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8811.2.2 struct dac_buffer_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.3.1 FSL_DAC_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 89
11.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.4.1 _dac_buffer_status_flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.4.2 _dac_buffer_interrupt_enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.4.3 dac_reference_voltage_source_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.4.4 dac_buffer_trigger_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.4.5 dac_buffer_work_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
11.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9011.5.1 DAC_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9011.5.2 DAC_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9011.5.3 DAC_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9011.5.4 DAC_Enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9111.5.5 DAC_EnableBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9111.5.6 DAC_SetBufferConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9111.5.7 DAC_GetDefaultBufferConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . 9111.5.8 DAC_EnableBufferDMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9211.5.9 DAC_SetBufferValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9211.5.10 DAC_DoSoftwareTriggerBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . 9211.5.11 DAC_GetBufferReadPointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9211.5.12 DAC_SetBufferReadPointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9311.5.13 DAC_EnableBufferInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
vii
SectionNumber
ContentsTitle
PageNumber
11.5.14 DAC_DisableBufferInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9311.5.15 DAC_GetBufferStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9311.5.16 DAC_ClearBufferStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Chapter Debug Console
12.1 Function groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9512.1.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9512.1.2 Advanced Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
12.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Chapter DMA: Direct Memory Access Controller Driver
13.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
13.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10113.2.1 DMA Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
13.3 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10413.3.1 struct dma_transfer_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10413.3.2 struct dma_channel_link_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . 10513.3.3 struct dma_handle_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
13.4 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 10613.4.1 FSL_DMA_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 106
13.5 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10613.5.1 dma_callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
13.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 10613.6.1 _dma_channel_status_flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10613.6.2 dma_transfer_size_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10613.6.3 dma_modulo_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10713.6.4 dma_channel_link_type_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10713.6.5 dma_transfer_type_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10713.6.6 dma_transfer_options_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
13.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10813.7.1 DMA_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10813.7.2 DMA_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10813.7.3 DMA_ResetChannel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10813.7.4 DMA_SetTransferConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10813.7.5 DMA_SetChannelLinkConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10913.7.6 DMA_SetSourceAddress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10913.7.7 DMA_SetDestinationAddress . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
viiiKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
13.7.8 DMA_SetTransferSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11013.7.9 DMA_SetModulo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11013.7.10 DMA_EnableCycleSteal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11113.7.11 DMA_EnableAutoAlign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11113.7.12 DMA_EnableAsyncRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11113.7.13 DMA_EnableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11213.7.14 DMA_DisableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11213.7.15 DMA_EnableChannelRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11213.7.16 DMA_DisableChannelRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . 11213.7.17 DMA_TriggerChannelStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11313.7.18 DMA_GetRemainingBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11313.7.19 DMA_GetChannelStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11313.7.20 DMA_ClearChannelStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . 11413.7.21 DMA_CreateHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11413.7.22 DMA_SetCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11413.7.23 DMA_PrepareTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11513.7.24 DMA_SubmitTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11513.7.25 DMA_StartTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11613.7.26 DMA_StopTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11613.7.27 DMA_AbortTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11613.7.28 DMA_HandleIRQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Chapter DMAMUX: Direct Memory Access Multiplexer Driver
14.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
14.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11914.2.1 DMAMUX Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
14.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 12014.3.1 FSL_DMAMUX_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . 120
14.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12014.4.1 DMAMUX_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12014.4.2 DMAMUX_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12114.4.3 DMAMUX_EnableChannel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12114.4.4 DMAMUX_DisableChannel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12114.4.5 DMAMUX_SetSource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Chapter DSPI: Serial Peripheral Interface Driver
15.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
15.2 DSPI Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12415.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
ix
SectionNumber
ContentsTitle
PageNumber
15.2.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12415.2.3 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13115.2.4 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 13915.2.5 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13915.2.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 14015.2.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
15.3 DSPI DMA Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16415.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16415.3.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16515.3.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16815.3.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
15.4 DSPI eDMA Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17415.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17415.4.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17515.4.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17815.4.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
15.5 DSPI FreeRTOS Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18415.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18415.5.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18415.5.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 18515.5.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
15.6 DSPI COS/II Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18715.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18715.6.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18715.6.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 18815.6.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
15.7 DSPI COS/III Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19015.7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19015.7.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19015.7.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 19115.7.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Chapter eDMA: Enhanced Direct Memory Access Controller Driver
16.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
16.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19316.2.1 eDMA Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
16.3 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19916.3.1 struct edma_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
xKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
16.3.2 struct edma_transfer_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19916.3.3 struct edma_channel_Preemption_config_t . . . . . . . . . . . . . . . . . . . . . 20016.3.4 struct edma_minor_offset_config_t . . . . . . . . . . . . . . . . . . . . . . . . . 20116.3.5 struct edma_tcd_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20116.3.6 struct edma_handle_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
16.4 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 20316.4.1 FSL_EDMA_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . 203
16.5 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20316.5.1 edma_callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
16.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 20316.6.1 edma_transfer_size_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20316.6.2 edma_modulo_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20416.6.3 edma_bandwidth_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20416.6.4 edma_channel_link_type_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20516.6.5 _edma_channel_status_flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20516.6.6 _edma_error_status_flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20516.6.7 edma_interrupt_enable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20516.6.8 edma_transfer_type_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20616.6.9 _edma_transfer_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
16.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20616.7.1 EDMA_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20616.7.2 EDMA_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20616.7.3 EDMA_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20616.7.4 EDMA_ResetChannel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20716.7.5 EDMA_SetTransferConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20716.7.6 EDMA_SetMinorOffsetConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . 20816.7.7 EDMA_SetChannelPreemptionConfig . . . . . . . . . . . . . . . . . . . . . . . 20816.7.8 EDMA_SetChannelLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20916.7.9 EDMA_SetBandWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20916.7.10 EDMA_SetModulo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21016.7.11 EDMA_EnableAutoStopRequest . . . . . . . . . . . . . . . . . . . . . . . . . . 21016.7.12 EDMA_EnableChannelInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . 21016.7.13 EDMA_DisableChannelInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . 21116.7.14 EDMA_TcdReset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21116.7.15 EDMA_TcdSetTransferConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . 21116.7.16 EDMA_TcdSetMinorOffsetConfig . . . . . . . . . . . . . . . . . . . . . . . . . 21316.7.17 EDMA_TcdSetChannelLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21316.7.18 EDMA_TcdSetBandWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21416.7.19 EDMA_TcdSetModulo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21416.7.20 EDMA_TcdEnableAutoStopRequest . . . . . . . . . . . . . . . . . . . . . . . . 21516.7.21 EDMA_TcdEnableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
xi
SectionNumber
ContentsTitle
PageNumber
16.7.22 EDMA_TcdDisableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21516.7.23 EDMA_EnableChannelRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . 21516.7.24 EDMA_DisableChannelRequest . . . . . . . . . . . . . . . . . . . . . . . . . . 21616.7.25 EDMA_TriggerChannelStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21616.7.26 EDMA_GetRemainingBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21616.7.27 EDMA_GetErrorStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21716.7.28 EDMA_GetChannelStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . 21716.7.29 EDMA_ClearChannelStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . 21716.7.30 EDMA_CreateHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21816.7.31 EDMA_InstallTCDMemory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21816.7.32 EDMA_SetCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21816.7.33 EDMA_PrepareTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21916.7.34 EDMA_SubmitTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21916.7.35 EDMA_StartTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22016.7.36 EDMA_StopTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22016.7.37 EDMA_AbortTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22016.7.38 EDMA_HandleIRQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Chapter ENET: Ethernet MAC Driver
17.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
17.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22317.2.1 ENET Initialization, receive, and transmit operation . . . . . . . . . . . . . . . . 223
17.3 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23117.3.1 struct enet_rx_bd_struct_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23117.3.2 struct enet_tx_bd_struct_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23117.3.3 struct enet_data_error_stats_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23217.3.4 struct enet_buffer_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23217.3.5 struct enet_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23317.3.6 struct _enet_handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
17.4 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 23617.4.1 FSL_ENET_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . 23617.4.2 ENET_BUFFDESCRIPTOR_RX_EMPTY_MASK . . . . . . . . . . . . . . . . 23817.4.3 ENET_BUFFDESCRIPTOR_RX_SOFTOWNER1_MASK . . . . . . . . . . . . 23817.4.4 ENET_BUFFDESCRIPTOR_RX_WRAP_MASK . . . . . . . . . . . . . . . . . 23817.4.5 ENET_BUFFDESCRIPTOR_RX_SOFTOWNER2_Mask . . . . . . . . . . . . . 23817.4.6 ENET_BUFFDESCRIPTOR_RX_LAST_MASK . . . . . . . . . . . . . . . . . 23817.4.7 ENET_BUFFDESCRIPTOR_RX_MISS_MASK . . . . . . . . . . . . . . . . . 23817.4.8 ENET_BUFFDESCRIPTOR_RX_BROADCAST_MASK . . . . . . . . . . . . . 23817.4.9 ENET_BUFFDESCRIPTOR_RX_MULTICAST_MASK . . . . . . . . . . . . . 23817.4.10 ENET_BUFFDESCRIPTOR_RX_LENVLIOLATE_MASK . . . . . . . . . . . 23817.4.11 ENET_BUFFDESCRIPTOR_RX_NOOCTET_MASK . . . . . . . . . . . . . . 238
xiiKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
17.4.12 ENET_BUFFDESCRIPTOR_RX_CRC_MASK . . . . . . . . . . . . . . . . . . 23817.4.13 ENET_BUFFDESCRIPTOR_RX_OVERRUN_MASK . . . . . . . . . . . . . . 23817.4.14 ENET_BUFFDESCRIPTOR_RX_TRUNC_MASK . . . . . . . . . . . . . . . . 23817.4.15 ENET_BUFFDESCRIPTOR_TX_READY_MASK . . . . . . . . . . . . . . . . 23817.4.16 ENET_BUFFDESCRIPTOR_TX_SOFTOWENER1_MASK . . . . . . . . . . . 23817.4.17 ENET_BUFFDESCRIPTOR_TX_WRAP_MASK . . . . . . . . . . . . . . . . . 23817.4.18 ENET_BUFFDESCRIPTOR_TX_SOFTOWENER2_MASK . . . . . . . . . . . 23817.4.19 ENET_BUFFDESCRIPTOR_TX_LAST_MASK . . . . . . . . . . . . . . . . . 23817.4.20 ENET_BUFFDESCRIPTOR_TX_TRANMITCRC_MASK . . . . . . . . . . . . 23817.4.21 ENET_BUFFDESCRIPTOR_RX_ERR_MASK . . . . . . . . . . . . . . . . . . 23817.4.22 ENET_FRAME_MAX_FRAMELEN . . . . . . . . . . . . . . . . . . . . . . . . 23917.4.23 ENET_FRAME_MAX_VALNFRAMELEN . . . . . . . . . . . . . . . . . . . . 23917.4.24 ENET_FIFO_MIN_RX_FULL . . . . . . . . . . . . . . . . . . . . . . . . . . . 23917.4.25 ENET_RX_MIN_BUFFERSIZE . . . . . . . . . . . . . . . . . . . . . . . . . . 23917.4.26 ENET_BUFF_ALIGNMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23917.4.27 ENET_PHY_MAXADDRESS . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
17.5 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23917.5.1 enet_callback_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
17.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 23917.6.1 _enet_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23917.6.2 enet_mii_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23917.6.3 enet_mii_speed_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24017.6.4 enet_mii_duplex_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24017.6.5 enet_mii_write_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24017.6.6 enet_mii_read_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24017.6.7 enet_special_control_flag_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24017.6.8 enet_interrupt_enable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24117.6.9 enet_event_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24117.6.10 enet_tx_accelerator_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24217.6.11 enet_rx_accelerator_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
17.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24217.7.1 ENET_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24217.7.2 ENET_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24217.7.3 ENET_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24317.7.4 ENET_Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24317.7.5 ENET_SetMII . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24317.7.6 ENET_SetSMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24417.7.7 ENET_GetSMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24417.7.8 ENET_ReadSMIData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24417.7.9 ENET_StartSMIRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24517.7.10 ENET_StartSMIWrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24517.7.11 ENET_SetMacAddr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
xiii
SectionNumber
ContentsTitle
PageNumber
17.7.12 ENET_GetMacAddr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24617.7.13 ENET_AddMulticastGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24617.7.14 ENET_LeaveMulticastGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24617.7.15 ENET_ActiveRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24617.7.16 ENET_EnableSleepMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24717.7.17 ENET_GetAccelFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24717.7.18 ENET_EnableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24717.7.19 ENET_DisableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24817.7.20 ENET_GetInterruptStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24817.7.21 ENET_ClearInterruptStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24817.7.22 ENET_SetCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24917.7.23 ENET_GetRxErrBeforeReadFrame . . . . . . . . . . . . . . . . . . . . . . . . . 24917.7.24 ENET_GetRxFrameSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25017.7.25 ENET_ReadFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25017.7.26 ENET_SendFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25117.7.27 ENET_TransmitIRQHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25117.7.28 ENET_ReceiveIRQHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25217.7.29 ENET_ErrorIRQHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Chapter EWM: External Watchdog Monitor Driver
18.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
18.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25418.2.1 struct ewm_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
18.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 25418.3.1 FSL_EWM_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 254
18.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 25418.4.1 _ewm_interrupt_enable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25418.4.2 _ewm_status_flags_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
18.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25518.5.1 EWM_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25518.5.2 EWM_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25518.5.3 EWM_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25518.5.4 EWM_EnableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25618.5.5 EWM_DisableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25618.5.6 EWM_GetStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25618.5.7 EWM_Refresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Chapter C90TFS Flash Driver
19.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
xivKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
19.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26619.2.1 struct flash_execute_in_ram_function_config_t . . . . . . . . . . . . . . . . . . . 26619.2.2 struct flash_swap_state_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 26719.2.3 struct flash_swap_ifr_field_config_t . . . . . . . . . . . . . . . . . . . . . . . . . 26719.2.4 struct flash_operation_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 26819.2.5 struct flash_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
19.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 27019.3.1 MAKE_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27019.3.2 FSL_FLASH_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . 27019.3.3 FLASH_SSD_CONFIG_ENABLE_FLEXNVM_SUPPORT . . . . . . . . . . . 27019.3.4 FLASH_DRIVER_IS_FLASH_RESIDENT . . . . . . . . . . . . . . . . . . . . 27019.3.5 FLASH_DRIVER_IS_EXPORTED . . . . . . . . . . . . . . . . . . . . . . . . . 27019.3.6 kStatusGroupGeneric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27119.3.7 MAKE_STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27119.3.8 FOUR_CHAR_CODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
19.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 27119.4.1 _flash_driver_version_constants . . . . . . . . . . . . . . . . . . . . . . . . . . . 27119.4.2 _flash_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27119.4.3 _flash_driver_api_keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27219.4.4 flash_margin_value_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27219.4.5 flash_security_state_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27219.4.6 flash_protection_state_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27219.4.7 flash_execute_only_access_state_t . . . . . . . . . . . . . . . . . . . . . . . . . 27219.4.8 flash_property_tag_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27319.4.9 _flash_execute_in_ram_function_constants . . . . . . . . . . . . . . . . . . . . . 27319.4.10 flash_read_resource_option_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27319.4.11 _flash_read_resource_range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27419.4.12 flash_flexram_function_option_t . . . . . . . . . . . . . . . . . . . . . . . . . . 27419.4.13 flash_swap_function_option_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27419.4.14 flash_swap_control_option_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27419.4.15 flash_swap_state_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27519.4.16 flash_swap_block_status_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27519.4.17 flash_partition_flexram_load_option_t . . . . . . . . . . . . . . . . . . . . . . . 275
19.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27519.5.1 FLASH_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27519.5.2 FLASH_SetCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27619.5.3 FLASH_PrepareExecuteInRamFunctions . . . . . . . . . . . . . . . . . . . . . . 27619.5.4 FLASH_EraseAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27719.5.5 FLASH_Erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27719.5.6 FLASH_EraseAllExecuteOnlySegments . . . . . . . . . . . . . . . . . . . . . . 27819.5.7 FLASH_Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28019.5.8 FLASH_ProgramOnce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
xv
SectionNumber
ContentsTitle
PageNumber
19.5.9 FLASH_ReadOnce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28219.5.10 FLASH_GetSecurityState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28319.5.11 FLASH_SecurityBypass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28419.5.12 FLASH_VerifyEraseAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28419.5.13 FLASH_VerifyErase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28519.5.14 FLASH_VerifyProgram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28619.5.15 FLASH_VerifyEraseAllExecuteOnlySegments . . . . . . . . . . . . . . . . . . . 28719.5.16 FLASH_IsProtected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28819.5.17 FLASH_IsExecuteOnly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28919.5.18 FLASH_GetProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28919.5.19 FLASH_PflashSetProtection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29019.5.20 FLASH_PflashGetProtection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Chapter FlexBus: External Bus Interface Driver
20.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
20.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
20.3 FlexBus functional operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
20.4 Typical use case and example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
20.5 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29520.5.1 struct flexbus_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
20.6 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 29620.6.1 FSL_FLEXBUS_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . 296
20.7 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 29620.7.1 flexbus_port_size_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29620.7.2 flexbus_write_address_hold_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29720.7.3 flexbus_read_address_hold_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29720.7.4 flexbus_address_setup_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29720.7.5 flexbus_bytelane_shift_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29720.7.6 flexbus_multiplex_group1_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29720.7.7 flexbus_multiplex_group2_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29820.7.8 flexbus_multiplex_group3_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29820.7.9 flexbus_multiplex_group4_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29820.7.10 flexbus_multiplex_group5_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
20.8 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29820.8.1 FLEXBUS_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29820.8.2 FLEXBUS_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29920.8.3 FLEXBUS_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
xviKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
Chapter FlexCAN: Flex Controller Area Network Driver
21.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
21.2 FlexCAN Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30221.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30221.2.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30221.2.3 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31021.2.4 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 31421.2.5 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31921.2.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 31921.2.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
21.3 FlexCAN eDMA Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33521.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33521.3.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33521.3.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33621.3.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Chapter FlexIO: FlexIO Driver
22.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
22.2 FlexIO Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34022.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34022.2.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34422.2.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 34722.2.4 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34722.2.5 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 34722.2.6 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
22.3 FlexIO Camera Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36222.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36222.3.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36222.3.3 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36222.3.4 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36522.3.5 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 36722.3.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 36722.3.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36722.3.8 FlexIO DMA I2S Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37122.3.9 FlexIO DMA SPI Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37722.3.10 FlexIO DMA UART Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38322.3.11 FlexIO eDMA Camera Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38822.3.12 FlexIO eDMA I2S Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39222.3.13 FlexIO eDMA SPI Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
xvii
SectionNumber
ContentsTitle
PageNumber
22.3.14 FlexIO eDMA UART Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
22.4 FlexIO I2C Master Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41022.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41022.4.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41022.4.3 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41022.4.4 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41422.4.5 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 41722.4.6 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41722.4.7 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 41722.4.8 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
22.5 FlexIO I2S Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42822.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42822.5.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42822.5.3 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42822.5.4 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43422.5.5 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 43522.5.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 43522.5.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
22.6 FlexIO SPI Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44822.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44822.6.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44822.6.3 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44822.6.4 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45422.6.5 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 45922.6.6 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45922.6.7 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 45922.6.8 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
22.7 FlexIO UART Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47522.7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47522.7.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47522.7.3 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47622.7.4 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48322.7.5 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 48622.7.6 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48622.7.7 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 48622.7.8 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Chapter FTM: FlexTimer Driver
23.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
xviiiKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
23.2 Function groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49923.2.1 Initialization and deinitialization . . . . . . . . . . . . . . . . . . . . . . . . . . 49923.2.2 PWM Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49923.2.3 Input capture operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49923.2.4 Output compare operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50023.2.5 Quad decode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50023.2.6 Fault operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
23.3 Register Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
23.4 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50123.4.1 PWM output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
23.5 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50723.5.1 struct ftm_chnl_pwm_signal_param_t . . . . . . . . . . . . . . . . . . . . . . . . 50723.5.2 struct ftm_dual_edge_capture_param_t . . . . . . . . . . . . . . . . . . . . . . . 50823.5.3 struct ftm_phase_params_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50823.5.4 struct ftm_fault_param_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50823.5.5 struct ftm_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
23.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 50923.6.1 ftm_chnl_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50923.6.2 ftm_fault_input_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51023.6.3 ftm_pwm_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51023.6.4 ftm_pwm_level_select_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51023.6.5 ftm_output_compare_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51123.6.6 ftm_input_capture_edge_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51123.6.7 ftm_dual_edge_capture_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 51123.6.8 ftm_quad_decode_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51123.6.9 ftm_phase_polarity_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51123.6.10 ftm_deadtime_prescale_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51223.6.11 ftm_clock_source_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51223.6.12 ftm_clock_prescale_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51223.6.13 ftm_bdm_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51223.6.14 ftm_fault_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51323.6.15 ftm_external_trigger_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51323.6.16 ftm_pwm_sync_method_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51323.6.17 ftm_reload_point_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51323.6.18 ftm_interrupt_enable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51423.6.19 ftm_status_flags_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
23.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51523.7.1 FTM_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51523.7.2 FTM_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51523.7.3 FTM_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
xix
SectionNumber
ContentsTitle
PageNumber
23.7.4 FTM_SetupPwm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51623.7.5 FTM_UpdatePwmDutycycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51723.7.6 FTM_UpdateChnlEdgeLevelSelect . . . . . . . . . . . . . . . . . . . . . . . . . 51723.7.7 FTM_SetupInputCapture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51723.7.8 FTM_SetupOutputCompare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51823.7.9 FTM_SetupDualEdgeCapture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51823.7.10 FTM_SetupQuadDecode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51923.7.11 FTM_SetupFault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51923.7.12 FTM_EnableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51923.7.13 FTM_DisableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51923.7.14 FTM_GetEnabledInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52023.7.15 FTM_GetStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52023.7.16 FTM_ClearStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52023.7.17 FTM_StartTimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52023.7.18 FTM_StopTimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52123.7.19 FTM_SetSoftwareCtrlEnable . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52123.7.20 FTM_SetSoftwareCtrlVal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52123.7.21 FTM_SetGlobalTimeBaseOutputEnable . . . . . . . . . . . . . . . . . . . . . . 52123.7.22 FTM_SetOutputMask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52223.7.23 FTM_SetFaultControlEnable . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52223.7.24 FTM_SetDeadTimeEnable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52223.7.25 FTM_SetComplementaryEnable . . . . . . . . . . . . . . . . . . . . . . . . . . 52323.7.26 FTM_SetInvertEnable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52423.7.27 FTM_SetSoftwareTrigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52423.7.28 FTM_SetWriteProtection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
Chapter GPIO: General-Purpose Input/Output Driver
24.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
24.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52524.2.1 struct gpio_pin_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
24.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 52624.3.1 FSL_GPIO_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 526
24.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 52624.4.1 gpio_pin_direction_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
24.5 GPIO Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52724.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52724.5.2 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52724.5.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
24.6 FGPIO Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
xxKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
24.6.1 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Chapter I2C: Inter-Integrated Circuit Driver
25.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
25.2 I2C Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53425.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53425.2.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53425.2.3 Typical use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53425.2.4 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54125.2.5 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 54525.2.6 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54525.2.7 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 54525.2.8 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
25.3 I2C DMA Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56125.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56125.3.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56125.3.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56225.3.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
25.4 I2C eDMA Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56525.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56525.4.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56525.4.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56625.4.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
25.5 I2C FreeRTOS Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56925.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56925.5.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56925.5.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 57025.5.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
25.6 I2C COS/II Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57225.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57225.6.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57225.6.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 57325.6.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
25.7 I2C COS/III Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
Chapter LLWU: Low-Leakage Wakeup Unit Driver
26.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
xxi
SectionNumber
ContentsTitle
PageNumber
26.2 External wakeup pins configurations . . . . . . . . . . . . . . . . . . . . . . . . . 577
26.3 Internal wakeup modules configurations . . . . . . . . . . . . . . . . . . . . . . . 577
26.4 Digital pin filter for external wakeup pin configurations . . . . . . . . . . . . . . 577
26.5 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 57826.5.1 FSL_LLWU_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . 578
26.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 57826.6.1 llwu_external_pin_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57826.6.2 llwu_pin_filter_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
Chapter LMEM: Local Memory Controller Cache Control Driver
27.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
27.2 Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
27.3 Function groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57927.3.1 Local Memory Processor Code Bus Cache Control . . . . . . . . . . . . . . . . . 57927.3.2 Local Memory Processor System Bus Cache Control . . . . . . . . . . . . . . . . 580
27.4 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 58327.4.1 FSL_LMEM_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . 58327.4.2 LMEM_CACHE_LINE_SIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . 58327.4.3 LMEM_CACHE_SIZE_ONEWAY . . . . . . . . . . . . . . . . . . . . . . . . . 583
27.5 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 58327.5.1 lmem_cache_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58327.5.2 lmem_cache_region_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58327.5.3 lmem_cache_line_command_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
27.6 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58427.6.1 LMEM_EnableCodeCache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58427.6.2 LMEM_CodeCacheInvalidateAll . . . . . . . . . . . . . . . . . . . . . . . . . . 58427.6.3 LMEM_CodeCachePushAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58427.6.4 LMEM_CodeCacheClearAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58527.6.5 LMEM_CodeCacheInvalidateLine . . . . . . . . . . . . . . . . . . . . . . . . . 58527.6.6 LMEM_CodeCacheInvalidateMultiLines . . . . . . . . . . . . . . . . . . . . . . 58527.6.7 LMEM_CodeCachePushLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58627.6.8 LMEM_CodeCachePushMultiLines . . . . . . . . . . . . . . . . . . . . . . . . . 58627.6.9 LMEM_CodeCacheClearLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58727.6.10 LMEM_CodeCacheClearMultiLines . . . . . . . . . . . . . . . . . . . . . . . . 58727.6.11 LMEM_CodeCacheDemoteRegion . . . . . . . . . . . . . . . . . . . . . . . . . 587
xxiiKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
Chapter LPI2C: Low Power I2C Driver
28.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
28.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 58928.2.1 FSL_LPI2C_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . 589
28.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 59028.3.1 _lpi2c_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
28.4 LPI2C FreeRTOS Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59128.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59128.4.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59128.4.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 59228.4.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
28.5 LPI2C Master Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59428.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59428.5.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59728.5.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60128.5.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 60128.5.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
28.6 LPI2C Master DMA Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61628.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61628.6.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61628.6.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61728.6.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
28.7 LPI2C Slave Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62128.7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62128.7.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62328.7.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62728.7.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 62828.7.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
28.8 LPI2C Slave DMA Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
28.9 LPI2C COS/II Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63928.9.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63928.9.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63928.9.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 64028.9.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
28.10 LPI2C COS/III Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64228.10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
xxiii
SectionNumber
ContentsTitle
PageNumber
28.10.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64228.10.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 64328.10.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
Chapter LPTMR: LPTMR Driver
29.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
29.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64729.2.1 struct lptmr_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
29.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 64829.3.1 lptmr_pin_select_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64829.3.2 lptmr_pin_polarity_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64829.3.3 lptmr_timer_mode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64829.3.4 lptmr_prescaler_glitch_value_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 64829.3.5 lptmr_prescaler_clock_select_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 64929.3.6 lptmr_interrupt_enable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64929.3.7 lptmr_status_flags_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
29.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64929.4.1 LPTMR_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64929.4.2 LPTMR_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65029.4.3 LPTMR_GetDefaultConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65029.4.4 LPTMR_EnableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65029.4.5 LPTMR_DisableInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65029.4.6 LPTMR_GetEnabledInterrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 65129.4.7 LPTMR_GetStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65129.4.8 LPTMR_ClearStatusFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65129.4.9 LPTMR_SetTimerPeriod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65229.4.10 LPTMR_GetCurrentTimerCount . . . . . . . . . . . . . . . . . . . . . . . . . . 65229.4.11 LPTMR_StartTimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65229.4.12 LPTMR_StopTimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
Chapter LPUART: Low Power UART Driver
30.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
30.2 LPUART Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65630.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65630.2.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66030.2.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 66230.2.4 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66230.2.5 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 66230.2.6 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
xxivKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
30.2.7 LPUART DMA Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67730.2.8 LPUART eDMA Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
30.3 LPUART FreeRTOS Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68730.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68730.3.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 68730.3.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
30.4 LPUART COS/II Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69030.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69030.4.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 69030.4.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
30.5 LPUART COS/III Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69330.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69330.5.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 69330.5.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
Chapter LTC: LP Trusted Cryptography
31.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
31.2 LTC Driver Initialization and Configuration . . . . . . . . . . . . . . . . . . . . 697
31.3 Comments about API usage in RTOS . . . . . . . . . . . . . . . . . . . . . . . . 697
31.4 Comments about API usage in interrupt handler . . . . . . . . . . . . . . . . . . 697
31.5 LTC Driver Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
31.6 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 70031.6.1 FSL_LTC_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 700
31.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70031.7.1 LTC_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70031.7.2 LTC_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70131.7.3 LTC_SetDpaMaskSeed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
31.8 LTC Blocking APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70231.8.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70231.8.2 LTC AES driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70331.8.3 LTC DES driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71331.8.4 LTC HASH driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73031.8.5 LTC PKHA driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
31.9 LTC Non-blocking eDMA APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . 74931.9.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
xxv
SectionNumber
ContentsTitle
PageNumber
31.9.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74931.9.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75131.9.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75231.9.5 LTC eDMA AES driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75431.9.6 LTC eDMA DES driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
Chapter MPU: Memory Protection Unit
32.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
32.2 Initialization and Deinitialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
32.3 Basic Control Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
32.4 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78532.4.1 struct mpu_hardware_info_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78532.4.2 struct mpu_access_err_info_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78532.4.3 struct mpu_low_masters_access_rights_t . . . . . . . . . . . . . . . . . . . . . . 78632.4.4 struct mpu_high_masters_access_rights_t . . . . . . . . . . . . . . . . . . . . . . 78632.4.5 struct mpu_region_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78732.4.6 struct mpu_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788
32.5 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 78932.5.1 FSL_MPU_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 78932.5.2 MPU_WORD_LOW_MASTER_SHIFT . . . . . . . . . . . . . . . . . . . . . . 78932.5.3 MPU_WORD_LOW_MASTER_MASK . . . . . . . . . . . . . . . . . . . . . . 78932.5.4 MPU_WORD_LOW_MASTER_WIDTH . . . . . . . . . . . . . . . . . . . . . 78932.5.5 MPU_WORD_LOW_MASTER . . . . . . . . . . . . . . . . . . . . . . . . . . 78932.5.6 MPU_LOW_MASTER_PE_SHIFT . . . . . . . . . . . . . . . . . . . . . . . . . 78932.5.7 MPU_LOW_MASTER_PE_MASK . . . . . . . . . . . . . . . . . . . . . . . . 78932.5.8 MPU_WORD_MASTER_PE_WIDTH . . . . . . . . . . . . . . . . . . . . . . . 78932.5.9 MPU_WORD_MASTER_PE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78932.5.10 MPU_WORD_HIGH_MASTER_SHIFT . . . . . . . . . . . . . . . . . . . . . . 78932.5.11 MPU_WORD_HIGH_MASTER_MASK . . . . . . . . . . . . . . . . . . . . . . 78932.5.12 MPU_WORD_HIGH_MASTER_WIDTH . . . . . . . . . . . . . . . . . . . . . 78932.5.13 MPU_WORD_HIGH_MASTER . . . . . . . . . . . . . . . . . . . . . . . . . . 789
32.6 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 79032.6.1 mpu_region_num_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79032.6.2 mpu_master_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79032.6.3 mpu_region_total_num_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79032.6.4 mpu_slave_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79032.6.5 mpu_err_access_control_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79032.6.6 mpu_err_access_type_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79032.6.7 mpu_err_attributes_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
xxviKinetis SDK v.2.0 API Reference Manual
Freescale Semiconductor
SectionNumber
ContentsTitle
PageNumber
32.6.8 mpu_supervisor_access_rights_t . . . . . . . . . . . . . . . . . . . . . . . . . . 79132.6.9 mpu_user_access_rights_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
32.7 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79132.7.1 MPU_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79132.7.2 MPU_Deinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79232.7.3 MPU_Enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79232.7.4 MPU_RegionEnable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79232.7.5 MPU_GetHardwareInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79232.7.6 MPU_SetRegionConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79332.7.7 MPU_SetRegionAddr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79332.7.8 MPU_SetRegionLowMasterAccessRights . . . . . . . . . . . . . . . . . . . . . 79332.7.9 MPU_SetRegionHighMasterAccessRights . . . . . . . . . . . . . . . . . . . . . 79432.7.10 MPU_GetSlavePortErrorStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . 79432.7.11 MPU_GetDetailErrorAccessInfo . . . . . . . . . . . . . . . . . . . . . . . . . . 794
Chapter Notification Framework
33.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
33.2 Notifier Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
33.3 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80033.3.1 struct notifier_notification_block_t . . . . . . . . . . . . . . . . . . . . . . . . . 80033.3.2 struct notifier_callback_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 80033.3.3 struct notifier_handle_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
33.4 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80233.4.1 notifier_user_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80233.4.2 notifier_user_function_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80233.4.3 notifier_callback_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
33.5 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 80333.5.1 _notifier_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80333.5.2 notifier_policy_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80333.5.3 notifier_notification_type_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80433.5.4 notifier_callback_type_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
33.6 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80433.6.1 NOTIFIER_CreateHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80433.6.2 NOTIFIER_SwitchConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80533.6.3 NOTIFIER_GetErrorCallbackIndex . . . . . . . . . . . . . . . . . . . . . . . . . 806
Chapter PDB: Programmable Delay Block
34.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
Freescale SemiconductorKinetis SDK v.2.0 API Reference Manual
xxvii
SectionNumber
ContentsTitle
PageNumber
34.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81234.2.1 struct pdb_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81234.2.2 struct pdb_adc_pretrigger_config_t . . . . . . . . . . . . . . . . . . . . . . . . . 81334.2.3 struct pdb_dac_trigger_config_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
34.3 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 81434.3.1 FSL_PDB_DRIVER_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . 814
34.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 81434.4.1 _pdb_status_flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81434.4.2 _pdb_adc_pretrigger_flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81434.4.3 _pdb_interrupt_enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8