mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #8327 from SeppoTakalo/i2c_guard
Guard Atmel RF driver build by DEVICE_I2Cpull/8192/merge
commit
06dffda530
|
@ -20,7 +20,7 @@
|
|||
#include "at24mac.h"
|
||||
#include "PinNames.h"
|
||||
|
||||
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI
|
||||
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_I2C
|
||||
|
||||
#include "NanostackRfPhy.h"
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
#include <string.h>
|
||||
|
||||
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI
|
||||
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_I2C
|
||||
|
||||
#include "platform/arm_hal_interrupt.h"
|
||||
#include "nanostack/platform/arm_hal_phy.h"
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
#include "at24mac.h"
|
||||
|
||||
#if DEVICE_I2C
|
||||
|
||||
/* Device addressing */
|
||||
#define AT24MAC_EEPROM_ADDRESS (0x0A<<4)
|
||||
#define AT24MAC_RW_PROTECT_ADDRESS (0x06<<4)
|
||||
|
@ -59,3 +61,5 @@ int AT24Mac::read_eui48(void *buf)
|
|||
return -1; //No ACK
|
||||
return _i2c.read(AT24MAC_SERIAL_ADDRESS, (char*)buf, EUI48_LEN);
|
||||
}
|
||||
|
||||
#endif /* DEVICE_I2C */
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
#define AT24MAC_H
|
||||
|
||||
#include "PinNames.h"
|
||||
|
||||
#if DEVICE_I2C
|
||||
|
||||
#include "I2C.h"
|
||||
#include "drivers/DigitalInOut.h"
|
||||
#include "platform/mbed_wait_api.h"
|
||||
|
@ -62,4 +65,5 @@ private:
|
|||
mbed::I2C _i2c;
|
||||
};
|
||||
|
||||
#endif /* DEVICE_I2C */
|
||||
#endif /* AT24MAC_H */
|
||||
|
|
Loading…
Reference in New Issue