Skip to content

Commit

Permalink
library mcu according to e4thcom convention
Browse files Browse the repository at this point in the history
  • Loading branch information
TG9541 committed Aug 5, 2017
1 parent 964af56 commit 3bc84af
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ifeq ($(BOARD),)
all: zip

zip: build
find out/ -name "*.ihx" -print | zip -r out/stm8ef-bin docs/words.md lib/* -@
find out/ -name "*.ihx" -print | zip -r out/stm8ef-bin docs/words.md mcu/* lib/* -@

build: words
make BOARD=CORE
Expand Down
12 changes: 0 additions & 12 deletions lib/regs/awu.fs

This file was deleted.

12 changes: 0 additions & 12 deletions lib/regs/opt.fs

This file was deleted.

16 changes: 0 additions & 16 deletions lib/regs/timer1.fs

This file was deleted.

10 changes: 10 additions & 0 deletions mcu/bit.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
\ STM8S assembly words
\ (c) TG9541, refer to license at github.com/TG9541/stm8ef

: bit! ( b a c -- )
rot 0= 1 and swap 2* $10 + + $72 c, c, ,
; immediate

: bres ( a c -- ) [ 0 ] [compile] bit! ; immediate

: bset ( a c -- ) [ 1 ] [compile] bit! ; immediate
6 changes: 6 additions & 0 deletions mcu/regs_awu.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
\ STM8S103 AWU register words - immediate
\ (c) TG9541, refer to license at github.com/TG9541/stm8ef/

: AWU_CSR1 $50F0 ; IMMEDIATE \ AWU control/status1 (0x00)
: AWU_APR $50F1 ; IMMEDIATE \ AWU asynch. prescaler buf. (0x3F)
: AWU_TBR $50F2 ; IMMEDIATE \ AWU timebase selection (0x00)
10 changes: 10 additions & 0 deletions mcu/regs_opt.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
\ STM8S option register words - immediate
\ (c) TG9541, refer to license at github.com/TG9541/stm8ef

: OPT0 $4800 ; IMMEDIATE
: OPT1 $4801 ; IMMEDIATE
: OPT2 $4803 ; IMMEDIATE
: OPT3 $4805 ; IMMEDIATE
: OPT4 $4807 ; IMMEDIATE
: OPT5 $4809 ; IMMEDIATE
: FLASH_CR2 $505B ; IMMEDIATE
8 changes: 8 additions & 0 deletions mcu/regs_portc.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
\ STM8S103 PORTC register words - immediate
\ (c) TG9541, refer to license at github.com/TG9541/stm8ef/

: PC_ODR $500A ; IMMEDIATE \ Port C data output latch (0x00)
: PC_IDR $500B ; IMMEDIATE \ Port C input pin value (0xXX)
: PC_DDR $500C ; IMMEDIATE \ Port C data direction (0x00)
: PC_CR1 $500D ; IMMEDIATE \ Port C control 1 (0x00)
: PC_CR2 $500E ; IMMEDIATE \ Port C control 2 (0x00)
11 changes: 11 additions & 0 deletions mcu/regs_spi.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
\ STM8S103 SPI register words - immediate
\ (c) TG9541, refer to license at github.com/TG9541/stm8ef/

: SPI_CR1 $5200 ; IMMEDIATE \ ($00)
: SPI_CR2 $5201 ; IMMEDIATE \ ($00)
: SPI_ICR $5202 ; IMMEDIATE \ ($00)
: SPI_SR $5203 ; IMMEDIATE \ ($02)
: SPI_DR $5204 ; IMMEDIATE \ ($00)
: SPI_CRCPR $5205 ; IMMEDIATE \ ($07)
: SPI_RXCRCR $5206 ; IMMEDIATE \ ($00)
: SPI_TXCRCR $5207 ; IMMEDIATE \ ($00)
15 changes: 15 additions & 0 deletions mcu/regs_timer1.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
\ STM8S103 Timer1 register words - immediate
\ (c) TG9541, refer to license at github.com/TG9541/stm8ef/

: TIM1_CR1 $5250 ; IMMEDIATE
: TIM1_CCMR1 $5258 ; IMMEDIATE
: TIM1_CCMR2 $5259 ; IMMEDIATE
: TIM1_CCMR3 $525A ; IMMEDIATE
: TIM1_CCER1 $525C ; IMMEDIATE
: TIM1_CCER2 $525D ; IMMEDIATE
: TIM1_PSCRH $5260 ; IMMEDIATE
: TIM1_ARRH $5262 ; IMMEDIATE
: TIM1_CCR1H $5265 ; IMMEDIATE
: TIM1_CCR2H $5267 ; IMMEDIATE
: TIM1_CCR3H $5269 ; IMMEDIATE
: TIM1_BKR $526D ; IMMEDIATE

0 comments on commit 3bc84af

Please sign in to comment.