- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.2k
drivers: video: add imx219 sensor (RPi Cam v2) #88011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Draft
      
      
            josuah
  wants to merge
  6
  commits into
  zephyrproject-rtos:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
tinyvision-ai-inc:pr-imx219
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
      
        
          +772
        
        
          −47
        
        
          
        
      
    
  
  
     Draft
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            6 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      48d7ee0
              
                driver: video: ctrls: add VIDEO_CID_DIGITAL_GAIN
              
              
                josuah 7b1ea15
              
                drivers: video: sort CMakeLists.txt/Kconfig imports
              
              
                josuah 2426dc4
              
                drivers: video: introduce Sony IMX219 sensor driver
              
              
                josuah 02a01e5
              
                tests: drivers: build_all: video: add IMX219
              
              
                josuah 19da43f
              
                boards: shields: introduce the Raspberry Pi Camera Module 2
              
              
                josuah 3065da1
              
                shields: raspberry_pi_camera_module_2: add stm32n6570_dk configs files
              
              
                 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Copyright (c) 2025 tinyVision.ai Inc. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|  | ||
| config SHIELD_RASPBERRY_PI_CAMERA_MODULE_2 | ||
| def_bool $(shields_list_contains,raspberry_pi_camera_module_2) | 
        
          
          
            3 changes: 3 additions & 0 deletions
          
          3 
        
  boards/shields/raspberry_pi_camera_module_2/boards/stm32n6570_dk.conf
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT="pBAA" | ||
| CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH=3280 | ||
| CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT=2464 | 
        
          
          
            3 changes: 3 additions & 0 deletions
          
          3 
        
  boards/shields/raspberry_pi_camera_module_2/boards/stm32n6570_dk_stm32n657xx_sb.conf
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT="pBAA" | ||
| CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH=3280 | ||
| CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT=2464 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| .. _raspberry_pi_camera_module_2: | ||
|  | ||
| Raspberry Pi Camera Module 2 | ||
| ############################ | ||
|  | ||
| Overview | ||
| ******** | ||
|  | ||
| The Raspberry Pi camera module 2 provides a Sony IMX219 rolling shutter in a module featuring a | ||
| 15-pin FFC connector popularized by Raspberry Pi, present on a wide range of boards. | ||
|  | ||
| The NoIR variant is the same as the normal variant, except with the infra-red filter removed. | ||
|  | ||
| .. figure:: rpi_cam_v2_normal.jpg | ||
| :width: 500px | ||
| :align: center | ||
| :alt: Raspberry Pi Camera Module 2 | ||
|  | ||
| Raspberry Pi Camera Module 2, normal variant (Credit: Raspberry Pi.) | ||
|  | ||
| .. figure:: rpi_cam_v2_noir.jpg | ||
| :width: 500px | ||
| :align: center | ||
| :alt: Raspberry Pi Camera Module 2 NoIR | ||
|  | ||
| Raspberry Pi Camera Module 2, NoIR variant (Credit: Raspberry Pi.) | ||
|  | ||
| Requirements | ||
| ************ | ||
|  | ||
| The camera module is compatible with all boards featuring a 15 pins FFC connector and the necessary | ||
| devicetree definitions for a :dtcompatible:`raspberrypi,csi-connector`. | ||
|  | ||
| Usage | ||
| ***** | ||
|  | ||
| The shield can be used in any application by setting ``SHIELD`` to | ||
| ``raspberry_pi_camera_module_2`` for boards with the necessary device tree node labels: | ||
|  | ||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/drivers/video/capture | ||
| :board: stm32n6570_dk | ||
| :shield: raspberry_pi_camera_module_2 | ||
| :goals: build | ||
|  | ||
| References | ||
| ********** | ||
|  | ||
| - `Product page <https://www.raspberrypi.com/products/camera-module-v2/>`_ | ||
|  | ||
| - `Product page (NoIR) <https://www.raspberrypi.com/products/pi-noir-camera-v2/>`_ | ||
|  | ||
| - `Datasheet <https://datasheets.raspberrypi.com/camera/camera-module-2-schematics.pdf>`_ | ||
|  | ||
| - `Mechanical drawing <https://datasheets.raspberrypi.com/camera/camera-module-2-mechanical-drawing.pdf>`_ | 
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          Binary file added
          
            BIN
              
                +59.1 KB
              
          
        
  boards/shields/raspberry_pi_camera_module_2/doc/rpi_cam_v2_normal.jpg
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          
            46 changes: 46 additions & 0 deletions
          
          46 
        
  boards/shields/raspberry_pi_camera_module_2/raspberry_pi_camera_module_2.overlay
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Copyright (c) 2025 tinyVision.ai Inc. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|  | ||
| #include <zephyr/dt-bindings/gpio/raspberrypi-csi-connector.h> | ||
| #include <zephyr/dt-bindings/video/video-interfaces.h> | ||
|  | ||
| / { | ||
| chosen { | ||
| zephyr,camera = &csi_capture_port; | ||
| }; | ||
|  | ||
| imx219_input_clock: imx219-input-clock { | ||
| compatible = "fixed-clock"; | ||
| clock-frequency = <24000000>; | ||
| #clock-cells = <0>; | ||
| }; | ||
| }; | ||
|  | ||
| &csi_interface { | ||
| status = "okay"; | ||
| }; | ||
|  | ||
| &csi_ep_in { | ||
| remote-endpoint-label = "imx219_ep_out"; | ||
| bus-type = <VIDEO_BUS_TYPE_CSI2_DPHY>; | ||
| data-lanes = <1 2>; | ||
| }; | ||
|  | ||
| &csi_i2c { | ||
| imx219: imx219@10 { | ||
| compatible = "sony,imx219"; | ||
| clocks = <&imx219_input_clock>; | ||
| reg = <0x10>; | ||
|  | ||
| port { | ||
| imx219_ep_out: endpoint { | ||
| remote-endpoint-label = "csi_ep_in"; | ||
| bus-type = <VIDEO_BUS_TYPE_CSI2_DPHY>; | ||
| data-lanes = <1 2>; | ||
| }; | ||
| }; | ||
| }; | ||
| }; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| shield: | ||
| name: raspberry_pi_camera_module_2 | ||
| full_name: Raspberry Pi Camera Module 2 | ||
| vendor: Raspberry Pi | ||
| supported_features: | ||
| - video | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Copyright (c) 2024 tinyVision.ai Inc. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|  | ||
| config VIDEO_IMX219 | ||
| bool "IMX219 8 Mega-Pixel CMOS image sensor" | ||
| select I2C | ||
| depends on DT_HAS_SONY_IMX219_ENABLED | ||
| default y | ||
| help | ||
| Enable driver for IMX219 8 Mega-Pixel CMOS image sensor | 
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is Kconfig.imx219? :)