445 Commits (096fda843a2ddb5db006b573afe946819a8bdce8)
 

Author SHA1 Message Date
Riccardo Binetti 873e5995b6
Add initial support for the stm32f429idiscovery eval board (#38)
* Add stm32f429 registers

Generated using regz with:

./regz STM32F429.svd > registers.zig

Using this SVD:

871761af63/data/STMicro/STM32F429.svd

* Add initial support for the stm32f429idiscovery eval board

Blinky example working on the board
3 years ago
Felix Queißner f317ce0c9f
More improvements (#37)
* Makes AVR UART work.
* Some comment. This is definitly not padding.
* Exports panic, log and log_level from application.
* Implements generic quadrature decoder driver.
* Fixes `@export` bug in AVR interrupt logic. Now we get distinct interrupt vectors.

Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
3 years ago
Felix Queißner d3c539e35b
Avr fixes (#36)
* Makes AVR UART work.

Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
3 years ago
Riccardo Binetti 97733da9e2
Add initial support for the stm32f4discovery eval board (#35)
* Add stm32f407 registers

Generated using regz with:

./regz STM32F407.svd > registers.zig

Using this SVD:

871761af63/data/STMicro/STM32F407.svd

* Add initial support for the stm32f4discovery eval board

The blinky example is working on the board
3 years ago
Marnix Klooster 04bf2c4d4a
Initial I2C support (#26)
* build.zig: Trivial rename around UART test

* mmio: Add writeRaw() to set a full register

* UART: Add TODO for auto baud rate detection

* STM32F30x Initial USART1 output/transmit support

All code assumes default chip clock configuration.
Code assumes STM32F303xB / STM32F3030xC.
Code supports only 8 data bits, 1 stop bit.

* stm32f3discovery @panic() to UART1

This is done by implementing `debugWrite()` for the board,
which only initializes UART1 if that was not yet done,
and flushes afterwards to make sure the host receives all.

* stm32f303: Support UART1 reader

This is done by implementing `rx()` and `canRead()`.

* stm32f303 UART1 correctly support 7 and 8 bits

This includes correctly masking the parity bit
on reads.

* stm32f3 UART1 support 0.5/1.5/2 stop bits

* stm32f303 UART1 simplify parity code

* stm32f303 I2C rough initial code

Allows only writing and reading single bytes.

* stm32f3 i2c: enable debug 'logging'

* Add a few comments

* I2C API changes, STM32F303 I2C multi-byte transfers

Now using controller/device terminology, instead of master/slave.

Now using 'transfer objects' to make STOPs and re-STARTs explicit,
and allow using Writer and Reader APIs.

Added 'register' abstraction.

STM32F303 I2C now supports this new API, and multi-byte transfers.

Now waiting for I2C_ISR.BUSY == 0, after setting I2C_CR2.STOP == 1.
Without this, the sequence write-stop-write caused an additional STOP
to be sent immediately the START and address of the second write.

* Make work with regz-generated registers.zig change

* Updated to match regz-generated update

* After #23 repair Reset on stm32, lpc1768

* Clean-up I2C `readRegisters()`.

* Refactor to separate read/write states

* On STM32F303, make second read call fail

Also doc comments to clarify the new API.

* STM32 I2C: Properly support multiple write calls

* I2C STM32: Fix release mode compile error

...on top of an earlier commit on this branch.

* I2C Add 'write register' shorthand functions
3 years ago
Matt Knight ba8feaed74
fix missing vector table on ARM (#34) 3 years ago
Matt Knight e44d8bf576
use the 'Signal' calling convention by default on AVR for ISRs, allow to explicitly use signal or interrupt calling conventions (#32) 3 years ago
Matt Knight 4384c5e9fa
use interrupt calling convention for avr (#31) 3 years ago
Felix Queißner e639dc7983
panic exporting is no longer needed. (#30)
Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
3 years ago
Matt Knight b2793e2589
Avr interrupt overloading (#29)
* mostly implemented, need different patch in order to wire it in

* add generated code

* turned interrupts back on

* fix symbol names for avr

* export in cpu file

* Emits a function instead of a `void` symbol.

* add interrupt test to avr

* Removes invalid comment.

Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
3 years ago
Felix Queißner 823ff6577f
Greatly simplifies the package logic by using a proxy-to-root package. (#28)
* Greatly simplifies the package logic by using a proxy-to-root package.

* Makes startup logic less obscure.

Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
3 years ago
Felix Queißner 1c1730445c
Brings AVR up to date (blink builds and blinks again! (#27)
* Brings AVR up to date (blink builds and blinks again!

* Fixes vector tables and build.

Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
3 years ago
Felix Queißner 5050ce5eb0
Diverse fixes (#25)
* Makes default panic uses logging facilities to print the panic message.

* Makes MMIO functions inline for better codegen

* Brings LPC1768 up to date.

Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
3 years ago
Marnix Klooster 92a2922742
stm32f3discovery/stm32f303 Initial UART1 support, including @panic() (#20)
* build.zig: Trivial rename around UART test

* mmio: Add writeRaw() to set a full register

* UART: Add TODO for auto baud rate detection

* STM32F30x Initial USART1 output/transmit support

All code assumes default chip clock configuration.
Code assumes STM32F303xB / STM32F3030xC.
Code supports only 8 data bits, 1 stop bit.

* stm32f3discovery @panic() to UART1

This is done by implementing `debugWrite()` for the board,
which only initializes UART1 if that was not yet done,
and flushes afterwards to make sure the host receives all.

* stm32f303: Support UART1 reader

This is done by implementing `rx()` and `canRead()`.

* stm32f303 UART1 correctly support 7 and 8 bits

This includes correctly masking the parity bit
on reads.

* stm32f3 UART1 support 0.5/1.5/2 stop bits

* stm32f303 UART1 simplify parity code

* Make work with regz-generated registers.zig change

* After #23 repair Reset on stm32, lpc1768
3 years ago
Marnix Klooster d4120f9c99
After #23 repair Reset on stm32, lpc1768 (#24) 3 years ago
Matt Knight 74e22672d0
use register code generated by regz (#23) 3 years ago
Matt Knight 13f0a1e347
instantiate vector table in start.zig (#22) 3 years ago
Matt Knight 8a5ee67588
register arrays and clusters, nrf52 as well (#19)
* register arrays and clusters, nrf52 as well

* remove TODO comment
3 years ago
Matt Knight 6b85ecfdcf
cortex-m3 set to thumb isa (#17) 3 years ago
Matt Knight c34d8b73d5
interrupt generation for chips (#16) 3 years ago
Matt Knight 152db2ae5f
no need to make the interrupt the .Naked calling convention (#15) 3 years ago
Matt Knight 0124a14773
Add interrupt declaration to cortex-m microcontrollers (#14)
Co-authored-by: Vesim <vesim809@pm.me>
3 years ago
Matt Knight 23eb8d5658
add packages to your embedded app (#13) 3 years ago
Matt Knight 38110fb3bd
calculate end-of-stack value from chip configs (#12) 3 years ago
Marnix Klooster 1b5cc2ad1f
Support STM32F3DISCOVERY board (#11)
* Support disabling UART test configs

* `zig build [install]` also builds .bin files

* Support one blinking LD3 on STM32F3DISCOVERY board

These changes were mostly copied from the stm32f103 already there.

But this is far from complete, many shortcuts were taken:

- Most importantly,
  only a single LED on the board, and its port/pin, is supported,
  viz. the 'north' LD3 on bit 9 of GPIOE.

- Setting RCC_AHBENR bit IOPEEN ("I/O port E clock enable") is done
  at the same as setting the mode (input or output) on one of its pins.
  No idea if that is the right place to do this.

- In cortex-m4.zig, using 'max ram' as the initial stack pointer.
  The rest is completely copied from cortex-m3.zig.

- UART test is disabled.
  (It seems to assume mbed-lpc1768 pin numbers.)

* Nicer initial stack pointer: exactly after RAM

* Fix build error

(How was this code working earlier?!?)

* stm32f30x: Allow all 16 pins, all GPIOx registers

* STM32F3DISCOVERY: map all LED pins
3 years ago
Matt Knight f46c2e4ea9
Microzig as pkg (#10)
* works as a package

* run zig fmt on all files
3 years ago
Matt Knight 46a924234e
add stm32f103 registers and reorganize so that microzig can be used as a package (#9) 3 years ago
Matt Knight 5a1e72f380
Create LinkerscriptStep (#7)
* create linkerscript step

* catch up to master, do some cleanup

* remove references to micro_linker

* commas

* remove package

* use root path trick for cpus and chips

* remove duped file
3 years ago
Matthew Knight af7aa777f9
Freshen things up (#6)
* catch up to some of master's changes, getting prepped to anchor to 0.9.0

* found fix for lpc board
3 years ago
Vesim 2a6bedfcca
Update README.md 3 years ago
Vesim eedc689738 Move lpc1768 to new generated SVD 3 years ago
Vesim 74641abbf0 [svd2zig] Fix handling og non-exhaustive enums and resverd fields 3 years ago
Vesim a4416fd2b7 [svd2zig] Add enumeration supports and fix bug for registers without fields 3 years ago
Felix (xq) Queißner 196c4c4d05 mbed LPC1768 only commit. This introduces a working UART abstraction for LPC1768, currently the uart-sync example has chip-related code in it. 3 years ago
Felix (xq) Queißner 294cfebf7a Makes UART compile for LPC1768. 3 years ago
Felix (xq) Queißner deb9c3fe03 Designs the basic uart frontend. 3 years ago
Felix (xq) Queißner f5bc3be1ae Introduces the first SVD generated binding for LPC1768. svd2zig contains a hack for missing register sizes. 3 years ago
Felix (xq) Queißner 1aad7b52f6 Ports over sbi, cbi to avr5.zig. 3 years ago
Felix (xq) Queißner 284d19814d Implements blinky for AVR. 3 years ago
Felix (xq) Queißner 26681f7b30 blinky works for lpc1768 3 years ago
Felix (xq) Queißner 6cdf641f32 Continues blinky setup. 3 years ago
Felix (xq) Queißner e68a282981 Implements (untested) startup for AVR and LPC1768. 3 years ago
Felix (xq) Queißner bbfdb421d8 File structure, draft 1 3 years ago
Felix Queißner e32d230c07
Create thoughts.md 3 years ago
Vesim f6037c77e2 initial commit 4 years ago