Commit graph

532 commits

Author SHA1 Message Date
bunnie
efb627bf4f remove slice size specifier from blitstr2
this makes the api portable
2025-02-21 17:46:28 +08:00
bunnie
0770d5437f bring chat lib up to date with new ux-api layer 2025-02-21 17:46:11 +08:00
bunnie
27e4b77792 cleanup compile warning in cramium-api 2025-02-21 17:45:27 +08:00
bunnie
19f3221417 final changes to make ux-api platform-independent 2025-02-21 17:44:54 +08:00
bunnie
30c5876ad4 add missing apis/derives to minigfx to make it precursor-compatible 2025-02-21 17:43:50 +08:00
bunnie
07563c44db add precursor as a platform to ux-api 2025-02-21 17:43:23 +08:00
bunnie
5e258916da migrate graphics library API to a platform-neutral service crate
this kicks off an enormous set of refactoring changes...
2025-02-21 17:42:39 +08:00
bunnie
2ad0a58a56 remove redundant constants 2025-02-20 20:48:00 +08:00
bunnie
385e4198f2 accommodate movement of the opcode api 2025-02-20 20:39:28 +08:00
bunnie
fc8e7060a3 migrate opcodes out to an agnostic platform crate 2025-02-20 20:39:04 +08:00
bunnie
affe4e6c54 move APIs out of cramium-hal
So the organization of the code is now the following tiers:

libs/cramium-api: contains hardware-abstracted API code to the hardware
layers (traits, some constants, enums, etc.). For example, "here is
an IO trait that lets you configure and set GPIO pins", which could
then be implemented in hardware or emulation. The APIs aren't entirely
generic across all SoCs because they are tweaked to accommodate
quirks of the cramium SoC.

libs/cramium-hal: contains board-specific driver codes that do not
require persistent services to be started. Possibly misnamed because
it also includes not just cramium-chip items, but also e.g. peripherals
to the cramium SoC, such as the PMIC and camera.

services/cramium-hal-service: contains the `main` process that manages
shared resources, such as UDMA, IO pins, IFRAM. These drivers cannot
be delegated to a `lib` crate because there can be only one instance
of these resources, and instead we have to dynamically allocate
access to these through IPC messaging.

services/cramium-emu: hosted mode emulation of things in
cramium-hal-service.

services/bao-video: contains a `main` process that integrates
the camera and OLED driver. This means that all graphic drawing
primitives also interface with this crate. These are condensed
into a single process space to speed up execution, and kept
separate from cramium-hal-services because we want the video
services to not be blocked by, for example, a thread that is
handling I2C things.
2025-02-20 13:54:46 +08:00
bunnie
2235f7a3f1 clean up ux-api to be no-std clean
ux-api can't do rkyv derives and rely on std items in a
no-std environment. This is necessary because some of the
base layer APIs (frame buffers, points, etc.) are relied
upon in a no-std loader environment to render diagnostics
to the screen. Thus ux-api needs to have a baseline of
primitives available without a std flag.
2025-02-20 13:32:52 +08:00
bunnie
b33ca44e3b Complete move of cramium-emu from libs to services
I thought originally cramium-emu would be a library crate, but
actually, it makes more sense as a "services" crate. The APIs
that cramium-emu would live in cramium-api, and cramium-emu
itself is a bit closer to cramium-hal-service, filling in
the executable bits of code that allow emulation to run.
2025-02-20 13:30:55 +08:00
bunnie
9c4e7cabf6 add a "platonic" API crate for cramium
This is a distillation of cramium-hal items into "pure API"
items so that we can have a parallel cramium-emu crate.

