Course Code: embrustbsp
Duration: 21 hours
Course Outline:

Session 1

  • Rust types - primitives, struts, arrays, str, #[derive(Debug)]
  • References - immutable/mutable, slices, rules for references.
  • Control flow - if, match, loop, for, while.
  • Implementing methods.
  • Exercise: Write FizzBuzz in Rust.

Session 2

  • Functions and return values
  • Move semantics
  • Closures
  • Generic functions
  • Traits and bounds.
  • Exercise: Make a generic Animal trait and apply it to cats and dogs.

Session 3

  • Destructuring assignments.
  • If-let, if-else, while-let.
  • Generic structures.
  • Lifetimes.
  • Exercise: Parse a command.

Session 4

  • #[no-std] coding for embedded.
  • Calling and being called by C code.
  • Bindgen - generating interfaces to C code from headers.
  • The alloc library (Box, Vec, HashMap, BTreeMap, VecDeque).
  • Exercise: input a text file and sort it by alphabetical order.

Session 5

  • Setting up the NRF dev board.
  • Example: Hello world.
  • Example: Blinky.
  • Concurrency
  • Synchronisation
  • Exercise: Experiment with the NRF board
  • Q&A, Conclusions