Modify program to suit Arduino UNO

I am trying to use a program that has been written for STM32F105_VC microprocessor [http://www.acam.de/fileadmin/Download/_software/TDC/GP22_main_AN034.c] for interfacing with a Time to Digital Converter TDC GP22 [http://www.acam.de/fileadmin/Download/pdf/UFC/English/DB_GP22_en.pdf] via SPI interface. I would like to use the same program and adapt it to suit Arduino Uno for interfacing with TDC GP22.

Can someone please suggest me the most effective way to do this ?

Other have tried to use it with the Arduino:
http://forum.arduino.cc/index.php/topic,180067.0.html
http://forum.arduino.cc/index.php/topic,178889.0.html

Changing the delays is simple. Use millis() an micros().
I think that Arduino uses 'boolean' instead of 'bool'.
You can change the printf into sending strings to the serial port.

But the SPI calls are the hardest to translate.

You have to rewrite every line that use low level SPI. I don't understand very well how the STM32F105 uses SPI, so I can't tell how to translate it.

Peter_n:
I think that Arduino uses ‘boolean’ instead of ‘bool’.

bool and boolean are both valid data types in C++. The Arduino can be programmed with C++, so it can use either data type.

Here’s a little sketch that shows the difference between bool and boolean

bool b;
boolean bn;

void setup() {
  Serial.begin(115200);     // opens serial port, sets data rate to 9600 bps

  Serial.println("Setting b to 5. Setting bn to 5");
  b = 5;
  bn = 5;

  Serial.print("b (bool) = ");
  Serial.println(b);
  b = !b;
  Serial.print("!b (bool) = ");
  Serial.println(b);

  Serial.print("bn (boolean) = ");
  Serial.println(bn);
  bn = !bn;
  Serial.print("!bn (boolean) = ");
  Serial.println(bn);
  Serial.println("-----------");
  
  Serial.println("\nThe following truth table is for values of -2, 0, and +2");
  Serial.println();
  for (int i = -2; i < 3; i += 2) {
    b = i;
    bn = i;
    Serial.print(b);
    if (b) {
      Serial.println("  b is true");
    }
    else {
      Serial.println("  b is false");
    }
    Serial.print(bn);
    if (bn) {
      Serial.println("  bn is true");
    }
    else {
      Serial.println("  bn is false");
    }
    Serial.println();
  }
}

void loop() {
}

Thanks, I didn't know that.
So a 'boolean' is a byte of any value. A value of non-zero is true.
And a 'bool' is converted on the fly to 0 (false) or 1 (true).

The Arduino reference shows only 'boolean'.

And the description is : "A boolean holds one of two values, true or false". That description is more suitable for the 'bool'.