I2CConfig error : unknown type name 'I2CConfig'

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Cyrille
Posts: 26
Joined: Sun May 15, 2011 7:55 pm

I2CConfig error : unknown type name 'I2CConfig'

Post by Cyrille »

Hi,
I have the following error during compilation : "unknown type name 'I2CConfig'"

Code: Select all

#include "ch.h"
#include "hal.h"
#include "Init.h"
....
static I2CConfig i2ccfg = {0,0b100100,180,37};


I have tried to include i2c.h and i2c_lld.h but I have the same error message (the I2CConfig typedef struct is defined in i2c_lld.h)

I don't understand where is the pb.

I use ChibiOS 2.2.0 on STM32 platform.

Thanks
Cyrille
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: I2CConfig error : unknown type name 'I2CConfig'

Post by Giovanni »

Hi,

The I2C driver is not implemented in version 2.2.x, there is an experimental driver on a development branch, if you want to experiment with it please read this thread:

viewtopic.php?f=3&t=25

The driver is experimental and not officially supported yet but the author is very helpful.

Giovanni
lawrenceais
Posts: 4
Joined: Wed Aug 01, 2012 6:22 pm

Re: I2CConfig error : unknown type name 'I2CConfig'

Post by lawrenceais »

Hello,
I got similar error in 2.4.2. Does it support i2c?

When I try to define the i2c constant, it come out this error.

Code: Select all

/* I2C interface #1 */
static const I2CConfig i2cfg1 = {
    OPMODE_I2C,
    400000,
    FAST_DUTY_CYCLE_2,
};

----------------------------------
Error[Pe020]: identifier "I2CConfig" is undefined D:\svn\RTOS\chibios\tags\ver_2.4.2\demos\ARMCM4-STM32F407-DISCOVERY\main.c 117
----------------------------------

I try to add these 2 files in platform(os/hal/platform/i2c_lld.h. i2c_lld.c). It did not help.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: I2CConfig error : unknown type name 'I2CConfig'

Post by Giovanni »

Is I2C enabled in halconf.h?

Giovanni
lawrenceais
Posts: 4
Joined: Wed Aug 01, 2012 6:22 pm

Re: I2CConfig error : unknown type name 'I2CConfig'

Post by lawrenceais »

oh.....halconf.h .....


Code: Select all

/**
 * @brief   Enables the I2C subsystem.
 */
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
#define HAL_USE_I2C                 TRUE
#endif


Change this to TRUE and make it work. Thank you.
Post Reply