Commit Graph

139 Commits

Author SHA1 Message Date
Matt Knight
4180534400
Use root build for chips, hals, and boards (#162)
The reason behind this change is that I'm unable to specify a chip, hal,
or board definition in a local project and that's a pattern that we
explicitly want to handle. This means packages must provide an absolute
path to their files, which is already done throughout our small
ecosystem.

In the future I'd like to change the API so package creators or those
vendoring everything locally give a relative path.
2024-01-14 11:48:40 -08:00
Jacob Young
57e4379062
Update uf2 dependency (#160) 2023-11-28 07:58:44 -08:00
Sreehari Sreedev
8ac1db6574
packed struct => extern struct for USB (#159) 2023-11-21 15:19:54 -08:00
Jacob Young
c3baa4a277
Update dependencies and add paths (#158) 2023-11-20 12:48:34 -08:00
Prince Bett
f8a506ccc2
doc: add getting started tip (#156)
direct new users to microzig-examples for ease
the onboarding experience.
2023-11-06 20:13:50 +01:00
Marnix Klooster
2873e9e0b1
Change the HAL API to snake_case() from camelCase() (#151) 2023-10-26 12:29:28 -07:00
Ardelean Călin
f286bc8e25
Corrected Cortex-M ABI (#149) 2023-09-26 20:39:06 +02:00
Vesim
d361a622ba
add umm allocator (#148) 2023-09-26 08:57:22 -07:00
Felix Queißner
3bdb7381be
Microzig Generation 2 Build Interface (#144)
* Starts to rework build framework.
* Fully reworks build API, builds with RP2040 again.
* Adds docs and doc generation.
* Renames source to register_definitions, makes Target.configure optional.
* Adds issue tracking links.
* Drops CI for now

---------

Co-authored-by: Felix "xq" Queißner <git@random-projects.net>
2023-09-22 09:01:19 +02:00
L1ucas
f0a6aa9ce1
Fix README typo (#141) 2023-08-12 08:23:57 -07:00
Francisco Llobet
2859530ac2
Fixing issues in Build to achieve v0.11.0 compatibility (#140) 2023-08-05 08:43:06 -07:00
Matt Knight
0b3be0a4cc
Update README.adoc (#139) 2023-08-04 00:50:02 -07:00
Matt Knight
6ccee6d13a
build against 0.11.0 (#138)
* build against 0.11.0

* fix typo
2023-08-04 00:47:18 -07:00
Matt Knight
d4a48f65fa
anyopaque to u8 (#137) 2023-08-03 21:16:54 -07:00
Matt Knight
c1ac2f4cf3
FileSource -> LazyPath (#136) 2023-08-03 21:04:54 -07:00
Vesim
9392fe0f7b
Update to master and add system registers for cortex-m (#134)
* Update to zig 0.11.0-dev.3826+7a197f124

* Add cortex-m system registers
2023-06-27 15:38:29 -07:00
Felix Queißner
a49fad9730
Runs zig fmt (#133)
Co-authored-by: Felix "xq" Queißner <xq@random-projects.net>
2023-06-25 20:03:59 +02:00
Matt Knight
39bf0b5d55
update pr creation step (#131) 2023-06-03 08:06:03 -07:00
Pavel Burgr
3f8dd68f0d
Fix @call parameter for zig 0.11 (#130) 2023-06-03 06:52:07 -07:00
Nicolas Goy
9588941915
When adding an option, set it as app module dependency to make it available in the app root (#129) 2023-05-15 21:32:26 -07:00
binarycraft007
4e62e99e3c
update to zig master: use @memset, @memcpy builtin (#128)
Co-authored-by: Binary Craft <keep.it.sns@gmail.com>
2023-05-03 21:36:50 -07:00
Matt Knight
b5edf6da6b
interrupt enable/disable for riscv and air (#127)
* rename disable/enable interrupt functions

* enable/disable interrupt functions for avr and riscv

* add todo panic
2023-04-26 00:25:08 -07:00
Matt Knight
d1f1374c08
rename disable/enable interrupt functions (#126) 2023-04-26 00:09:45 -07:00
Philipp Wendel
658648b86b
Updated code to regz rewrite and added fix for i2c on ATmega328P (#125) 2023-04-25 07:55:53 -07:00
David Sugar
dd491cc84f
Abstract USB device implementation (#124) 2023-04-23 08:31:08 -07:00
Matt Knight
109249913b
check if the thread of execution is in an ISR on Cortex M (#123) 2023-04-16 12:47:52 -07:00
Matt Knight
ae6e619197
update to new usage of build api (#122) 2023-04-13 22:15:18 -07:00
Philipp Wendel
23482a6986
Updated parts of gpio and pin to reflect code changes from regz rewrite (#120) 2023-04-02 15:19:37 -07:00
Matt Knight
ceaa9ddcb0
fix link (#117) 2023-03-23 08:37:38 -07:00
Matt Knight
5b0176e977
specify which version of zig to use (#116) 2023-03-23 08:15:06 -07:00
Matt Knight
dabc9325cd
improvements from working on RP2040 (#115)
* improvements from working on RP2040

* fix missing file bug
2023-03-22 00:52:40 -07:00
Vesim
6f5b7268f6
Update to latest zig master (#114) 2023-03-19 14:25:54 -07:00
Jim Tittsler
15c5a92a3e
Fix typos (#113) 2023-03-18 10:16:44 -07:00
Matt Knight
08e7d5b01a
add check for void for microzig.hal (#112)
* add check for void for microzig.hal

* modify github actions to run on every push
2023-02-28 01:44:59 -08:00
Matt Knight
b6fc3abbf7
Mimic new stdlib build API (#111)
* start on new docs to match api

* tweak the MicroZig dependency tree

* use microzig_options

* remove empty.zig

* add test programs

* keep it to one arch, bump flash for debug
2023-02-28 01:14:06 -08:00
Matt Knight
11214ed8ba
new for loop syntax and remove import-module.zig (#110)
* new for loop syntax and recursive dependencies allowed for removal of import-module.zig

* fix chip standard path

* move to build.zig

* update template too
2023-02-24 08:25:18 -08:00
Matt Knight
831cfff35c
Add rest of hardware support libraries (#109)
Automerge action step doesn't work with this setup so we'll have to
manually merge
2023-02-20 11:07:47 -08:00
Matt Knight
4bb65617a4
automerge and PR description (#108) 2023-02-20 10:47:30 -08:00
Matt Knight
c244999bac
fix yaml (#107) 2023-02-20 10:17:38 -08:00
Matt Knight
417f8fa21f
Auto pr (#106)
* auto update downstream repos on pushes

* fix github actions

* add workflow dispatch and token
2023-02-20 10:13:25 -08:00
Matt Knight
2d0ee5c473
fix typo for interrupt creation function (#104) 2023-02-18 17:32:08 -05:00
Matt Knight
97ca5497da
Regz rewrite (#103)
* wip

* remove tools

* reorganized

* move hardware into their own repos

* snake_case

* use FileSource for board/chip/cpu descriptors

* are_globally_enabled -> globally_enabled

* rearrange
2023-02-18 11:25:38 -05:00
Vesim
9ccde9ff37
Update to latest zig with modules (#102) 2023-02-12 16:58:29 +02:00
Philipp Wendel
e63558330b
Catchup to changes introduced by ziglang/zig#14498 (#101) 2023-02-06 12:36:45 +01:00
Marnix Klooster
e1c1466d9e
Initial partial SPI support (#97)
* 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

* Make sure vector_table is correctly exported

It needs to be a non-`comptime` `var` for `@export` to work properly.

The only 'documentation' for this behavior currently seems GitHub comment
https://github.com/ziglang/zig/issues/5157#issuecomment-618933196 .

This issue was introduced in 1c17304 for PR #27,
which broke at least ARM-based STM32F303.

* fix missing vector table on ARM

* Revert "Merge branch 'fix-vector_table-export' into marnix-master"

This reverts commit 8ea0a74e1031cd0b88abe0283f179f0cf20f450c, reversing
changes made to 355a3618080d28c5da6e044773e6449989355fe5.

* Temp commit for SPI

* Check new I2C target_speed config setting

* Corrected incorrect doc comment

* Initial SPI transfer support for STM32F303

* SPI device CS pin is now used

* Revert accidentally committed debug flag.

* SPI: Add shorthands for 'register-based' devices.

* Additional fix to remove PE3 pin dependency

* SPI: Renames, comments, extracted device-specific code

Specifically,
top-level `Spi` is now `SpiBus`;
and the internal API has an additional `switchToDevice()`,
and receives `DeviceConfig` in more places.

* SPI device: Add `transceive()` method.

---------

Co-authored-by: Matt Knight <mattnite@protonmail.com>
2023-02-01 18:54:37 +01:00
Aidan Oldershaw
1c3e04baa1
Use root.std_options to override log behaviour (#99)
ziglang/zig#14181 changed the interface for overriding the log function.
Previously, you would define a public `root.log` function. Now, you
define a `root.std_options` namespace that has a `logFn` decl.

Signed-off-by: Aidan Oldershaw <aidan.oldershaw@gmail.com>
2023-01-16 19:38:49 +01:00
Felix Queißner
db78794f01
Adds social media preview. (#98)
Co-authored-by: Felix "xq" Queißner <xq@random-projects.net>
2023-01-05 11:48:00 +01:00
Matt Knight
4f0d25220e
catchup to self hosted (#96) 2022-12-28 12:50:50 -08:00
Connor Rigby
680b6282f3
stdlib: allow app to override the zig os layer (#93) 2022-12-22 14:05:31 -08:00
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>
2022-11-10 00:20:51 +01:00