first post here I think!
I have a Raspberry Pi and a tea5767 (Philips FM radio receiver which works over I2C)
I have Installed the wiringPi library and it is detecting my tea5767 as 0x60
pi@raspberrypi ~ $ cd wiringPi
pi@raspberrypi ~/wiringPi $ gpio load i2c
pi@raspberrypi ~/wiringPi $ gpio i2cd
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi ~/wiringPi $
Now I have a simple sketch working on my Arduino, i'd like to get going under WiringPi
==============
#include <Wire.h>
unsigned char frequencyH = 0;
unsigned char frequencyL = 0;
unsigned int frequencyB;
double frequency = 0;
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void loop()
{
frequency=99.3; //starting frequency
frequencyB=4*(frequency*1000000+225000)/32768; //calculating PLL word
frequencyH=frequencyB>>8;
frequencyL=frequencyB&0XFF;
delay(100);
Wire.beginTransmission(0x60); //writing TEA5767
Wire.write(frequencyH);
Wire.write(frequencyL);
Wire.write(0xB0);
Wire.write(0x10);
Wire.write(0x00);
Wire.endTransmission();
}
===============================
I'm trying to rewrite it in C as below but it's not working i know i'm 90% there . Any ideas would be much appreciated

#include <wiringPi.h>
#include <wiringPiI2C.h>
#include <stdio.h>
#include <stdlib.h>
int main (void){
printf ("RPi - tea5767 Philips FM Tuner v0.1 \n") ;
unsigned char test[5] ={0};
int fd,e;
int dID = 0x60;
unsigned char frequencyH = 0;
unsigned char frequencyL = 0;
unsigned int frequencyB;
double frequency = 99.3;
frequencyB=4*(frequency*1000000+225000)/32768; //calculating PLL word
frequencyH=frequencyB>>8;
frequencyL=frequencyB&0XFF;
printf ("Frequency = ");
printf("%f",frequency);
printf("\n");
printf ("FrequencyB = ");
printf("%u",frequencyB);
printf("\n");
printf ("FrequencyH = ");
printf("%u",frequencyH);
printf ("FrequencyL = ");
printf("%u",frequencyL);
printf("\n");
// data to be sent
test[0]=frequencyH; //FREQUENCY H
test[1]=frequencyL; //FREQUENCY L
test[2]=0xB0; //3 byte (0xB0): high side LO injection is on,.
test[3]=0x10; //4 byte (0x10) : Xtal is 32.768 kHz
test[4]=0x00; //5 byte0x00)
printf("Info to send = ");
//printf("%u",test);
printf("%u", (unsigned int)test);
printf("\n");
//int wiringPiI2CSetup (int devId) ;
if((fd=wiringPiI2CSetup(dID))<0){
printf("error opening i2c channel\n\r");
}
//int wiringPiI2CWrite (int fd, int data) ;
;
if((e=wiringPiI2CWrite(fd,test))<0){
printf("error writing to slave\n\r");
}
return 0;
}