Skip to content

Conversation

@nehalkpatel
Copy link
Owner

Split the monolithic emulator.py file into separate modules for better code organization and maintainability. Each peripheral type (Pin, UART, I2C) now has its own module, making the codebase easier to understand and extend.

Changes:

  • Create common.py for shared types (Status enum, UnhandledMessageError)
  • Create pin.py for Pin class and digital pin emulation
  • Create uart.py for Uart class and UART peripheral emulation
  • Create i2c.py for I2C class and I2C controller emulation
  • Update emulator.py to only contain DeviceEmulator class
  • Update init.py to export public API with relative imports
  • Update test imports to use new package structure

All tests continue to pass with the new modular structure.

🤖 Generated with Claude Code

nehalkpatel and others added 2 commits November 24, 2025 22:28
Split the monolithic emulator.py file into separate modules for better code organization and maintainability. Each peripheral type (Pin, UART, I2C) now has its own module, making the codebase easier to understand and extend.

Changes:
- Create common.py for shared types (Status enum, UnhandledMessageError)
- Create pin.py for Pin class and digital pin emulation
- Create uart.py for Uart class and UART peripheral emulation
- Create i2c.py for I2C class and I2C controller emulation
- Update emulator.py to only contain DeviceEmulator class
- Update __init__.py to export public API with relative imports
- Update test imports to use new package structure

All tests continue to pass with the new modular structure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@nehalkpatel nehalkpatel merged commit 63520fd into main Nov 25, 2025
1 check passed
@nehalkpatel nehalkpatel deleted the feature/refactor-py-emulator branch November 25, 2025 06:44
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