Commit graph

436 commits

Author SHA1 Message Date
bunnie
2cb3bbf780 add SE0 pin setup 2024-10-12 00:46:15 +08:00
bunnie
701170e7e7 make device opening fallible 2024-10-12 00:45:53 +08:00
bunnie
37e82f1662 add ticktimer ref to cramium-hal
this is needed for delays in Xous mode - the camera requires
some dead-reckoned delays between i2c writes and reads
2024-10-10 02:07:15 +08:00
bunnie
7bd9e2b86b add camera pins & ifram spec 2024-10-10 02:04:49 +08:00
bunnie
552096d2a0 add prelim ov2640 driver 2024-10-10 02:04:22 +08:00
bunnie
091082dfcc add a clear routine for the sh1107 frame buffer 2024-10-10 02:03:59 +08:00
bunnie
2d8747605c promote visibility of some udma config constants 2024-10-10 02:03:37 +08:00
bunnie
c001b2759e add a method to clone an iox handle
gpios for everyone!
2024-10-10 02:03:11 +08:00
bunnie
30fdc139e5 simplify new methods for spim 2024-10-08 17:59:42 +08:00
bunnie
b99c5544c6 simplify new methods for i2c 2024-10-08 17:59:31 +08:00
bunnie
717ddefb2e add references to new libraries 2024-10-07 22:53:29 +08:00
bunnie
be56097fe4 add axp2101 driver skeleton 2024-10-07 22:52:55 +08:00
bunnie
f95941af83 add I2C features to the board description file 2024-10-06 02:44:47 +08:00
bunnie
7399c4a6da add mapping for i2c channels to global clocks; fix typo 2024-10-06 02:44:16 +08:00
bunnie
d45052b772 add i2c base driver 2024-10-06 02:43:49 +08:00
bunnie
81c6d9510b modularize the udma module 2024-10-04 22:59:02 +08:00
bunnie
d21789beff remove the chip select gpio-wait hack
We use the txrx call instead, which does not signal a completion
until the rx transaction is finished (which is after the final
bit is received of a pending SPI transaction).
2024-10-04 22:51:36 +08:00
bunnie
683aa63616 add async txrx variant to spim API
This allows us to do a "swap" transaction (transmit and receive)
asynchronously (the await returns a pointer to the receive buffer).

Note that a pure-rx-only variant is still todo, but should follow
pretty naturally from the pattern outlined here.
2024-10-04 22:49:56 +08:00
bunnie
669ab294f2 update lib refs and manifest 2024-10-04 13:05:40 +08:00
bunnie
be8f939311 update hardware descriptor to point to the oled 2024-10-04 13:05:01 +08:00
bunnie
437dcb2de5 add IoGpio trait
this allows us to stash a reference to the Iox in both std
and no-std reperesentations of the hardware.
2024-10-04 13:04:22 +08:00
bunnie
b6532ffd39 add the 'SharedCsr' type object
this is a CSR object that presents writes as an immutable on the
parent object. This simplifies traits, etc.

On the one hand, the CSR itself is truly immutable - the address
represented by the CSR does not change.

On the other hand, the underlying data inside the CSR is changing,
so, the CSR actually represesnts an immutable pointer to a mutable
piece of data.

For the case of the UDMA, we have a bank of globally shared state,
it is much more convenient to think of the CSR as immutable, and
we manage the underlying global shared state through other checks,
e.g. through dynamic allocators that track when various blocks
or resources have been parceled out.
2024-10-04 13:01:03 +08:00
bunnie
c2ff7c759d prelim driver for sh1107-style OLED displays 2024-10-04 13:00:36 +08:00
bunnie
c44f117331 fixes to udma SPIM for tx-only mode
- fix tx_await() condition to consider both control and tx channels
- make tx_async more efficient for the common case that the buffer
fits in a single transaction by appending the CS de-assert as part
of the initial command stream
- make trait for the udma global clock setting

The high bit in this exploration is that there seems to be no
way to actually confirm when a UDMA transaction has fully completed
on the hardware interface. All the completion signals tell you
when the software-side UDMA resources are freed up. However, in this
case, the hardware-side resources may still be transmitting/receiving
data.

This is a problem for the case of a '4-wire SPI' display where you
need to set an extra line to control command/data mode addressing.

In this case, the current work-around is to read back the state of
the chip select pin as a GPIO to determine when the hardware has
finished.

