Skip to content

notfoundry/veho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Veho

A C++11 embedded CAN development platform for the 21st Century
Hand-written performance, compiler-enforced safety, fluent modern syntax

Table of Contents

What is it?

Veho is a library for transforming specifications for Controller Area Network (CAN) nodes into implementations of those specifications that are optimized at compile-time to account for the capabilities and limitations of the target CAN platform. What this means is that you as a developer can focus on specifying what you want your CAN node to do, and worry less about how those goals are accomplished.

Example

int main() {
  namespace fm = veho::frame_matchers;
  namespace lp = veho::listener_policies;

  constexpr auto bus_template = veho::make_bus_template<sam3x::rev_8e>()
          .with_transmitters<2>()
          .record_timestamps()
          .on(fm::exact<engine_status_id>(),
              [](const fancy_code& fc, const veho::frame<sam3x::rev_8e>& f){ 
                  fc.update_engine(f);
              },
              lp::execution_policy<lp::launch::realtime>()
          )
          .on(fm::range<min_flow_id, max_flow_id>(),
              [](const even_fancier& ef, const veho::frame<sam3x::rev_8e>& f){
                  ef.process_flow(f);
              },
              lp::retention_policy<lp::retention::most_recent<6>>,
              lp::execution_policy<lp::launch::enqueue>()
          )
          .on(fm::mask<base_id, mask_for_data_spread>(),
              [](const fancy_code& fc, const even_fancier& ef, const veho::frame<sam3x::rev_8e>& f){
                  fc.handle_spread(ef.preprocess_spread(f));
              },
              lp::retention_policy<lp::retention::discard_after<10>>(),
              lp::execution_policy<lp::launch::enqueue>()
          )
          .build();
          
  auto bus = bus_template
      .with(get_fancy(), get_fancier())
      .instantiate(get_default_pin_number());
}

About

Auto-optimizing modern C++11 CAN interface generator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages