I am trying to learn how the analog write function works in the source files but it seems I've come to a dead end.
This is with a Teensy 3.2 so I am looking in
Arduino/Teensy IDE/hardware/teensy/avr/cores/teensy3/pins_teensy.c
I found the analogWrite function,
but there is a function analogWriteDAC0 I can't seem to find its source.
I use my IDE to find the declaration in core_pins.h
But it just appears to be an empty function definition. I have tried searching through the other files to no avail. Is there something I am missing here?
I would love if someone could shed some light.
Thank you
This is with a Teensy 3.2 so I am looking in
Arduino/Teensy IDE/hardware/teensy/avr/cores/teensy3/pins_teensy.c
I found the analogWrite function,
but there is a function analogWriteDAC0 I can't seem to find its source.
Code:
void analogWrite(uint8_t pin, int val)
{
uint32_t cval, max;
#if defined(__MK20DX256__)
if (pin == A14) {
uint8_t res = analog_write_res;
if (res < 12) {
val <<= 12 - res;
} else if (res > 12) {
val >>= res - 12;
}
[B]analogWriteDAC0(val);[/B]
return;
}
I use my IDE to find the declaration in core_pins.h
Code:
void analogWriteDAC0(int val);
I would love if someone could shed some light.
Thank you