I suspect that if we can figure out how to use UDMA in a full duplex
mode that we could do something more essentially linked to the
hardware, but this would also require having a dummy Rx buffer allocated
that is the same depth as the hardware Tx buffer if all you cared about
is the hardware conclusion of a Tx.
2024-10-04 12:53:55 +08:00
bunnie
412a76288a fix formatting 2024-10-02 01:47:41 +08:00
bunnie
d6790489f1 migrate more board parameters to board files 2024-10-02 01:44:33 +08:00
bunnie
20dd9b2c14 consolidate spi pin setup routines 2024-10-02 00:23:17 +08:00
bunnie
6eca732043 cleanup a warning 2024-10-01 23:15:22 +08:00
bunnie
c0ddf5f82a add board feature placeholders 2024-10-01 23:14:20 +08:00
bunnie
81637f119b add helper to translate return values from io setup to udma clock channels
this allows us to tease out the clock setting code from the pin
setting code. probably will need to add more helpers for other
peripherals as we continue through with this exercise.
2024-10-01 23:13:08 +08:00
bunnie
45d9487c70 add board module to the project 2024-10-01 23:12:53 +08:00
bunnie
1dbfb21020 add some stand-in code for board definitions on the cramium platform 2024-10-01 23:12:30 +08:00
bunnie
c7bdc1aec5 refactor iox to have a setup_pin() trait
this lays the foundation to make code portable between std and
no-std environments for setting up pin configurations.
2024-10-01 23:11:24 +08:00
bunnie
ab41cbc299 make aclk test allow both registered and unregistered mem configs
both are valid, which is picked in the end will depend on
timing closure
2024-09-26 18:19:27 +08:00
bunnie
0b419400c7 improve reset condition for filter & make pass criteria tighter
- filter setup can be impacted by previous engine running, make
sure engines are stopped and FIFOs flushed prior to test start
- when reading a filtered bank we can get garbage, so make the
test check for the specific value we should see.
2024-09-26 18:18:12 +08:00
bunnie
81f0523ee3 add functional multiply-accumulate test
note that multiplies must go from register to register,
they can't directly pull out of FIFO regs
2024-09-26 18:17:31 +08:00
bunnie
7b8f4d91ec add mul unit test 2024-09-26 18:17:14 +08:00
bunnie
043dfd84ae update formatting to latest nightly rules 2024-09-24 01:49:45 +08:00
bunnie
67e0004f73
Merge branch 'main' into rkyv-0.8-migration 2024-09-23 22:32:34 +08:00
bunnie
f494da21cc absorb new xous-ipc version 2024-09-23 22:05:50 +08:00
Sean Cross
8e27dce59c flatipc: release 0.1.2
This releases flatipc 0.1.2 with more documentation and a new
`Ipc::from_memory_message()` call to reconstitute an object from a
xous::MemoryMessage.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-23 19:32:54 +08:00
bunnie
3a9a7ebf02 length of a record stored is the pos field for rkyv-to-pddb
prior use of `rkyv` reserves two bytes to record `pos` pre-pended
to the rkyv record

the new rkyv works without having to do that because it indexes
the rkyv data off the end of the stored records. Thus, all you
need to know is the total length of the byte slice that stores
the serialized data. This is available as the return argument
when you read a PDDB key, so we don't have to explicitly store it
anymore.
2024-09-23 17:01:13 +08:00
bunnie
c699e06c5a port rkyv ser/de usage in mtxchat 2024-09-23 17:00:16 +08:00
bunnie
75954de8d6 commit the version bump 2024-09-23 01:46:25 +08:00
bunnie
888cd2252e
Merge branch 'main' into rkyv-0.8-migration 2024-09-23 01:23:12 +08:00
bunnie
44b9041d0d attempt to update rkyv use in TLS library
@nworbnhoj would love it if you could have a look at
the implementation and let me know if I've ported this correctly.

I think what was going on is you were using rkyv to serialize
a structure to the PDDB. I've just updated the ser/de to use
the latest `alloc` API (which is much simpler than the API used
in xous-ipc because it is no-alloc).

I'll try and run some tests that involve the TLS crate too down
the road under the theory that it would suss out any porting
errors.
2024-09-23 01:14:41 +08:00
bunnie
4c7c9312c1 change xous-ipc api to 0.10.0 2024-09-23 00:24:48 +08:00
Sean Cross
3eb54d2cc9 flatipc: add more checks to vec and string
These are required as this goes across the IPC boundary.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 19:26:48 +08:00
Sean Cross
0c5b011fcf flatipc-derive: remove outdated header
Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:51:40 +08:00
Sean Cross
c8d70aae6a flatipc: run cargo +nightly fmt -p flatipc
Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:49:56 +08:00