Modify program to suit Arduino UNO

I am trying to use a program that has been written for STM32F105_VC microprocessor [] for interfacing with a Time to Digital Converter TDC GP22 [] 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:,180067.0.html,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.

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) = ");
  b = !b;
  Serial.print("!b (bool) = ");

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

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'.