Note that a NACK is returned as an Ok(I2cResult::Nack) - this is
because the Err() path is still reserved for "OS failure" errors.
A Nack isn't a terminal failure, it is a recoverable fault, and
so it's handled in the Ok() path.
NACK bit is now checked after running the transaction, and if
it is set an appropriate error code is returned.
The trait implementation for i2c baremetal calls is also
updated in this commit
this is the actual handler inside the Xous service which, when
receiving the opcode, dereferences its exclusive pointer to the
IRQ bank and then returns the result to the caller.
in the Xous context, because the IRQ banks are owned by a global
object, not every server can simply refer to the IRQ bits by just
dereferencing a pointer. Instead, it needs to send a message to
the cram_hal_service with an API number which then catches this
and does the dereference on behalf of the caller.
multiple IRQs related to the UDMA will eventually get mapped into
the global IRQ handler for UDMA. Create an enum type that will
help us differentiate this and add a trait that returns the raw bits
for a given IRQ type.
Probably a fancier wrapper should be made to interptet the IRQ
bits but unfortunately there isn't a uniform pattern to the IRQ
mappings, it's pretty much whatever fit into the IRQ space based
on the underlying function. At the moment not even sure if this
is the right register to be chasing, so we'll use this for probing
that aspect and then get fancy later, maybe.
the switch based on target is now absorbed into the new() function.
This paves the way for us to add more CSR ranges into the global
configuration object, i.e. IRQ csrs for I2C.
these frameworks are mostly unused at the moment but it lets
us hook more easily into these artifacts once they are populated.
next up...menu behavior in the totp widget
leave all the complexity of the eventual logic in modules,
but gut the main module and reduce it to a thing i can use
to prototype user interface primitives
our implementantation of Buffer can't (currently) dynamically grow
the size of the object to serialize things that are bigger than
a page, so we have to enforce Vec-like objects to have a serialized
size of less than the page limit.
This is a bit of a moving target because it depends on implementation
specific details. A conservative bodge was put in to try and
work around this problem for now.
This was introducing a mysterious "line" artifact on text rendering
in new systems.
Probably need to do some real on-device testing of this change
because the automated tests won't catch a dirty bit error on
the LCD.