#api #aerospace #api-bindings #no-std #avionics #arinc

no-std a653rs

Arinc653 abstraction library for hypervisor independent partition programming

9 unstable releases (3 breaking)

0.5.0 Jan 30, 2024
0.4.1 Jan 24, 2024
0.3.3 Dec 18, 2023
0.3.2 Jul 13, 2023
0.2.1 Apr 24, 2023

#111 in Embedded development

Download history 5/week @ 2023-12-31 25/week @ 2024-01-07 1/week @ 2024-01-14 49/week @ 2024-01-21 30/week @ 2024-01-28 6/week @ 2024-02-04 36/week @ 2024-02-11 159/week @ 2024-02-18 100/week @ 2024-02-25 19/week @ 2024-03-03 20/week @ 2024-03-10 6/week @ 2024-03-17 19/week @ 2024-03-24 13/week @ 2024-03-31 18/week @ 2024-04-07 7/week @ 2024-04-14

57 downloads per month

MIT/Apache

135KB
2K SLoC

a653rs Latest Version a653rs a653rs_macros Zenodo

Required Services https://www.aviation-ia.com/support-files/arinc653h

Extended Services https://www.aviation-ia.com/support-files/arinc653p2h

Position of a653rs

a653rs is supposed to be used as a dependency by the Hypervisor-Wrapper-Library, partitions and processes.

A potential Hypervisor-Wrapper-Library would use introduced Apex traits for providing functionality expected of an ARINC653 compliant hypervisor.

Downstream partitions and processes written in Rust would use a653rs in combination with any Hypervisor-Wrapper-Library implementing a653rs for gaining safe abstracted Apex structures for using Apex functionalities.

For both cases preludes were defined offering all required structs, traits and type-aliases.

  • bindings: for the Hypervisor-Wrapper-Library
  • prelude: for downstream users (partitions and processes)

Design Decisions

This crate offers multiple traits, targeted towards specific functionalities defined in the ARINC653 standard.

  • ApexBlackboardP1
  • ApexBufferP1
  • ApexErrorP1/P4
  • ...

These traits require the implementer to implement static functions which are closely related to the functions defined in the ARINC653 standard (see header file in Required Services). Most likely the implementation of these functions is just a bindgen to underlying c-functions of the hypervisor

The separation of these static functions into specific traits was done because this way hypervisors with limited capabilities can at least offer a limited set instead of none.

While the required functions are closely related to the functions defined in the ARINC653 standard they are not identical. None of the functions in the standard return any value. Instead, references are passed into them, which are mutated during the function call. While our functions could have used the same structure we opted for a more Rust-like function style, in which we at least return a Result with an expected Ok-type in the ReturnCode NoError-case and a ErrorReturnCode as the Err-type in all other cases.

ErrorReturnCode is just the ARINC653 specific ReturnCode enum type without the NoError-variant.

Unsafe Functions

While it is expected that the implementing Hypervisor-Wrapper-Library will need to use a bunch of unsafe code blocks and functions, only one type of function in our traits is explicitly marked as unsafe: functions taking a mutable reference as an argument. Mutable references are only passed to read/receive functions, which take mutable references to ApexByte-slices. Since it is exceptionally unsafe should the user provide a mutable slice which is too small, this function is marked as unsafe.

Because of this we generally provide two functions within our abstractions. One safe-function which checks that the mutable slice provided by the user can at least hold the defined max-message-size and one unsafe-function which just hopes that the read/received message is not longer than what the user expected.

Decisions towards Downstream User (Partitions and Processes)

TODO

TODOS

  • Write Readme
  • Write RustDoc

Licensing Information

The ARINC 653 standard belongs to the Aeronautical Radio, Incorporated (ARINC).

For this library the copyright belongs to the German Aerospace Center / Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR):

Copyright © 2023 Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)

Dependencies

~0.5–1.3MB
~29K SLoC