Can't find library Defs and it's making me crazy

I don't know why but I'm losing my mind trying to find out which libraries the timer clock defs are in. I wanted to say "buried in" or "hidden away" but that's just my incompetence typing and I know this.

This all started when I was trying to look up where "TC_CMR_TCCLKS_TIMER_CLOCK4" is referenced. I'm trying to understand how the registers are reference for the ATSAM3X8E.

This is the block of code I need to be able to understand beginning to end.

void startTimer(Tc *tc, uint32_t channel, IRQn_Type irq, uint32_t frequency) {
  uint32_t rc = VARIANT_MCK/128/frequency; //128 because we selected TIMER_CLOCK4 above
  TC_SetRA(tc, channel, rc/2); //50% high, 50% low
  TC_SetRC(tc, channel, rc);
  TC_Start(tc, channel);

I thought it would be in tc.h or tc_lib.h but I literally opened up every .h file inside my Arduino install folder and still couldn't find the defs from the above block of code. I got fed up and opened them all in notepad++ and did a search across all files for "TC_CMR_WAVSEL_UP_RC" and still couldn't find it. What am I missing here?

Reading this Atmel Timer Application Note isn't helping because I think I need to be using their platform and libraries.

Can someone confirm if at some point it makes sense to just move away from the Arduino IDE? I know the answer to most questions is "It depends."

It isn't clear to me if I can or should even use the Atmel Advanced Software Framework within Arduino but it it's at all possible to switch to Atmel studio and use the Arduino Due I may decide to cut my losses with the Arduino IDE because while it's wonderful for board and library management I'm really struggling to locate very basic info like library defs. Yes I know.. It's inexperience, and incompetence, and impatience but if I'm here it's because I'm 5hrs into trying to understand how to setup the timers so I can output user custom PWM signal with a minimum pulse with of 50nS.

You will find function descriptions in one of your PC folders ....hardware/arduino/sam/system/libsam/source/tc.c

BTW, to install an imported library, there is e.g. this link once you have spotted where is the library in github (download library .zip code, copy the .zip file in one of your folders, DO NOT unzip the file, and follow the tutorial):

You can also simply use Sam3x registers to output simple PWM pulses (Sam3x datasheet is necessary). You can find numerous example sketches in the DUE sub forum, e.g.:

Or this one:

/*                         PWMH0 641 Hz                                        */

void setup() {

  PMC->PMC_PCER1 |= PMC_PCER1_PID36;                   // PWM power ON

  PIOC->PIO_PDR |= PIO_PDR_P3;                         // Set pin to a peripheral
  PIOC->PIO_ABSR |= PIO_PC3B_PWMH0;                    // Set PWM pin peripheral type B for PWMH0 (Arduino pin 35)

  PWM->PWM_CLK = PWM_CLK_PREB(0) | PWM_CLK_DIVB(2);    // select Frequency for clock B: Mck/2 = 42 MHz

  PWM->PWM_CH_NUM[0].PWM_CMR = PWM_CMR_CPRE_CLKB;      // The period is left aligned, clock source as CLKB on channel 0
  PWM->PWM_CH_NUM[0].PWM_CPRD = 65535;                    // Set the PWM frequency 42 MHz/PWM_CPRD = 641 Hz
  PWM->PWM_CH_NUM[0].PWM_CDTY = 32768;                     // Set the PWM duty cycle = (CPRD/CDTY) * 100 %

  PWM->PWM_ENA = PWM_ENA_CHID0;                        // Enable PWM channel 0

void loop() {