Page 1 of 1
I2CConfig error : unknown type name 'I2CConfig'
Posted: Wed Jun 22, 2011 11:38 pm
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
Re: I2CConfig error : unknown type name 'I2CConfig'
Posted: Thu Jun 23, 2011 7:15 am
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=25The driver is experimental and not officially supported yet but the author is very helpful.
Giovanni
Re: I2CConfig error : unknown type name 'I2CConfig'
Posted: Mon Aug 06, 2012 6:51 pm
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.
Re: I2CConfig error : unknown type name 'I2CConfig'
Posted: Mon Aug 06, 2012 7:16 pm
by Giovanni
Is I2C enabled in halconf.h?
Giovanni
Re: I2CConfig error : unknown type name 'I2CConfig'
Posted: Tue Aug 07, 2012 2:56 am
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.