Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ OBJCOPY = pru-objcopy
BUILD_TARGET = pru_ledpwm

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

.PHONY: all clean

all: $(BUILD_TARGET).bin

# Manual dependency tracking
main.o: am1808.h
main.o: am1808.h rproc_ev3_pru1.h

$(BUILD_TARGET).bin: $(BUILD_TARGET).elf

Expand Down
25 changes: 25 additions & 0 deletions am1808.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,32 @@
// 30 = Shared RAM 0x80nnnn00
// 31 = mDDR/DDR2 Data 0xC0nnnn00

extern volatile __regio_symbol unsigned int __R30;
extern volatile __regio_symbol unsigned int __R31;

// Timer0 peripheral (only what we need)
static volatile uint32_t * const TIMER0_TIM34 = (volatile uint32_t *)0x01C20014;

// Timer2 peripheral (only what we need)
static volatile uint32_t * const TIMER2_TIM12 = (volatile uint32_t *)0x01F0C010;
static volatile uint32_t * const TIMER2_INTCTLSTAT = (volatile uint32_t *)0x01F0C044;

#define TIMER_INTCTLSTAT_PRDINTSTAT12 (1 << 1)

// GPIO peripheral (only what we need)
typedef struct {
uint32_t dir;
uint32_t out_data;
uint32_t set_data;
uint32_t clr_data;
uint32_t in_data;
uint32_t set_ris_trig;
uint32_t clr_ris_trig;
uint32_t set_fal_trig;
uint32_t clr_fal_trig;
uint32_t intstat;
} gpio_bank_t;

static volatile gpio_bank_t * const GPIO_BANK_01 = (volatile gpio_bank_t *)0x01E26010;

#endif
Loading