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:
parent
0dc02d9a97
commit
5e1467e747
@ -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++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user