Skip to content

Commit 884aa3e

Browse files
committed
Update Wire_nRF52.cpp
I2c for nrf52810/11
1 parent ceaea21 commit 884aa3e

File tree

1 file changed

+47
-6
lines changed

1 file changed

+47
-6
lines changed

libraries/Wire/Wire_nRF52.cpp

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "nrf.h"
2222

23-
#if defined(NRF52_SERIES)
23+
#if defined(NRF52_SERIES) || defined(NRF52805_XXAA) || defined(NRF52810_XXAA) || defined(NRF52811_XXAA) || defined(NRF52840_XXAA)
2424

2525
extern "C" {
2626
#include <string.h>
@@ -400,18 +400,59 @@ void TwoWire::onService(void)
400400
_p_twis->TASKS_STOP = 0x1UL;
401401
}
402402
}
403+
#if defined(NRF52811_XXAA)
404+
TwoWire Wire(NRF_TWIM0, NRF_TWIS0, TWIM0_TWIS0_TWI0_SPIM1_SPIS1_SPI1_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL)
405+
#if WIRE_INTERFACES_COUNT > 0
406+
extern "C"
407+
{
408+
void TWIM0_TWIS0_TWI0_SPIM1_SPIS1_SPI1_IRQHandler(void)
409+
{
410+
Wire.onService();
411+
}
412+
}
413+
#endif
403414

404-
TwoWire Wire(NRF_TWIM1, NRF_TWIS1, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL);
415+
#elif defined(NRF52805_XXAA)
405416

406-
#if WIRE_INTERFACES_COUNT > 0
407-
extern "C"
417+
TwoWire Wire(NRF_TWIM0, NRF_TWIS0, TWIM0_TWIS0_TWI0_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL);
418+
419+
#if WIRE_INTERFACES_COUNT > 0
420+
extern "C"
421+
{
422+
void TWIM0_TWIS0_TWI0_IRQn_IRQHandler(void)
423+
{
424+
Wire.onService();
425+
}
426+
}
427+
#endif
428+
#elif defined(NRF52810_XXAA)
429+
TwoWire Wire(NRF_TWIM0, NRF_TWIS0, TWIM0_TWIS0_TWI0_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL);
430+
#if WIRE_INTERFACES_COUNT > 0
431+
extern "C"
408432
{
409-
void SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler(void)
433+
void TWIM0_TWIS0_TWI0_IRQHandler(void)
410434
{
411435
Wire.onService();
412436
}
413437
}
414-
#endif
438+
#endif
439+
440+
441+
442+
#else
443+
444+
TwoWire Wire(NRF_TWIM1, NRF_TWIS1, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL);
445+
446+
#if WIRE_INTERFACES_COUNT > 0
447+
extern "C"
448+
{
449+
void SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler(void)
450+
{
451+
Wire.onService();
452+
}
453+
}
454+
#endif
455+
#endif //defined(NRF52805_XXAA)
415456

416457
#if WIRE_INTERFACES_COUNT > 1
417458

0 commit comments

Comments
 (0)