Hallo Freunde !

Wieder einmal bin ich bestimmt in die Anfängerfallstricke gelangt. Ein Versuch, für den PIC16F877A eine I2C Anwendung zu schreiben, will nicht gelingen. Ein DS1307 RTC Modul soll per I2C abgefragt werden.
Gerade als Anfänger bei den PICs und MPLABX & XC.8 Compiler bin, schreibe ich der Übersichtlichkeit gern Headerdateien bzw.separate Libraries.

Nun meckert der Compiler bei einer als "unsigned long" Variable die als Taktfrequenz des I"C Bus dienen soll.
Hier mal eine paar Codefetzen :

Code:
/**************************************************************************/
ol_i2c.h :

#ifndef _XTAL_FREQ
#define _XTAL_FREQ 4000000UL  //EasyPIC-40 FQ= 4.0MHz
#endif  //_XTAL_FREQ
extern const unsigned long I2C_CLK = 100000;    // Takt 100KHz (UL)
extern void   I2C_Init(const unsigned long c);  // c = Taktangabe in Hz
extern void   I2C_Wait();    
extern void   I2C_Start();
extern void   I2C_RepeatedStart();    
extern void   I2C_Stop();
extern void   I2C_Write(unsigned char d);
extern unsigned char I2C_Read(unsigned char a);

/***************************************************************************/
ol_i2c.c :

void I2C_Init(const unsigned long c)
{
  SSPCON = 0b00101000;           //SSP Module as Master
  SSPCON2 = 0;
  SSPADD = (_XTAL_FREQ/(4*c))-1;  //Setting Clock Speed
  SSPSTAT = 0;
  TRISC3 = 1;                   //Setting as input 
  TRISC4 = 1;                   //Setting as input 
}

/***************************************************************************/
ol_rtc_1307.h :


#define Ds1307Read          0xD1          // DS1307  in read mode
#define Ds1307Write         0xD0          // DS1307  in write mode
#define Ds1307ControlRegAddress 0x07      // DS1307 Controllregister
#define Ds1307SecondRegAddress  0x00      // SekundenRegAdresse
will ich jetzt davon Funktion/Routinen wie folgt benutzen :

Code:
/***************************************************************************/

ol_rtc_1307.c :

#include "ol_rtc_1307.h"
#include "i2c.h"
/* ========================================================================== */
/*                                                                            */
/*                        RTC-INIT                                            */
/*                                                                            */
/* ========================================================================== */
const unsigned long I2C_CLK = 100000;
int RTC_Init()
        {
            I2C_Init(I2C_CLK);                      // Initialize the I2C module.100000 = 100KHz
            I2C_Start();                            // Start I2C communication
            I2C_Write(Ds1307Write);                 // Connect to DS1307 
            I2C_Write(Ds1307ControlRegAddress);     // Select  the Ds1307 ControlRegister to configure Ds1307
            I2C_Write(0x00);                        // Write 0x00 to Control register to disable SQW-Out
            I2C_Stop();                             // Stop I2C communication after initializing DS1307
            return 0;
        }
/* ========================================================================== */
ergibt sich bei I2C_Init Zeile ein markierter Fehler, dessen Ursache ich einfach nicht herausfinden kann:

ol_rtc_1307.c:29: error: (1098 ) conflicting declarations for variable "RTC_Init" (ol_rtc_1307.c:28 )

Vielleicht kann mir wer bitte mal etwas weiter und auf die "Sprünge" helfen , was ich da falsch machen.

Gruss & Dank
Gerhard