Just starting with C and PWM

I was looking at the Timer1.h and Timer1.cpp code.

I need a PWM routine with 10 bit resolution. Eight bits is not enough.
Here is an example main routine:
/*

  • Timer1 library example
  • June 2008 | jesse dot tane at gmail dot com
    */

#include "TimerOne.h"

void setup()
{
pinMode(10, OUTPUT);
Timer1.initialize(500000); // initialize timer1, and set a 1/2 second period
Timer1.pwm(9, 512); // setup pwm on pin 9, 50% duty cycle
Timer1.attachInterrupt(callback); // attaches callback() as a timer overflow interrupt
}

void callback()
{
digitalWrite(10, digitalRead(10) ^ 1);
}

void loop()
{
// your program here...
}

I see that timer1.h is included, but where does Timer1.cpp ever get included into this? How does the compiler know?

I want to monitor a volt on a pin with analog read. Depending on the value I will lower or raise the duty cycle. Would I do this within a loop and call setPwmDuty(pin, duty) since I would have already setup the pwm parameter?

Gonna be hard to force a 10bit signal from an 8bit chip.

Doesn't this link
http://www.arduino.cc/playground/Code/Timer1

imply that the ATmega328 has a 16bit timer1?

Was not aware of that.

But it seams to me that you have to use 2 or more PWM pins to get the full 16 bit support. Or am i reading that wrong?

what about my question about the timer1.cpp file? how does this get into the program? I just see the #include timer1.h

As i understand it the timer1.h is all thats needed for the arduino. The .cpp file is for those programing there arduino in C++ and using other means to upload the code into the arduino.

The .cpp file is for those programing there arduino in C++

The .cpp is there to provide the class and methods prototyped in the .h.