Skip to content

Setup CAN Fancy Layer (Higher Level Peripheral)#260

Merged
dchansen06 merged 84 commits intomainfrom
FancyCan
Apr 17, 2026
Merged

Setup CAN Fancy Layer (Higher Level Peripheral)#260
dchansen06 merged 84 commits intomainfrom
FancyCan

Conversation

@dchansen06
Copy link
Copy Markdown
Contributor

@dchansen06 dchansen06 commented Feb 27, 2026

CAN Fancy Layer

Problem and Scope

Lib/Peripherals/CAN is amazing for CAN but requires a lot of overhead in an application and we almost always do things the same way

  • Need a way to reliably convert uint32_t ID into actual ID fields for internal formats
  • Need a way to validate messages have the right length
  • Need the ECU-specific CAN_Configure and ECU_CAN_Send functions for use by other boards

MORE TODO

Description

Adds a fancy layer CAN library

MORE TODO

Gotchas and Limitations

Linear translation

MORE TODO

Testing

  • HOOTL testing
  • HITL testing
  • Human tested

Testing Details

TODO

Larger Impact

Serves as a layer between the amazing Lib/Peripherals/CAN and application code making the CAN specific to our uses

Additional Context and Ticket

Would have helped #203 among other things

@dchansen06 dchansen06 self-assigned this Feb 27, 2026
@dchansen06 dchansen06 added Documentation Improvements or additions to documentation Enhancement New feature or request CMake Anything related to or dealing with CMake HOOTL Testing Having to do with or interacting with HOOTL testing 1 URGENT Urgent issue that needs a quick action and resolution Big Fry Something that is complex and/or large Peripheral Related to or involving a peripheral including abstractions labels Feb 27, 2026
@dchansen06 dchansen06 force-pushed the FancyCan branch 4 times, most recently from 58b6568 to 61cd3a8 Compare March 1, 2026 05:08
@dchansen06 dchansen06 changed the title Setup CAN ID Translation Middle-Layer Setup CAN Fancy Layer (Higher Level Peripheral) Mar 1, 2026
…init. Tests are now much quicker, had HAL_DELAY(1000) for some reason. All tests PASSED
@dchansen06 dchansen06 marked this pull request as ready for review April 10, 2026 20:08
kiranduriseti1 and others added 9 commits April 10, 2026 18:16
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Copy link
Copy Markdown
Contributor Author

@dchansen06 dchansen06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed a few linter/compilation/case bugs that do not manifest under Windows


Code looks good, but please add doc comments to the two header files GRCAN_FancyLayer.h and grcan_utils.h in the standard doc comment notation (either form just be consistent-ish please) for end-user readability.

/// @brief Encodes a fancy ID into a raw 32-bit can ID
/// @param id The fancy ID struct to encode
/// @return Encoded 32-bit value for CAN transmission
/// @note Do not use this function for custom can IDs (eg DTI, EM, etc)
GRCAN_BusMode GRCAN_BusModeForBus(GRCAN_BUS_ID bus);

 /**
  * @brief Gets the bus mode for a given bus ID
  * @param bus The bus ID to get the mode for
  * @return The bus mode corresponding to the given bus
  */
GRCAN_BusMode GRCAN_BusModeForBus(GRCAN_BUS_ID bus);

Additionally, please extend the newly-added readme file with some basic flows, keep it very simple / architectural level please. Maybe also add a todo section if you have anything on your mind.

Thank you!

@dchansen06 dchansen06 marked this pull request as draft April 12, 2026 10:29
Comment thread Lib/FancyLayers-RENAME/GRCAN/Src/grcan_utils.c
@dchansen06 dchansen06 marked this pull request as ready for review April 17, 2026 02:57
@dchansen06 dchansen06 merged commit c86d8b9 into main Apr 17, 2026
32 checks passed
@dchansen06 dchansen06 deleted the FancyCan branch April 17, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 URGENT Urgent issue that needs a quick action and resolution Big Fry Something that is complex and/or large CMake Anything related to or dealing with CMake Documentation Improvements or additions to documentation Enhancement New feature or request HOOTL Testing Having to do with or interacting with HOOTL testing Peripheral Related to or involving a peripheral including abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants