Midnight Sun Firmware
Loading...
Searching...
No Matches
can_autogen.py File Reference

YAML parsing and validation module for CAN message configurations. More...

Functions

def check_yaml_file (data)
 
def get_data (args)
 

Detailed Description

YAML parsing and validation module for CAN message configurations.

Date
2024-12-21
Author
Aryan Kashem

This module provides functionality to parse and validate CAN message configurations from YAML files, ensuring they meet specific requirements for message IDs, signal lengths, and naming conventions

Function Documentation

◆ check_yaml_file()

def check_yaml_file (   data)
@brief Validates the content of CAN message YAML data

@param data Dictionary containing the YAML data to be validated

@exception Exception Various exceptions for validation failures:
    - Missing required fields (id, critical, cycle)
    - Duplicate message IDs
    - Invalid message IDs (must be 0-63)
    - Illegal characters in message/signal names
    - Too many signals in a message (max 8)
    - Invalid signal lengths (must be multiple of 8)
    - Total message length exceeding 64 bits

◆ get_data()

def get_data (   args)
@brief Extracts and processes CAN message data from YAML files

@param args Arguments object containing output path and template information
@return Dictionary containing processed CAN message data with keys:
        - boards: List of board names
        - messages: List of message configurations
        - board: Current board name

Expected directory structure in args.output:
.../<target-type>/<target-name>/can
where <target-type> is one of libraries/projects/smoke