# Function tc_init()

Configure TC for timer, waveform generation, or capture.

void tc_init(
Tc * p_tc,
uint32_t ul_Channel,
uint32_t ul_Mode)

Table 1. Parameters
Data direction Parameter name Description

[in, out]

p_tc

Module hardware register base address pointer

[in]

ul_channel

Channel to configure

[in]

ul_mode

Control mode register bitmask value to set

Note: For more information regarding ul_mode configuration refer to the section entitled "Channel Mode Register: Capture Mode" and/or section "Waveform Operating Mode" in the device-specific datasheet.
Note: If the TC is configured for waveform generation then the external event selection (EEVT) should only be set to TC_CMR_EEVT_TIOB, or the equivalent value of 0, if it really is the intention to use TIOB as an external event trigger. This is because this setting forces TIOB to be an input, even if the external event trigger has not been enabled with TC_CMR_ENETRG, and thus prevents normal operation of TIOB.