Skip to content

Add Neptune Orca CAN APIs#30

Closed
Copilot wants to merge 2 commits into
canfd_mdiofrom
copilot/sub-pr-29
Closed

Add Neptune Orca CAN APIs#30
Copilot wants to merge 2 commits into
canfd_mdiofrom
copilot/sub-pr-29

Conversation

Copilot AI commented Jan 27, 2026

Copy link
Copy Markdown

Adds CAN communication support for FreeWili devices with Neptune Orca hardware (I2C address 0x48).

CAN APIs Added

  • can_transmit() - Send CAN/CAN-FD messages on channels 0-1
  • can_enable_streaming() - Enable/disable CAN RX event streaming
  • can_set_transmit_periodic() - Configure periodic message transmission (8 slots per channel)
  • can_enable_transmit_periodic() - Start/stop periodic transmission
  • can_set_rx_filter() - Configure hardware RX filters (32 filters per channel)
  • CANData.from_string() - Parse CAN event data with error handling for empty payloads

Testing

  • Comprehensive test suite in test_can.py with hardware detection
  • Tests use @pytest.mark.xfail to gracefully handle missing Neptune hardware
  • Updated I2C tests to skip when Neptune is present (avoids false failures)

Documentation

  • Added CAN, WilEye, and file download examples to examples.rst
  • Fixed file mapping: .py files now correctly labeled "Python script"

Example usage:

with FreeWili.find_first().expect("No device") as dev:
    # Enable streaming and transmit
    dev.can_enable_streaming(0, True)
    dev.can_transmit(0, 0x123, bytes([0xAA, 0xBB]), is_canfd=True, is_extended=True)
    
    # Set up periodic transmission every 100ms
    dev.can_set_transmit_periodic(0, slot=0, period_us=100_000, 
                                   arb_id=0x55, is_canfd=True, 
                                   is_extended=True, data=bytes([...]))
    dev.can_enable_transmit_periodic(0, True)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: drebbe-intrepid <26259753+drebbe-intrepid@users.noreply.github.com>

Copilot AI commented Jan 27, 2026

Copy link
Copy Markdown
Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add Neptune Orca CAN APIs Add Neptune Orca CAN APIs Jan 27, 2026
Copilot AI requested a review from drebbe-intrepid January 27, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants