hi Sir,
i am using I2C4 due to DMA clash of I2C2 with my SPI2.
When I switch to I2C4 , the compiler complain that the rccResetI2C4 and rccEnableI2C4 is missing.
I check the library file and found that only I2C1 to I2C3 are defined but not I2C4.
KIndly advise it is intentional of there is specific reason to omit I2C4.
Best Regards
Lau
I2C4 undefined stm_rxxh for STM32L4xx Topic is solved
- Giovanni
- Site Admin
- Posts: 14461
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: I2C4 undefined stm_rxxh for STM32L4xx
Some update :
I added in the three line of macro in STM32/STM32L4xx/stm32_rcc.h files.
It work fine now. I read the datasheet , it mention that this feature is only availabe in STM32L496xx/4A6xx devices , this may explain why does not appear in the stm32_rcc.h file as it is suppose to be generic , and this feature is only for "specific" series.
in any case , we should update it or protect it with some preprocessor define.
just my 2 cent of thoughts.
/**
* @brief Enables the I2C4 peripheral clock.
*
* @param[in] lp low power enable flag
*
* @api
*/
#define rccEnableI2C4(lp) rccEnableAPB1R2(RCC_APB1ENR2_I2C4EN, lp)
/**
* @brief Disables the I2C4 peripheral clock.
*
* @api
*/
+#define rccDisableI2C4() rccDisableAPB1R1(RCC_APB1ENR2_I2C4EN)
/**
* @brief Resets the I2C4 peripheral.
*
* @api
*/
#define rccResetI2C4() rccResetAPB1R1(RCC_APB1RSTR2_I2C4RST)
/** @} */
I added in the three line of macro in STM32/STM32L4xx/stm32_rcc.h files.
It work fine now. I read the datasheet , it mention that this feature is only availabe in STM32L496xx/4A6xx devices , this may explain why does not appear in the stm32_rcc.h file as it is suppose to be generic , and this feature is only for "specific" series.
in any case , we should update it or protect it with some preprocessor define.
just my 2 cent of thoughts.
/**
* @brief Enables the I2C4 peripheral clock.
*
* @param[in] lp low power enable flag
*
* @api
*/
#define rccEnableI2C4(lp) rccEnableAPB1R2(RCC_APB1ENR2_I2C4EN, lp)
/**
* @brief Disables the I2C4 peripheral clock.
*
* @api
*/
+#define rccDisableI2C4() rccDisableAPB1R1(RCC_APB1ENR2_I2C4EN)
/**
* @brief Resets the I2C4 peripheral.
*
* @api
*/
#define rccResetI2C4() rccResetAPB1R1(RCC_APB1RSTR2_I2C4RST)
/** @} */
- Giovanni
- Site Admin
- Posts: 14461
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Who is online
Users browsing this forum: No registered users and 4 guests