From f5e284223d25ee5beab98de95cd74e3ac72a39a6 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Mon, 22 Jul 2019 23:04:17 +0200 Subject: Implement first superblink version --- software/first/setup_gpio.S | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 software/first/setup_gpio.S (limited to 'software/first/setup_gpio.S') diff --git a/software/first/setup_gpio.S b/software/first/setup_gpio.S new file mode 100644 index 0000000..39003b4 --- /dev/null +++ b/software/first/setup_gpio.S @@ -0,0 +1,19 @@ +.section .text +.align 2 +.global setup_GPIO +.include "memory_map.inc" +.include "gpio.inc" + +setup_GPIO: + addi sp, sp, -16 # Allocate stack frame + sw ra, 12(sp) # save return address to the stack + + li t0, GPIO_CTRL_ADDR # load base GPIO address + li t1, GPIO_RGB_PINS # get RGB offsets + sw t1, GPIO_OUTPUT_EN(t0) # enable output on the RGB pins + sw t1, GPIO_OUTPUT_XOR(t0) # set the RGB pins to active high + sw x0, GPIO_OUTPUT_VAL(t0) # set all pins to 0 + + lw ra, 12(sp) # load return address + addi sp, sp, 16 # deallocate stack frame + ret -- cgit v1.2.1-18-gbd029