The idea is that the API crate sits on top of both implementations;
the HAL goes to hardware, and EMU goes to hosted mode emulations.
2025-02-20 13:27:18 +08:00
bunnie
3afb01b04c add emulation HAL for cramium target
this is where we'll try to aggregate all the shims that allow
the target to work on hosted mode
2025-02-18 23:22:09 +08:00
bunnie
4872bbcee1 remove useless name argument in this version of the api 2025-02-18 23:20:48 +08:00
bunnie
f78d54a834 add configuration for doc build 2025-02-17 22:53:56 +08:00
bunnie
73114f8d8d clean up ux-api integration with blitstr2
a bunch of imports were in here that should be in blitstr2
let's test this out and see how well these abstractions hold up
as we configure the rest of the OS around it.
2025-02-17 18:27:55 +08:00
bunnie
b788ed6633 move blitstr2 to its own library
this allows us to share font data between platforms without
replicating the code base
2025-02-17 18:24:39 +08:00
bunnie
e1bc6eac56 remove copy of blitstr2 from ux-api; move blitstr2 to lib location 2025-02-13 17:41:07 +08:00
bunnie
ae856ecc82 start to add in skeletons of trait implementations for ux elements 2025-02-13 17:28:56 +08:00
bunnie
c28c1f989a add hosted option to cramium-hal 2025-02-13 17:27:45 +08:00
bunnie
0bfb864873 add boasec to font feature selection; prepare for moving blitstr crate 2025-02-13 17:26:54 +08:00
bunnie
6e18096247 ux-api needs to have the board specified when cramium features are selected 2025-02-11 16:25:22 +08:00
bunnie
c2c1c8bc91 update top level libs and cargo for all the ported-in files 2025-02-11 16:24:51 +08:00
bunnie
f7193ae29c port in more helper routines 2025-02-11 16:24:30 +08:00
bunnie
3890008af1 make platform directory for graphics
trying to keep it as platform neutral as possible but it seems
we need to be able to know the size of the framebuffer at least
2025-02-11 16:23:45 +08:00
bunnie
5ed3f41bea add blitstr to the minigfx lib 2025-02-11 16:23:26 +08:00
bunnie
2a4d91d9be expand primitives in minigfx library 2025-02-11 16:23:06 +08:00
bunnie
79fae48bd8 add widget scaffolds 2025-02-11 16:22:50 +08:00
buncram
9cdb967741 add widgets to ux-api 2025-02-11 08:33:42 +08:00
buncram
69baf0f6e8 some initial notions of what widgets might look like 2025-02-11 08:33:09 +08:00
bunnie
e4646013d0 remove minigfx from the HAL aspect of cramium
it was sort of out of place there anyways...
2025-02-02 07:02:07 +08:00
bunnie
19de313067 add ux-api
ux-api is meant to be a platform-independent set of APIs for
elements involving UX interchange in xous. In particular, it
sets up the path for portability of the gfx/minigfx crates and modals.
2025-02-02 07:00:24 +08:00
bunnie
4f14a67504 formatting changes due to changes in nightly rust
needed to get a clean check on gh
2025-02-01 22:26:40 +08:00
bunnie
43bc35b26e modify i2c reset condition to have wait states
this is necessary because the cpu can easily outrun the udma
block as the reset is processing, causing the re-initialization
to fail.
2025-01-30 04:17:57 -08:00
bunnie
b02112b05a fix reset conditions and straggler debug statements 2025-01-03 04:05:51 +08:00
bunnie
fa3550a30f add trait for setting IRQ on GPIO 2025-01-03 04:04:45 +08:00
bunnie
7f8f64e1be add routine to set irq pin for PMIC to board description file 2025-01-03 04:03:31 +08:00
bunnie
0953eac2ef cleanup warnings 2025-01-03 04:01:15 +08:00
bunnie
68759073ef configure the IRQ input 2024-12-27 20:01:32 +08:00
bunnie
86afe7ca0a add APIs to configure PMIC IRQs 2024-12-27 20:01:10 +08:00
bunnie
5aac426b0b more deep API cleanup
realizing a bunch of stuff like the stack expects you to enqueue
the OUT receiver with calls to read() that happen to block, fixing
max packet size that can be different for in and out end points,
and handling quirks of the core when sending setup packets longer than
64 bytes.
2024-12-23 01:18:03 +08:00
bunnie
c044b3481d beginning of breaking change to the cramium usb hal implementation
the UsbBus implementation is being totally rewritten for the
inside-out IRQ protected scheme.

we can now get past some preliminaries in the link protocol
(i.e., address setting and the first config descriptor), but
a long way to go still in debugging.
2024-12-22 00:36:57 +08:00
bunnie
9a1a6271c5 add debugging configuration features 2024-12-22 00:36:33 +08:00
bunnie
e8fd388ae9 add support for paged mode debugging
we have to allocate the virtual page in our process space before
we can use the debug UART.
2024-12-22 00:34:16 +08:00
bunnie
6625e45dd2 remove a debug print that causes the uart to be claimed prematurely
the uart in the shared library is claimed by the first process
that touches it, so prints in the shared library at early boot have
to be carefully configured
2024-12-22 00:33:16 +08:00
bunnie
45a8eb2227 stage tomls for version bump: try_send added to xous-ipc 2024-12-16 18:50:11 +08:00
bunnie
f5cae8b975 add visibility for third-party IRQ implementation
Had to promote the visibility of a bunch of event handler
structures so we can put an IRQ handler outside of the core
USB crate.
2024-12-16 18:02:01 +08:00
bunnie
5d35dee4f6 final i2c changes based on sim results 2024-12-11 04:05:24 +08:00