140 Commits (724f4659b0f99cbff3eb874bd23e02c29df523c5)
 

Author SHA1 Message Date
Felix Queißner 31070c1530
Makes executable files never stripped, we want that sweet debug info. Makes empty.zig less empty, so the compiler finds the file. (#91)
Co-authored-by: Felix "xq" Queißner <xq@random-projects.net>
2 years ago
Felix Queißner 248388d6e8
Update README.adoc (#90) 2 years ago
Philipp Wendel 696c32ff0d
add arduino uno board (#89)
* Updated fn to return optional instead of error
* Added Arduino Uno Board
* Updated comments
2 years ago
hollmmax c5f68cae63
add stm3240g-eval board (#84) 2 years ago
Felix Queißner 0d9721d907
Adds microzig.initializeSystemMemories (#87)
Co-authored-by: Felix "xq" Queißner <xq@random-projects.net>
2 years ago
Felix Queißner 15bc1fc06d
Much improves the panic function, now prints a stack trace more often. (#86)
Co-authored-by: Felix "xq" Queißner <xq@random-projects.net>
2 years ago
Matt Knight 681b3b0d7a
added param to panic function (#83) 2 years ago
Matt Knight fa46be8ea2
Revert "Revert "Add executable method (addOptions, addObjectFile) and fix recursive call in addIncludePath (#79)" (#81)" (#82)
This reverts commit 4cc682cece.
2 years ago
David Sugar e280cca9b6
ATSAME51J20A chip (#78)
* Added some function wrappers to EmbeddedExecutable that expose commonly used functionalities of LibExeObjStep

* atsame51j20a chip added. GPIO support. UART support over SERCOM5.

* added support for true random numbers to atsame51j20a chip
2 years ago
Matt Knight 4cc682cece
Revert "Add executable method (addOptions, addObjectFile) and fix recursive call in addIncludePath (#79)" (#81)
This reverts commit bebf6cf92d.
2 years ago
Nicolas Goy bebf6cf92d
Add executable method (addOptions, addObjectFile) and fix recursive call in addIncludePath (#79) 2 years ago
Matt Knight 4159581b48
remove pointless discard (#80) 2 years ago
David Sugar 3617b8b25f
Added some function wrappers to EmbeddedExecutable that expose commonly used functionalities of LibExeObjStep (#77) 2 years ago
Vesim 20deb2cc3e
Allow to specify VectorTable in app and hal. (#76) 2 years ago
Matt Knight 68314b8f7e
use stage1 until stage3 is ready (#75) 2 years ago
Nicolas Goy e1244177fa
Add comment about microzig.config (#74)
* Add comment about microzig.config

When writing a HAL, having the chip name is very important to switch features and select pinout. Mention the config in the README in a concise manner.

Co-authored-by: Felix Queißner <felix@ib-queissner.de>
2 years ago
Nicolas Goy b8d92b2539
Make the microzig package public to allow it to be passed as dependency. (#73) 2 years ago
Matt Knight a2dd362ce7
Asciidoc (#71)
use asciidoc for the automatic toc
2 years ago
Matt Knight 0936dfb05c
improve build api (#70) 2 years ago
Matheus C. França d57f19c886
Gd32v Support (#21)
* Logan nano - board added

* Changes:
- replace baseline_rv32 to sifive_e21(imac)
- update registers.zig
- parsepin added (WIP)
- more riscv_encoding added

* refactoring

* fix build

* Missing interrupts

* minimal interrupt

* remove vectorTable

* skip interrupt test - riscv32

* remove supports_uart_test flag

* remove `supports_interrupt_test`
2 years ago
Matt Knight 0cde03507b
update github actions to reflect default branch name fix (#69) 2 years ago
Matt Knight aab147d431
only manage in-repo once it gets complicated (#68) 2 years ago
Matt Knight 231508bf23
move linux builds to buildkite (#67) 2 years ago
Marnix Klooster e5b8d57c72
Stm32f303 target speed trivial check (#66)
* Check new I2C target_speed config setting

* Corrected incorrect doc comment
2 years ago
Ethan Frei e60d59ce49
changing linker memory locations for stm32f103c8 (#65) 2 years ago
Matt Knight 6bc3fc094b
add hal or app level clock configuration (#62)
* add hal or app level clock configuration

* fix control flow and typo

* use hal.init(), thanks kuon for the improvement
2 years ago
Matt Knight e6d6ca7092
generate registers with known cpu (#63) 2 years ago
Matt Knight 179047ab65
fix colliding ISRs by making sure they each get memoized (#60)
* fix colliding ISRs by making sure they each get memoized

* add change from regz codegen
2 years ago
Riccardo Binetti a400e36058
I2C improvements (#58)
* i2c: pass a config to init

For now, allow setting the i2c target speed

* i2c: allow selecting the scl/sda pins

Similar to the previous commit for uart, this allows specifying the pins for
microcontrollers that support multiple pins for a single i2c peripheral

* stm32f407: add support for i2c

Supports using all I2C peripherals with all their pins in standard mode (fast
mode support will be added in the future).
2 years ago
Riccardo Binetti 7cf623aaf2
stm32f407: use the correct bus frequency to calculate usartdiv (#57)
USARTs 1 and 6 are clocked by APB2
2 years ago
Riccardo Binetti e202698a00
pin: remove erroneous access to slice length (#56)
The slice itself has to be used instead
2 years ago
Riccardo Binetti 5cf1a4612d
uart: allow selecting the tx/rx pins (#54)
Some microcontrollers allow routing multiple pins to the same UART peripheral.
This commit allows selecting specific pins on these platforms.
2 years ago
Riccardo Binetti 7cfc924eed
pin: omit board/chip namespace when parsing and saving the pin name (#55)
board: and chip: can be prefixed to the pin to force using a pin defined in the
board or in the chip. Currently though, neither chips or boards are handling
this prefix.
Since this is just used to give priority when parsing the pin, this commit
removes the namespace from the spec passed to parsePin. This isolates the
namespace handling to the Pin type creation, without having to handle it in
chips and boards.
2 years ago
Riccardo Binetti 8720973005
Add support for multiple clock domains (#53)
While this does not automate clock configuration yet, at least it allows using
microzig with applications that configure the clock themselves and then declare
the speeds of the various domains.
Without this, all peripheral depending on different clock domanins (e.g. Uart or
I2C on STM32 devices) could only work with the reset frequency.
2 years ago
Matt Knight ac19b7de8e
update to master (#52) 2 years ago
Felix Queißner 7fcaf17c46
Adds logo (#50)
* Creates logo with bright and dark variant
* Adds logo to README.md

Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
2 years ago
Felix Queißner 423c886d2e
Master update (#51)
* Adds logo

* Update to latest master.

Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
2 years ago
Matt Knight d253056c71
cortex-m0plus and fix for missing hal (#49) 2 years ago
Matt Knight c418db51f6
add hal package option (#48) 2 years ago
Vesim 8a3ec5ba02
Add vesim to LICENSE file (#47) 2 years ago
Matt Knight 58d090644b
Create LICENSE (#46) 2 years ago
Riccardo Binetti b9cd24ae96
Improve STM32F407 Uart and introduce GPIO Alternate Function (#44) 2 years ago
Riccardo Binetti 8b04413e55
Add Uart to STM32F4Discovery and rework uart-sync example (#43)
* stm32f407: add Uart support

* lpc1768: add cpu_frequency in board and chip

Allow using them with microzig Uart, which ensures the clock is present

* lpc1768: fix UART2 and UART3 peripheral clock register

They are in the PCLKSEL1 register, not PCLKSEL0

* uart-sync: use native microzig Uart, target different boards/chips

The previous example was lpc1768 specific, this new example should work with all
board and chips which implement the microzig Uart functionality. Instead of 4
LEDs, the new example uses a single LED to provide minimal debugging
capabilities if something does not work correctly.
This allows building this example for the stm32 f3 and f4 discovery boards.
2 years ago
Matt Knight c0e0423f5c
Readme (#40)
* add readme

* fix toc
3 years ago
Felix Queißner a6adc1d9da
Implements a generic gpio button driver with basic debouncing. (#41)
Co-authored-by: Felix "xq" Queißner <git@masterq32.de>
3 years ago
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