Started with asm file io.s. Functions not implemented yet.

This commit is contained in:
T-moe
2016-01-31 15:39:08 +01:00
parent 2bc69baeb9
commit 121adfa3c9
3 changed files with 91 additions and 1 deletions

View File

@@ -37,7 +37,7 @@ LDFLAGS+=-Wl,--gc-sections -Wl,--defsym=malloc_getpagesize_P=0x1000
#Finding Input files
CFILES=$(shell find $(SOURCE_DIR) -name '*.c')
#CFILES=$(notdir $(wildcard $(SOURCE_DIR)/*.c))
SFILES=$(SOURCE_DIR)/startup.s
SFILES=$(shell find $(SOURCE_DIR) -name '*.s')
#Generate corresponding obj names
SOBJS=$(SFILES:.s=.o)

90
src/io.s Normal file
View File

@@ -0,0 +1,90 @@
//--------Local Functions ------------------
//void pin_create(pin_t* pin, GPIO_TypeDef* GPIO, uint8_t pinnr)
//R0: address to pin struct, R1: address to GPIO, R2: pinnr (1 byte). No return value
pin_create:
//TODO: Implement
end_pin_create:
//bool pin_get(pin_t* pin)
//R0: address to pin struct. Return value in R0 (1 byte)
pin_get:
//TODO: Implement
end_pin_get:
//-------Global Functions-------------------
//void io_init(void);
.global io_init
//No Parameters, No Return value
io_init:
//convention for idermiediate labels. io_init_<whatever>
//TODO: Implement
//BL pin_create (4x)
end_io_init:
//void io_process(void)
.global io_process
//No Parameters, No Return value
io_process:
//TODO: Implement
end_io_process:
//bool io_button_has_edge(uint8_t btnnumber)
.global io_button_has_edge
//R0: pin nr (1 byte), Return value in R0 (1 byte)
io_button_has_edge:
//TODO: Implement
end_io_button_has_edge:
//uint16_t read_adc()
.global read_adc
//No Parameters, Return value in R0 (halfword, 2bytes)
read_adc:
//TODO: Implement
end_read_adc:
//uint8_t read_switches()
.global read_switches
//No Parameters, Return value in R0 (1 byte)
read_switches:
//TODO: Implement
end_read_switches: