/* Auto-generated config file hpl_tc_config.h */ #ifndef HPL_TC_CONFIG_H #define HPL_TC_CONFIG_H // <<< Use Configuration Wizard in Context Menu >>> #ifndef CONF_TC0_ENABLE #define CONF_TC0_ENABLE 1 #endif #include "peripheral_clk_config.h" // Basic configuration // Prescaler // <0x0=> No division // <0x1=> Divide by 2 // <0x2=> Divide by 4 // <0x3=> Divide by 8 // <0x4=> Divide by 16 // <0x5=> Divide by 64 // <0x6=> Divide by 256 // <0x7=> Divide by 1024 // This defines the prescaler value // timer_prescaler #ifndef CONF_TC0_PRESCALER #define CONF_TC0_PRESCALER 0x3 #endif // Length of one timer tick in uS <0-4294967295> // timer_tick #ifndef CONF_TC0_TIMER_TICK #define CONF_TC0_TIMER_TICK 1000 #endif // // Advanced configuration // timer_advanced_configuration #ifndef CONF_TC0__ADVANCED_CONFIGURATION_ENABLE #define CONF_TC0__ADVANCED_CONFIGURATION_ENABLE 0 #endif // Prescaler and Counter Synchronization Selection // Reload or reset counter on next GCLK // Reload or reset counter on next prescaler clock // Reload or reset counter on next GCLK and reset prescaler counter // These bits select if on retrigger event, the Counter should be cleared or reloaded on the next GCLK_TCx clock or on the next prescaled GCLK_TCx clock. // tc_arch_presync #ifndef CONF_TC0_PRESCSYNC #define CONF_TC0_PRESCSYNC TC_CTRLA_PRESCSYNC_GCLK_Val #endif // Run in standby // Indicates whether the module will continue to run in standby sleep mode // tc_arch_runstdby #ifndef CONF_TC0_RUNSTDBY #define CONF_TC0_RUNSTDBY 0 #endif // Run in debug mode // Indicates whether the module will run in debug mode // tc_arch_dbgrun #ifndef CONF_TC0_DBGRUN #define CONF_TC0_DBGRUN 0 #endif // Run on demand // Run if requested by some other peripheral in the device // tc_arch_ondemand #ifndef CONF_TC0_ONDEMAND #define CONF_TC0_ONDEMAND 0 #endif // // Event control // timer_event_control #ifndef CONF_TC0_EVENT_CONTROL_ENABLE #define CONF_TC0_EVENT_CONTROL_ENABLE 0 #endif // Output Event On Match or Capture on Channel 0 // Enable output of event on timer tick // tc_arch_mceo0 #ifndef CONF_TC0_MCEO0 #define CONF_TC0_MCEO0 0 #endif // Output Event On Match or Capture on Channel 1 // Enable output of event on timer tick // tc_arch_mceo1 #ifndef CONF_TC0_MCEO1 #define CONF_TC0_MCEO1 0 #endif // Output Event On Timer Tick // Enable output of event on timer tick // tc_arch_ovfeo #ifndef CONF_TC0_OVFEO #define CONF_TC0_OVFEO 0 #endif // Event Input // Enable asynchronous input events // tc_arch_tcei #ifndef CONF_TC0_TCEI #define CONF_TC0_TCEI 0 #endif // Inverted Event Input // Invert the asynchronous input events // tc_arch_tcinv #ifndef CONF_TC0_TCINV #define CONF_TC0_TCINV 0 #endif // Event action // <0=> Event action disabled // <1=> Start, restart or re-trigger TC on event // <2=> Count on event // <3=> Start on event // <4=> Time stamp capture // <5=> Period captured in CC0, pulse width in CC1 // <6=> Period captured in CC1, pulse width in CC0 // <7=> Pulse width capture // Event which will be performed on an event // tc_arch_evact #ifndef CONF_TC0_EVACT #define CONF_TC0_EVACT 0 #endif // // Default values which the driver needs in order to work correctly // Mode set to 32-bit #ifndef CONF_TC0_MODE #define CONF_TC0_MODE TC_CTRLA_MODE_COUNT32_Val #endif // CC 1 register set to 0 #ifndef CONF_TC0_CC1 #define CONF_TC0_CC1 0 #endif #ifndef CONF_TC0_ALOCK #define CONF_TC0_ALOCK 0 #endif // Not used in 32-bit mode #define CONF_TC0_PER 0 // Calculating correct top value based on requested tick interval. #define CONF_TC0_PRESCALE (1 << CONF_TC0_PRESCALER) // Prescaler set to 64 #if CONF_TC0_PRESCALER > 0x4 #undef CONF_TC0_PRESCALE #define CONF_TC0_PRESCALE 64 #endif // Prescaler set to 256 #if CONF_TC0_PRESCALER > 0x5 #undef CONF_TC0_PRESCALE #define CONF_TC0_PRESCALE 256 #endif // Prescaler set to 1024 #if CONF_TC0_PRESCALER > 0x6 #undef CONF_TC0_PRESCALE #define CONF_TC0_PRESCALE 1024 #endif #ifndef CONF_TC0_CC0 #define CONF_TC0_CC0 \ (uint32_t)(((float)CONF_TC0_TIMER_TICK / 1000000.f) / (1.f / (CONF_GCLK_TC0_FREQUENCY / CONF_TC0_PRESCALE))) #endif // <<< end of configuration section >>> #endif // HPL_TC_CONFIG_H