Skip to content

Arducam interface#18

Open
JediKnight007 wants to merge 9 commits intomainfrom
arducam-interface
Open

Arducam interface#18
JediKnight007 wants to merge 9 commits intomainfrom
arducam-interface

Conversation

@JediKnight007
Copy link

Newest changes to camera interface according to instructions, one second counter now included

- Expanded photodiode support from 6 to 13-21 photodiodes
- Added configurable sampling rates (0.1-100 Hz) with runtime configuration
- Implemented ADC multiplexing support for >16 photodiodes
- Added new operation types: OPERATION_PHOTODIODE_CONFIG
- Enhanced data structures with active_count and validation flags
- Updated driver with multiplexed ADC reading functions
- Added sample rate control and validation
- Improved main loop with dynamic sampling rate adjustment
- Enhanced command processing for configuration changes
- Added comprehensive error handling and logging
…uthor

- Remove multiplexed photodiode read function and related variables
- Remove redundant ADC channel definitions (will be replaced by Atmel Start)
- Change floating-point sample rate to integer delay time in ms
- Add Avinash Patel as author in all photodiode files
- Simplify driver interface and remove over-engineered logic
- Updated PHOTODIODE_MAX_COUNT from 21 to 22
- Added multiplexer control functions (init_multiplexer_gpio, set_multiplexer_channel, read_single_photodiode_adc)
- Added multiplexer configuration structure with GPIO pin definitions
- Implemented 5-bit multiplexer control for 22 channels (2^5 = 32 > 22)
- Added multiplexer settling time handling (1ms)
- Updated ADC reading to use multiplexer switching
- Enhanced configuration to support multiplexer mode
- Fixed syntax errors in task_list.h (missing newlines)
- Added comprehensive error handling and validation

This enables support for 22 photodiodes using a single ADC channel with a multiplexer, providing full sun sensing capability for ADCS.
- Add comprehensive camera task with full functionality (not skeleton code)
- Implement camera_driver.h/c with SPI communication and hardware abstraction
- Add camera_task.h/c with complete command interface and auto-exposure algorithm
- Create camera_main.c with proper FreeRTOS task integration
- Add camera operations to globals.h operation enum:
  * OPERATION_CAMERA_CAPTURE
  * OPERATION_CAMERA_CONFIG
  * OPERATION_CAMERA_STATUS
  * OPERATION_CAMERA_AUTO_EXPOSURE
- Integrate camera task into task_list system with proper stack allocation
- Fix photodiode compilation errors on this branch
- Update Makefile to include camera task compilation

Features implemented:
- Clean 'take-picture' command interface
- Configurable settings (exposure, brightness, contrast, quality)
- Auto-exposure algorithm for varying orbital conditions
- Multiple image formats (RGB565, RGB888, YUV422, JPEG, GRAYSCALE)
- Proper memory management and error handling
- Full integration with PVDXos task system

Total: 1,670 lines of functional camera code across 5 files
@JediKnight007 JediKnight007 self-assigned this Oct 19, 2025
- Create new file structure with clear separation of concerns
- Implement consistent naming conventions throughout
- Add hardware abstraction layer (camera_hw.h/c)
- Centralize type definitions (camera_types.h)
- Organize configuration constants (camera_config.h)
- Create main public API (camera.h/c)
- Update existing files to use new structure
- Maintain backward compatibility with existing functionality

New structure:
- camera.h/c: Main public API
- camera_types.h: All type definitions and enums
- camera_hw.h/c: Hardware abstraction layer
- camera_config.h: Configuration constants
- camera_main.c: Task main function
- camera_task.c/h: Task implementation

All functions follow camera_* or camera_hw_* naming pattern
- Fix function signatures (calibrate_photodiode_readings const parameters)
- Add missing multiplexer functions (enable/disable/test functions)
- Update constants to match rtc2 (PHOTODIODE_MUX_SELECT_BITS = 3)
- Update data structures to include sun_vector and calibrated_values
- Update configuration structure with proper pin assignments
- Ensure consistency across all branches
- Remove duplicate function implementations from camera_task.c
- Remove duplicate global variable definitions
- Fix include paths and type conflicts
- Add missing camera_driver.o to Makefile
- Resolve multiple definition errors
- Camera system now compiles successfully
- Implemented comprehensive on-device C test framework for camera system
- Added 3 new tests: buffer management, config validation, framework integrity
- Total test suite now includes 6 tests (init, status, capture, buffer, config, framework)
- Integrated with shell via 'camtest' command (list/run functionality)
- All tests compile successfully and are ready for hardware validation
- Documentation added in tests/README.md
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.

1 participant