PER Firmware
Loading...
Searching...
No Matches
utils Namespace Reference

Classes

class  bcolors
 

Functions

 print_as_error (message)
 
 print_as_warning (message)
 
 print_as_ok (message)
 
 print_as_success (message)
 
 load_json (filepath)
 
str to_macro_name (str name)
 
 get_git_hash ()
 
 get_layout_hash (message)
 
 get_jinja_env ()
 
 render_template (env, template_name, output_path, **context)
 

Variables

 BASE_DIR = Path(__file__).parent.parent
 
str SCHEMA_DIR = BASE_DIR / 'schema'
 
str CONFIG_DIR = BASE_DIR / 'configs'
 
str NODE_CONFIG_DIR = CONFIG_DIR / 'nodes'
 
str EXTERNAL_NODE_CONFIG_DIR = CONFIG_DIR / 'external_nodes'
 
str GENERATED_DIR = BASE_DIR / 'generated'
 
str DBC_DIR = BASE_DIR / 'dbc'
 
str BUS_CONFIG_PATH = CONFIG_DIR / 'system' / 'bus_configs.json'
 
str COMMON_TYPES_CONFIG_PATH = CONFIG_DIR / 'system' / 'common_types.json'
 
dict CTYPE_SIZES
 

Detailed Description

utils.py

Author: Irving Wang (irvingw@purdue.edu)

Function Documentation

◆ get_git_hash()

utils.get_git_hash ( )
Returns the short git hash of the current commit

◆ get_layout_hash()

utils.get_layout_hash ( message)
Calculates a fingerprint hash for a message layout

◆ load_json()

utils.load_json ( filepath)
Load JSON file

Variable Documentation

◆ CTYPE_SIZES

dict utils.CTYPE_SIZES
Initial value:
1= {
2 "uint8_t": 8, "int8_t": 8,
3 "uint16_t": 16, "int16_t": 16,
4 "uint32_t": 32, "int32_t": 32,
5 "uint64_t": 64, "int64_t": 64,
6 "float": 32, "double": 64,
7 "bool": 1
8}