1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-28 07:51:19 +01:00

drivers/periph_common: included I2C initialization

This commit is contained in:
Hauke Petersen 2017-02-08 13:21:06 +01:00 committed by dylad
parent 0dc02d9a97
commit 5e1467e747

View File

@ -20,6 +20,9 @@
* @}
*/
#ifdef MODULE_PERIPH_I2C
#include "periph/i2c.h"
#endif
#ifdef MODULE_PERIPH_SPI
#include "periph/spi.h"
#endif
@ -35,6 +38,13 @@
void periph_init(void)
{
/* initialize configured I2C devices */
#ifdef I2C_NUMOF
for (unsigned i = 0; i < I2C_NUMOF; i++) {
i2c_init(I2C_DEV(i));
}
#endif
/* initialize configured SPI devices */
#ifdef MODULE_PERIPH_SPI
for (unsigned i = 0; i < SPI_NUMOF; i++) {