Functions not in reference

Hello people!

I am quite new to arduino and I am trying to figure out what a certain program I have downloaded works.
In particular I find in my code things such as:

ISR(TIMER2_OVF_vect) 
{
  RESET_TIMER2;
  
  switch (InterruptMode)
  {
     case TIMER_NOP:
      // Reload the timer counter with 191 - fine tunes /64 to give us the update frequency we need
      TCNT2=200;
      // Do nothing
     break;
     case TIMER_STEP1:
      // Reload the timer counter with 191 - fine tunes /64 to give us the update frequency we need
      TCNT2=200;
. . . etc...

or something such as:

  byte clr;
  pinMode(DATAOUT, OUTPUT);
  pinMode(SPICLOCK,OUTPUT);
  pinMode(SLAVESELECT,OUTPUT);

  digitalWrite(SLAVESELECT,HIGH); //disable device

  SPCR = (1<<SPE)|(1<<MSTR)|(1<<CPHA);
  clr=SPSR;
  clr=SPDR;
  delay(10);

My problem is that I can’t understand where these “SPCR - SPDR - SPSR - ISR(TIMER2_OVF_vetc)” are defined. . .
I can not find theme in my source code and I can’t find theme neither in the reference page:
http://arduino.cc/en/Reference/HomePage
So where does these keywords come from? And at which point is the ISR function called? I Can’t find it in the code!
Where can I find more info about this topics?

Thank you all

Mic

SP** are SPI registers.
Here is the SPI documentation: http://www.atmel.com/Images/doc2585.pdf

And ‘ISR’ reference:
http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html

Tensore79:
My problem is that I can't understand where these "SPCR - SPDR - SPSR - ISR(TIMER2_OVF_vetc)" are defined. . .

They're defined in Arduino.h (which is always included in your
program whether you added it or not)

They're NOT program variables, they refer to hardware registers on the CPU.

When you type "SPCR=5" you're putting the value 5 into the CPU's SPI control register.

The datasheet for the chip has all the details of what that will actually do - it might tell the SPI unit to send a byte of data (for example).

One reason they are not documented is that if you use such hardware registers directly you make your program non-portable - ie it will only work on say ATmega328-based hardware. The higher level Arduino interfaces/libraries are designed to be as hardware-independent as possible(*) and you are encouraged to stick to them unless you need the extra performance or facilities that direct hardware access can give.

Another reason they are not documented is to keep things nice and simple for newcomers and non-specialists - the details are hidden behind libraries for the most part.

(*) there is a limit to how hardware-independent you can be on a microcontroller of course - even moving between Uno and Mega involves obvious porting issues.