| Kinetis SDK v.2.0 API Reference Manual Rev. 0 Freescale Semiconductor, Inc.

- Main Page
- Related Pages
- API Reference

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Files | Enumerations
TRGMUX: Trigger Mux Driver

## Overview

The KSDK provides driver for the Trigger Mux module of Kinetis devices.

# Typical use case

TRGMUX_SetTriggerSource(TRGMUX0,kTRGMUX_Trgmux0Dmamux0,kTRGMUX_TriggerInput0,kTRGMUX_SourcePortPin);

## Files
file | fsl_trgmux.h

## Enumerations
enum | _trgmux_status { kStatus_TRGMUX_Locked = MAKE_STATUS(kStatusGroup_TRGMUX, 0) }
| TRGMUX configure status. More...
enum | trgmux_trigger_input_t { kTRGMUX_TriggerInput0 = TRGMUX_TRGCFG_SEL0_SHIFT, kTRGMUX_TriggerInput1 = TRGMUX_TRGCFG_SEL1_SHIFT, kTRGMUX_TriggerInput2 = TRGMUX_TRGCFG_SEL2_SHIFT, kTRGMUX_TriggerInput3 = TRGMUX_TRGCFG_SEL3_SHIFT }
| Defines the MUX select for peripheral trigger input. More...

## Driver version
#define | FSL_TRGMUX_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
| TRGMUX driver version 2.0.0. More...

## TRGMUX Functional Operation
static void | TRGMUX_LockRegister (TRGMUX_Type *base, trgmux_device_t index)
| Sets the flag of the register which is used to mark writeable. More...
status_t | TRGMUX_SetTriggerSource (TRGMUX_Type *base, trgmux_device_t index, trgmux_trigger_input_t input, trgmux_source_t trigger_src)
| Configures the trigger source of the appointed peripheral. More...

## Macro Definition Documentation

#define FSL_TRGMUX_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))

## Enumeration Type Documentation

enum _trgmux_status

Enumerator
kStatus_TRGMUX_Locked | Configure failed for register is locked.

enum trgmux_trigger_input_t

Enumerator
kTRGMUX_TriggerInput0 | The MUX select for peripheral trigger input 0.
kTRGMUX_TriggerInput1 | The MUX select for peripheral trigger input 1.
kTRGMUX_TriggerInput2 | The MUX select for peripheral trigger input 2.
kTRGMUX_TriggerInput3 | The MUX select for peripheral trigger input 3.

## Function Documentation

static void TRGMUX_LockRegister | ( | TRGMUX_Type * | base,
|  | trgmux_device_t | index
| ) |  |
| inline static

The function sets the flag of the register which is used to mark writeable. Example:

TRGMUX_LockRegister(TRGMUX0,kTRGMUX_Trgmux0Dmamux0);

Parameters

  base | TRGMUX peripheral base address.
  index | The index of the TRGMUX register.

status_t TRGMUX_SetTriggerSource | ( | TRGMUX_Type * | base,
|  | trgmux_device_t | index,
|  | trgmux_trigger_input_t | input,
|  | trgmux_source_t | trigger_src
| ) |  |

The function configures the trigger source of the appointed peripheral. Example:

TRGMUX_SetTriggerSource(TRGMUX0, kTRGMUX_Trgmux0Dmamux0, kTRGMUX_TriggerInput0, kTRGMUX_SourcePortPin);

Parameters

  base | TRGMUX peripheral base address.
  index | The index of the TRGMUX register.
  input | The MUX select for peripheral trigger input
  trigger_src | The trigger inputs for various peripherals.

Return values

  kStatus_Success | Configured successfully.
  kStatus_TRGMUX_Locked | Configuration failed because the register is locked.