Skip to content

Commit c16d2c2

Browse files
committed
Implement software I2C driver
This driver implements I2C on the EV3 sensor ports for use with NXT and third-party peripherals.
1 parent 694f1ca commit c16d2c2

File tree

4 files changed

+536
-1
lines changed

4 files changed

+536
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ OBJCOPY = pru-objcopy
33
BUILD_TARGET = pru_ledpwm
44

55
ASFLAGS += -g
6-
CFLAGS += -g -Wall -Wno-main -Os
6+
CFLAGS += -g -Wall -Wimplicit-fallthrough -Wno-main -Os
77
LDFLAGS += -g -nostdlib -mmcu=am1808.pru1.specs
88

99
.PHONY: all clean

am1808.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@
6868
// Timer0 peripheral (only what we need)
6969
static volatile uint32_t * const TIMER0_TIM34 = (volatile uint32_t *)0x01C20014;
7070

71+
// Timer2 peripheral (only what we need)
72+
static volatile uint32_t * const TIMER2_TIM12 = (volatile uint32_t *)0x01F0C010;
73+
static volatile uint32_t * const TIMER2_INTCTLSTAT = (volatile uint32_t *)0x01F0C044;
74+
75+
#define TIMER_INTCTLSTAT_PRDINTSTAT12 (1 << 1)
76+
7177
// GPIO peripheral (only what we need)
7278
typedef struct gpio_bank_t {
7379
uint32_t dir;

0 commit comments

Comments
 (0)