Atmel functions on Arduino Due

I am trying to program a PWM on Arduino Due using Atmel functions, but it doesn’t work.

Some of the functions are working, but some of them have obscure names that I can’t find documentation for anywhere.

I grab this working example from Kerry D. Wong :

#include <Arduino.h>

uint32_t pwmPin = 8;
uint32_t maxDutyCount = 2;
uint32_t clkAFreq = 42000000ul;
uint32_t pwmFreq = 42000000ul;

void setup() {
pmc_enable_periph_clk(PWM_INTERFACE_ID);
PWMC_ConfigureClocks(clkAFreq, 0, VARIANT_MCK);

PIO_Configure(
g_APinDescription[pwmPin].pPort,
g_APinDescription[pwmPin].ulPinType,
g_APinDescription[pwmPin].ulPin,
g_APinDescription[pwmPin].ulPinConfiguration);

uint32_t channel = g_APinDescription[pwmPin].ulPWMChannel;
PWMC_ConfigureChannel(PWM_INTERFACE, channel , pwmFreq, 0, 0);
PWMC_SetPeriod(PWM_INTERFACE, channel, maxDutyCount);
PWMC_EnableChannel(PWM_INTERFACE, channel);
PWMC_SetDutyCycle(PWM_INTERFACE, channel, 1);

pmc_mck_set_prescaler(2);
}

void loop()
{
}

It compiles and it works, so all the functions are defined somewhere in the Arduino libraries.
But when I go to the Atmel documentation, they have functions such as pmc_enable_periph_clk, but the PWMC functions are not there.
Who wrote these functions, and is there any documentations for them ?

Best regards

PWMC in NOT a function it's a macro

Mark

Most of what you're asking about are macros. Unlike the published guidelines for libraries, there are none for macros. There is no apparent strategy defining their location or their functions. Your only mere chance for success is to wade neck deep through the labyrinthine jungle of Arduino directories, tracking files one-by-one and examining each in hopes of stumbling across the definition you seek. Once there (if), you then need to try and understand the (twisted) mindset of the individual and the relative state of existentialism (s)he was in at the time of coding.

Or write your own and keep them in a header called my_macros.h. Then you always know where they are and what they do.