Abstract:
A camera module comprising an image sensor array, a gain amplifier, an indicator set to indicate whether a first flash device or a second flash device is present, and a plurality of storage locations. The plurality of storage locations is configured to store an exposure time and a gain. The exposure time and the gain are associated with the first flash device in response to the indicator indicating the presence of the first flash device, and the exposure time and the gain are associated with the second flash device in response to the indicator indicating the presence of the second flash device. The image sensor array is configured to capture an image using the exposure time, and the gain amplifier is configured to perform processing on the image using the gain.

Description:
BACKGROUND 
     Some portable electronic devices, such as mobile telephones, include image capture capabilities similar to those associated with a digital camera. These devices, however, may be smaller and/or more compact than many digital cameras, and as a result, do not have the space that is needed to accommodate all of the components of a conventional standalone digital camera. Accordingly, certain features that may be common in digital cameras may be difficult to include in portable electronic devices. In addition, portable electronic devices that include image capture capabilities may be offered at prices less than those associated with digital cameras. As a result, certain features that may be common in digital cameras may be omitted from portable electronic devices to allow desired price targets of the electronic devices to be met. 
     It would be desirable to be able to provide additional image capture features in portable electronic devices while minimizing the size and cost associated with the features. 
     SUMMARY 
     In an exemplary embodiment, the present disclosure provides a camera module comprising an image sensor array, a gain amplifier, an indicator set to indicate whether a first flash device or a second flash device is present, and a plurality of storage locations. The plurality of storage locations is configured to store an exposure time and a gain. The exposure time and the gain are associated with the first flash device in response to the indicator indicating the presence of the first flash device, and the exposure time and the gain are associated with the second flash device in response to the indicator indicating the presence of the second flash device. The image sensor array is configured to capture an image using the exposure time, and the gain amplifier is configured to perform processing on the image using the gain. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a block diagram illustrating an embodiment of a system that comprises a camera module. 
         FIG. 2  is a diagram illustrating an embodiment of a set of registers. 
         FIGS. 3   a ,  3   b , and  3   c  are diagrams illustrating an embodiment of operating an image sensor array using a first exposure time. 
         FIGS. 4   a ,  4   b , and  4   c  are diagrams illustrating an embodiment of operating an image sensor array using a second exposure time. 
         FIG. 5  is a flow chart illustrating a first embodiment of a method for capturing an image in a snapshot mode of operation. 
         FIG. 6  is a timing diagram illustrating a first example of signals used to capture an image in a snapshot mode of operation. 
         FIG. 7  is a flow chart illustrating a second embodiment of a method for capturing an image in a snapshot mode of operation. 
         FIG. 8  is a timing diagram illustrating a second example of signals used to capture an image in a snapshot mode of operation. 
         FIG. 9  is a flow chart illustrating a third embodiment of a method for capturing an image in a snapshot mode of operation. 
         FIG. 10  is a timing diagram illustrating a third example of signals used to capture an image in a snapshot mode of operation. 
         FIG. 11  is a block diagram illustrating an embodiment of a system that comprises the embodiment of  FIG. 1 . 
         FIG. 12  is a block diagram illustrating an alternative embodiment of the system of  FIG. 1 . 
     
    
    
     DETAILED DESCRIPTION 
     In the following Detailed Description, reference is made to the accompanying drawings, which form a part hereof, and in which is shown by way of illustration specific embodiments in which the invention may be practiced. In this regard, directional terminology, such as “top,” “bottom,” “front,” “back,” “leading,” “trailing,” etc., is used with reference to the orientation of the Figure(s) being described. Because components of embodiments of the present invention can be positioned in a number of different orientations, the directional terminology is used for purposes of illustration and is in no way limiting. It is to be understood that other embodiments may be utilized and structural or logical changes may be made without departing from the scope of the present invention. The following Detailed Description, therefore, is not to be taken in a limiting sense, and the scope of the present invention is defined by the appended claims. 
       FIG. 1  is a block diagram illustrating an embodiment of a system  100  that comprises a camera module  112 . System  100  comprises a host  110  and a flash device  114  coupled to camera module  112 . Host  110  comprises a processor  116 , firmware  118 , and a memory  120 . Camera module  112  comprises an interface  122 , a set of registers  124 , a control circuit  126 , an image sensor array  128 , a gain amplifier  130 , an analog-to digital converter (ADC)  132 , and an image processing circuit  134 . 
     Host  110  is configured to operate camera module  112  in a viewfinder mode and a snapshot mode by communicating with camera module  112  using a connection  142 . In one embodiment, connection  142  comprises an I2C bus and other signals. In other embodiments, connection  142  may comprise other types of busses or signals. In the viewfinder mode of operation, host  110  causes camera module  112  to continuously capture images and provide those images to host  110  using connection  142 . In the snapshot mode of operation, host  110  causes camera module  112  to capture a single image and provide that image to host  110  using connection  142  in response to a snapshot signal from host  110 . Host  110  may cause camera module  112  to provide a flash signal to flash device  114  to generate a flash according to environmental light conditions in snapshot mode. Host  110  provides parameters to camera module  112  in viewfinder mode and snapshot mode to determine how camera module  112  captures images as will be described in additional detail below. 
     In the embodiment of  FIG. 1 , processor  116  executes firmware  118  to allow host  110  to operate camera module  112 . Firmware  118  comprises instructions configured to cause functions to be performed in response to being executed by processor  116 . These functions include accessing information from camera module  112 , generating signals and parameters, and providing signals and parameters to camera module  112 . Memory  120  stores images received by host  110  from camera module  112 . 
     Camera module  112  captures images in either viewfinder mode or snapshot mode in response to signals from host  110 . Host  110  provides the signals to camera module  112  using interface  122  and stores parameters in registers  124 . As shown in  FIG. 2 , registers  124  comprise registers  200  through  216 . Register  200  is configured to store a flash enable/flash type indicator. The flash enable/flash type indicator indicates whether or not a flash device  114  is present and enabled and, if present, the type of flash device, e.g. an LED flash device or a xenon flash device. Register  202  is configured to store a flash time. The flash time may be used by camera module  128  as the amount of time to turn on flash device  114 . Register  204  is configured to store an exposure time. The exposure time is used by control circuit  126  to control how long an image is exposed in image sensor array  128 . Register  206  is configured to store a gain. The gain is provided to gain amplifier  130  to control the amount of gain that is applied to image data by gain amplifier  130 . Register  208  is configured to store a flash exposure-gain-product (EGP). Register  210  is configured to store a flash EGP threshold. The flash EGP threshold may be used by host  110  to determine whether or not to cause a flash to be generated by flash device  114  while capturing an image. Register  212  is configured to store a flash maximum time. The flash maximum time indicates the maximum amount of time that a flash may be used during an image exposure. Register  214  is configured to store a flash red coefficient. The flash red coefficient is provided to image processing circuit  134  to adjust the white balance of an image when a flash is used during image exposure. Register  216  is configured to store a flash blue coefficient. The flash blue coefficient is provided to image processing circuit  134  to adjust the white balance of an image when a flash is used during image exposure. 
     In response to the signals and parameters from host  110 , control circuit  126  operates camera module  112  in viewfinder mode (continuous images) or snapshot mode (single image with or without flash). To capture an image in either mode, control circuit  126  provides signals to image sensor array  128  to cause an image to be captured according to one or more parameters provided by host  110 . The parameters include an exposure time from register  204  and a gain from register  212  as will be described in additional detail below. 
     Image sensor array  128  comprises an array of photo diodes and associated optics for focusing an image onto the array. The array is arranged in rows and columns of photo diodes. Each photo diode discharges a capacitor in response to the amount of light that is exposed on the photo diode. To capture an image, control circuit  126  causes the capacitors to be reset by charging the capacitors to a supply voltage. The photo diodes are then exposed to a light source on a row-by-row basis for the amount of time associated with the exposure time in register  204  to cause the capacitors to discharge in response to the amount of light from the light source. After the time period elapses, control circuit  126  causes the capacitors in a row to be sampled to capture the image data from that row. Image sensor array  128  provides the image data for each row to gain amplifier  130 . 
     Gain amplifier  130  comprises a programmable gain amplifier. Gain amplifier  130  receives the image data from image sensor array  128  and amplifies the image data using the gain provided from register  206  by control circuit  126 . Gain amplifier  130  provides the amplified image data to ADC  132 . 
     ADC  132  receives the amplified image data from gain amplifier  130 . ADC  132  converts the amplified image data from an analog form to a digital form and provides the digital image data to image processing circuit  134 . 
     Image processing circuit  134  receives the digital image data from ADC  132  and performs various processing functions on the digital image data to generate an image that is displayable on a display. The processing functions may include an auto white balance function where the red and blue portions of the image may be adjusted using the flash red coefficient from register  214  and the flash blue coefficient from register  216  to compensate for the color temperature of the light illuminating the image. Image processing circuit  134  provides the image to host  110  using interface  122 . Host  110  causes the image to be stored in memory  120 . Host  110  may cause the image to be displayed on a display (not shown) integrated with the host or transmitted to another electronic device using a wired or wireless connection (not shown). 
     In the embodiment of  FIG. 1 , flash device  114  comprises either an LED flash device or a xenon flash device. In other embodiments, flash device  114  may comprise other types of flash devices. Flash device  114  is operable in response to a flash signal from camera module  112  on connection  144 . The flash signal may vary in duration according to the type of flash device  114  as will be described with respect to  FIGS. 6 and 8  below. Control circuit  126  generates the flash signal and provides the flash signal to flash device  114  in response to a snapshot signal from host  110 . 
       FIGS. 3   a ,  3   b , and  3   c  illustrate additional details of the operation of image sensor array  128  using a first exposure time. In the embodiment shown in  FIGS. 3   a  through  3   c , image sensor array  128  is operated as a rolling shutter such that the rows of image sensor array  128  are exposed sequentially starting at the top of the array and proceeding downward as indicated by the direction of an arrow  304 . A shaded box  302   a  in  FIG. 3   a  illustrates a first set of rows of image sensor array  128  being exposed at a first time. At a second, subsequent time, the first set of rows has finished being exposed, and a second set of rows is being exposed as illustrated by a shaded box  302   b  in  FIG. 3   b . Finally, at a third time subsequent to the second time, the first and second sets of rows have finished being exposed, and a third set of rows of image sensor array  128  is being exposed as illustrated by a shaded box  302   c  in  FIG. 3   c . As shown by the example in  FIGS. 3   a  through  3   c , different rows may be exposed at different times in response to a relatively short exposure time. 
       FIGS. 4   a ,  4   b , and  4   c  illustrate additional details of the operation of image sensor array  128  using a second exposure time that is longer in duration than the first exposure time illustrated in  FIGS. 3   a  through  3   c . As with  FIGS. 3   a  through  3   c , image sensor array  128  is operated as a rolling shutter such that the rows of image sensor array  128  are exposed sequentially starting at the top of the array and proceeding downward as indicated by the direction of an arrow  404 . A shaded box  402   a  in  FIG. 4   a  illustrates a first portion of the rows of image sensor array  128  being exposed at a first time. At a second, subsequent time, all of the rows in image sensor array  128  are being exposed simultaneously as illustrated by a shaded box  402   b  in  FIG. 4   b . Finally, at a third time subsequent to the second time, the last rows of image sensor array  128  being exposed as illustrated by a shaded box  402   c  in  FIG. 4   c . As shown by the example in  FIGS. 4   a  through  4   c , all rows in image sensor array  128  may be exposed simultaneously in response to a relatively long exposure time. 
     The frame time of image sensor array  128  is the amount of time it takes to begin exposing all rows in image sensor array  128 . In  FIGS. 3   a  through  3   c , the exposure time is less than the frame time as evidenced by the exposure of the first and second sets of rows completing prior to exposing the third set of rows. In  FIGS. 4   a  through  4   c , however, the exposure time is greater than the frame time as evidenced by all rows being exposed simultaneously as shown in  FIG. 4   b.    
     In the viewfinder mode of operation and in the snapshot mode of operation where a flash is not used, image sensor array  128  may be operated with an exposure time that is greater than, less than, or equal to the frame time of image sensor array  128 . In the snapshot mode of operation where a flash is used and image sensor array  128  operates as a rolling shutter, however, image sensor array  128  is operated with an exposure time that is greater than the frame time of image sensor array  128  to ensure that all rows of image sensor array  128  received the flash from flash device  114 . 
     When a flash is used in snapshot mode, host  110  calculates parameters such as flash time, exposure time, gain, and white balance coefficients to compensate for the increased light that the flash adds to an image. As described in  FIGS. 5-10  below, host  110  calculates these parameters differently depending on the type of flash device and the operation of image sensor array  128 . Accordingly, the parameters are associated with the type of flash device and the operation of image sensor array  128 . 
       FIGS. 5 and 6  illustrate an embodiment of system  100  in the snapshot mode of operation where flash device  114  is an LED flash device and image sensor array  128  operates as a rolling shutter.  FIG. 5  is a flow chart illustrating a first embodiment of a method for capturing an image in a snapshot mode of operation.  FIG. 6  is a timing diagram  600  illustrating a first example of signals used to capture an image in a snapshot mode of operation. 
     In the snapshot mode, host  110  determines whether a flash is desired by analyzing the one or more images received from camera module  112  during viewfinder mode. In response to determining that a flash is desired, host  110  accesses the flash enable/flash type register  200  to enable flash device  114 . Host  110  also detects that the flash type of flash device  114  is an LED flash device. Camera module  112  provides a flash signal to the LED flash device to cause the flash to be activated or turned on for the amount of time specified by the flash time in register  202 . Host  110  calculates the flash time and stores it in register  202  as described below. 
     Referring to  FIG. 5 , host  110  calculates exposure time for the snapshot as indicated by a block  502 . To calculate exposure time, host  110  calculates M—the ratio of flash illumination, I F , to viewfinder illumination, I V . Host  110  calculates M using the viewfinder exposure-gain product, EGP V , and the flash exposure-gain product, EGP F . To maintain proper exposure, the product of EGP and I are a constant. Therefore, the product of EGP V  and I V  is equal to the product of EGP F  and I F  as shown in equation [1].
 
 EGP   V   ·I   V   =EGP   F   ·I   F   [1]
 
     Using equation [1], M can be calculated from EGP V  and EGP F  as shown in equation [2]. 
     
       
         
           
             
               
                 
                   M 
                   = 
                   
                     
                       
                         I 
                         F 
                       
                       
                         I 
                         V 
                       
                     
                     = 
                     
                       
                         EGP 
                         V 
                       
                       
                         EGP 
                         F 
                       
                     
                   
                 
               
               
                 
                   [ 
                   2 
                   ] 
                 
               
             
           
         
       
     
     An auto exposure function in host  110  (not shown) measures EGP V  during viewfinder mode. EGP F  is programmed into register  206  by a user of system  100  and accessed by host  110 . Accordingly, host  110  calculates M using these values in equation [2]. 
     The exposure time in snapshot mode, E S , with an LED flash device is the sum of the FrameTime, i.e., the amount of time it takes to begin exposing all rows in image sensor array  128 , and the FlashTime, i.e., the amount of time that the LED flash device is on, as shown in equation [3].
 
 E   S =FlashTime+FrameTime  [3]
 
     FrameTime is programmed into host  110  by a user of system  100 . FlashTime is deduced from equation [4] as follows.
 
 E   V   ·G   V   ·I   V =FlashTime· G   S   ·I   F +(FlashTime+FrameTime)· G   S   ·I   V   [4]
 
     In equation [4], the exposure-gain product times the illumination in viewfinder mode is equal to the sum of the product of FlashTime, the snapshot gain, G S , and the flash illumination, I F , and the product of the snapshot exposure time, E S , (with FlashTime+FrameTime substituted for E S  in equation [4] using equation [3]), the snapshot gain, G S , and the viewfinder illumination. On the right side of the equation, the first product (FlashTime, G S , and I F ) represents the amount of light added by flash device  114  and the second product (E S , G S , and I V ) represents the amount of light present in viewfinder mode. 
     As shown in equation [5], the flash illumination, I F , is replaced with M and the viewfinder illumination, I V , using equation [2].
 
 E   V   ·G   V   ·I   V =FlashTime· G   S   ·M·I   V +(FlashTime+FrameTime)· G   S   ·I   V   [5]
 
     The viewfinder illumination, I V , values cancel on each side of equation [5] to give equation [6].
 
 E   V   ·G   V =FlashTime· G   S   ·M+ (FlashTime+FrameTime)· G   S   [6]
 
     The snapshot gain, G S , is moved from the right side of equation [6] to give equation [7]. 
     
       
         
           
             
               
                 
                   
                     
                       E 
                       V 
                     
                     · 
                     
                       
                         G 
                         V 
                       
                       
                         G 
                         S 
                       
                     
                   
                   = 
                   
                     
                       FlashTime 
                       · 
                       
                         ( 
                         
                           1 
                           + 
                           M 
                         
                         ) 
                       
                     
                     + 
                     FrameTime 
                   
                 
               
               
                 
                   [ 
                   7 
                   ] 
                 
               
             
           
         
       
     
     FlashTime can then be solved for as shown in equation [8]. 
     
       
         
           
             
               
                 
                   FlashTime 
                   = 
                   
                     
                       
                         
                           E 
                           V 
                         
                         · 
                         
                           
                             G 
                             V 
                           
                           
                             G 
                             S 
                           
                         
                       
                       - 
                       FrameTime 
                     
                     
                       1 
                       + 
                       M 
                     
                   
                 
               
               
                 
                   [ 
                   8 
                   ] 
                 
               
             
           
         
       
     
     As noted above, an auto exposure function in host  110  measures EGP V , i.e., E V ·G V , during viewfinder mode. Host calculates M using equation [2] above. FrameTime is programmed by a user of system  100 , and host  110  calculates the snapshot gain, G S . Accordingly, host  110  calculates FlashTime using equation [8]. 
     Host  110  also calculates white balance coefficients as indicated by a block  504 . Host  110  calculates the white balance coefficients by interpolating between the white balance coefficients for viewfinder mode and for flash device  114 . In particular, host  110  calculates a red coefficient, RED S , and a blue coefficient, BLUE S , using M from equation [2] and red and blue coefficients for viewfinder mode, RED V  and BLUE V , respectively, and for flash device  114 , RED F  and BLUE F , respectively, as indicated in equations [9] and [10], respectively. 
     
       
         
           
             
               
                 
                   
                     RED 
                     S 
                   
                   = 
                   
                     
                       ( 
                       
                         
                           RED 
                           V 
                         
                         · 
                         
                           1 
                           
                             1 
                             + 
                             M 
                           
                         
                       
                       ) 
                     
                     + 
                     
                       ( 
                       
                         
                           RED 
                           F 
                         
                         · 
                         
                           M 
                           
                             1 
                             + 
                             M 
                           
                         
                       
                       ) 
                     
                   
                 
               
               
                 
                   [ 
                   9 
                   ] 
                 
               
             
             
               
                 
                   
                     BLUE 
                     S 
                   
                   = 
                   
                     
                       ( 
                       
                         
                           BLUE 
                           V 
                         
                         · 
                         
                           1 
                           
                             1 
                             + 
                             M 
                           
                         
                       
                       ) 
                     
                     + 
                     
                       ( 
                       
                         
                           BLUE 
                           F 
                         
                         · 
                         
                           M 
                           
                             1 
                             + 
                             M 
                           
                         
                       
                       ) 
                     
                   
                 
               
               
                 
                   [ 
                   10 
                   ] 
                 
               
             
           
         
       
     
     The flash time, exposure time, gain, and white balance coefficients are stored in registers  124  by host  110  as indicated by a block  506 . A determination is made as to whether a snapshot signal has been received from host  110  by camera module  112  as indicated by a block  508 . If a snapshot signal has not been received, then the determination of block  508  is made again at a later time. If a snapshot signal has been received, then an exposure is begun to capture an image using image sensor array  128  as indicated by a block  510 . A flash signal is provided to flash device  114  to cause the LED flash to be turned on as indicated by a block  512 . The exposure is finished according to the exposure time as indicated by a block  514 . Processing is performed on the image by gain amplifier  130  and image processing circuit  134  using the gain and the white balance coefficients, respectively, as indicated by a block  516 . The processed image is stored in memory  120  on host  110  as indicated by a block  518 . 
       FIG. 6  illustrates the operation of snapshot mode with an LED flash device. Timing diagram  600  illustrates a snapshot signal  602 , a first row exposure signal  604 , a last row exposure signal  606 , an LED flash device on signal  608 , and a data out signal  610 . 
     At a time t 1 , host  110  provides a snapshot signal to camera module  112 . At a time t 2 , the first row of image sensor array  128  begins exposing, and at time t 3 , the last row of image sensor array  128  begins exposing. Thus, the FrameTime, in  FIG. 6 , is the amount of time between t 2  and t 3 . The LED flash is turned on at time t 3  in response to a flash signal from camera module  112  and remains on until time t 4  when the first row of image sensor array  128  finishes exposing. The duration of the flash signal is determined using the flash time in register  202 . At time t 4 , data output from image sensor array  128  to gain amplifier  130  begins and continues until time t 5  when the last row of image sensor array  128  finishes exposing. 
       FIGS. 7 and 8  illustrate an embodiment of system  100  in the snapshot mode of operation where flash device  114  is a xenon flash device and image sensor array  128  operates as a rolling shutter.  FIG. 7  is a flow chart illustrating a second embodiment of a method for capturing an image in a snapshot mode of operation.  FIG. 8  is a timing diagram  800  illustrating a second example of signals used to capture an image in a snapshot mode of operation. 
     In snapshot mode, host  110  determines whether a flash is desired by analyzing the one or more images received from camera module  112  during viewfinder mode. In response to determining that a flash is desired, host  110  accesses the flash enable/flash type register  200  to enable flash device  114 . Host  110  also detects that the flash type of flash device  114  is a xenon flash device. Camera module  112  provides a flash signal to the xenon flash device to cause the flash to be fired. With a xenon flash device, all of the flash energy is discharged in a relatively short time period. 
     Referring to  FIG. 7 , a snapshot gain, G S , is calculated as indicated in a block  702 . The snapshot gain is derived as follows. For proper exposure, the exposure-gain product times the illumination in snapshot mode is set equal to the exposure-gain product times the illumination in viewfinder mode as shown in equation [11].
 
 E   V   ·G   V   ·I   V   =E   S   ·G   S   ·I   S   [11]
 
     In equation [12], the exposure-gain product times the illumination in viewfinder mode is equal to the sum of the product of the exposure time of the flash, E F , the snapshot gain, G S , and the flash illumination, I F , and the product of the snapshot exposure time, E S , the snapshot gain, G S , and the viewfinder illumination, I V . On the right side of the equation, the first product (E F , G S , and I F ) represents the amount of light added by flash device  114  and the second product (E S , G S , and I V ) represents the amount of light present in viewfinder mode.
 
 E   V   ·G   V   ·I   V   =E   F   ·G   S   ·I   F   +E   S   ·G   S   ·I   V   [12]
 
     G S  is solved for in equation [12] to get equation [13]. 
     
       
         
           
             
               
                 
                   
                     G 
                     S 
                   
                   = 
                   
                     
                       
                         E 
                         V 
                       
                       · 
                       
                         G 
                         V 
                       
                       · 
                       
                         I 
                         V 
                       
                     
                     
                       
                         
                           E 
                           F 
                         
                         · 
                         
                           I 
                           F 
                         
                       
                       + 
                       
                         
                           E 
                           S 
                         
                         · 
                         
                           I 
                           V 
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   13 
                   ] 
                 
               
             
           
         
       
     
     To remove the (E F ·I F ) term in the denominator of equation [13], equation [14] is used.
 
 E   F   ·G   F   ·I   F   =E   V   ·G   V   ·I   V   [14]
 
     The (E F ·I F ) term of equation [14] is solved for to get equation [15]. 
     
       
         
           
             
               
                 
                   
                     
                       E 
                       F 
                     
                     · 
                     
                       I 
                       F 
                     
                   
                   = 
                   
                     
                       
                         
                           E 
                           V 
                         
                         · 
                         
                           G 
                           V 
                         
                       
                       
                         G 
                         F 
                       
                     
                     · 
                     
                       I 
                       V 
                     
                   
                 
               
               
                 
                   [ 
                   15 
                   ] 
                 
               
             
           
         
       
     
     The 
             (           E   V     ·     G   V         G   F       ·     I   V       )         
term is substituted into equation [13] for the (E F ·I F ) term to get equation [16].
 
     
       
         
           
             
               
                 
                   
                     G 
                     S 
                   
                   = 
                   
                     
                       
                         E 
                         V 
                       
                       · 
                       
                         G 
                         V 
                       
                       · 
                       
                         I 
                         V 
                       
                     
                     
                       
                         
                           
                             
                               E 
                               V 
                             
                             · 
                             
                               G 
                               V 
                             
                           
                           
                             G 
                             F 
                           
                         
                         · 
                         
                           I 
                           V 
                         
                       
                       + 
                       
                         
                           E 
                           S 
                         
                         · 
                         
                           I 
                           V 
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   16 
                   ] 
                 
               
             
           
         
       
     
     The viewfinder illumination, I V , on the right side of equation [16] cancels to get equation [17]. 
     
       
         
           
             
               
                 
                   
                     G 
                     S 
                   
                   = 
                   
                     
                       
                         E 
                         V 
                       
                       · 
                       
                         G 
                         V 
                       
                     
                     
                       
                         
                           
                             E 
                             V 
                           
                           · 
                           
                             G 
                             V 
                           
                         
                         
                           G 
                           F 
                         
                       
                       + 
                       
                         E 
                         S 
                       
                     
                   
                 
               
               
                 
                   [ 
                   17 
                   ] 
                 
               
             
           
         
       
     
     An auto exposure function in host  110  measures EGP V , i.e., E V ·G V , during viewfinder mode. The snapshot exposure time, E S , is programmed by a user of system  100  and is set to be slightly longer than the frame time of image sensor array  128 . The flash gain, G F , is also programmed by a user of system  100  according to the flash gain of the xenon flash device. Accordingly, host  110  calculates the snapshot gain using equation [17]. 
     The snapshot gain, G S , and exposure time, E S , are stored in registers  124  as indicated by a block  704 . A determination is made as to whether a snapshot signal has been received from host  110  by camera module  112  as indicated by a block  706 . If a snapshot signal has not been received, then the determination of block  706  is made again at a later time. If a snapshot signal has been received, then an exposure is begun to capture an image using image sensor array  128  as indicated by a block  708 . A flash signal is provided to flash device  114  to cause the xenon flash to be fired as indicated by a block  710 . The exposure is finished according to the exposure time as indicated by a block  712 . Processing is performed on the image by gain amplifier  130  using the gain as indicated by a block  714 . The processed image is stored in memory  120  on host  110  as indicated by a block  716 . 
       FIG. 8  illustrates the operation of snapshot mode with a xenon flash device. Timing diagram  800  illustrates a snapshot signal  802 , a first row exposure signal  804 , a last row exposure signal  806 , a xenon flash trigger signal  808 , and a data out signal  810 . 
     At a time t 1 , host  110  provides a snapshot signal to camera module  112 . At a time t 2 , the first row of image sensor array  128  begins exposing, and at time t 3 , the last row of image sensor array  128  begins exposing. Thus, the frame time in  FIG. 8  is the amount of time between t 2  and t 3 . The xenon flash is fired at time t 4  in response to a flash signal from camera module  112 . With a xenon flash, the flash signal comprises a pulse with a relatively short duration. The first row of image sensor array  128  finishes exposing at time t 5 . At time t 5 , data output from image sensor array  128  to gain amplifier  130  begins and continues until time t 6  when the last row of image sensor array  128  finishes exposing. 
       FIGS. 9 and 10  illustrate an embodiment of system  100  in the snapshot mode of operation where flash device  114  is a xenon flash device and image sensor array  128  operates as a fixed, i.e., non-rolling, shutter. With a fixed or non-rolling shutter, all rows of image sensor array  128  are exposed simultaneously.  FIG. 9  is a third embodiment of a method for capturing an image in a snapshot mode of operation.  FIG. 10  is a timing diagram  1000  illustrating a third example of signals used to capture an image in a snapshot mode of operation. 
     In snapshot mode, host  110  determines whether a flash is desired by analyzing the one or more images received from camera module  112  during viewfinder mode. In response to determining that a flash is desired, host  110  accesses the flash enable/flash type register  200  to enable flash device  114 . Host  110  also detects that the flash type of flash device  114  is a xenon flash device. Camera module  112  provides a flash signal to the xenon flash device to cause the flash to be fired. With a xenon flash device, all of the flash energy is discharged in a relatively short time period. 
     Referring to  FIG. 9 , a snapshot exposure time, E S , is calculated as indicated in a block  902 . The snapshot exposure time is derived as follows. For proper exposure, the exposure-gain product times the illumination in snapshot mode is set equal to the exposure-gain product times the illumination in viewfinder mode as shown in equation [18].
 
 E   V   ·G   V   ·I   V   =E   S   ·G   S   ·I   S   [18]
 
     In equation [19], the exposure-gain product times the illumination in viewfinder mode is equal to the sum of the product of the exposure time of the flash, E F , the snapshot gain, G S , and the flash illumination, I F , and the product of the snapshot exposure time, E S , the snapshot gain, G S , and the viewfinder illumination, I V . On the right side of the equation, the first product (E F , G S , and I F ) represents the amount of light added by flash device  114  and the second product (E S , G S , and I V ) represents the amount of light present in viewfinder mode.
 
 E   V   ·G   V   ·I   V   =E   F   ·G   S   ·I   F   +E   S   ·G   S   ·I   V   [19]
 
     To remove the flash illumination, I F , from equation [19], equation [20] is used.
 
 E   F   ·G   F   ·I   F   =E   V   ·G   V   ·I   V   [20]
 
     The flash illumination, I F , is solved for in equation [20] to get equation [21]. 
     
       
         
           
             
               
                 
                   
                     I 
                     F 
                   
                   = 
                   
                     
                       
                         E 
                         V 
                       
                       · 
                       
                         G 
                         V 
                       
                       · 
                       
                         I 
                         V 
                       
                     
                     
                       
                         E 
                         F 
                       
                       · 
                       
                         G 
                         F 
                       
                     
                   
                 
               
               
                 
                   [ 
                   21 
                   ] 
                 
               
             
           
         
       
     
     The 
             (         E   V     ·     G   V     ·     I   V           E   F     ·     G   F         )         
term from equation [21] is substituted into equation [19] for I V  to get equation [22].
 
     
       
         
           
             
               
                 
                   
                     
                       E 
                       V 
                     
                     · 
                     
                       G 
                       V 
                     
                     · 
                     
                       I 
                       V 
                     
                   
                   = 
                   
                     
                       
                         E 
                         F 
                       
                       · 
                       
                         G 
                         S 
                       
                       · 
                       
                         
                           
                             E 
                             V 
                           
                           · 
                           
                             G 
                             V 
                           
                           · 
                           
                             I 
                             V 
                           
                         
                         
                           
                             E 
                             F 
                           
                           · 
                           
                             G 
                             F 
                           
                         
                       
                     
                     + 
                     
                       
                         E 
                         S 
                       
                       · 
                       
                         G 
                         S 
                       
                       · 
                       
                         I 
                         V 
                       
                     
                   
                 
               
               
                 
                   [ 
                   22 
                   ] 
                 
               
             
           
         
       
     
     The viewfinder illumination, I V , on both sides of equation [22] cancels and the flash exposure time, E F , on the right side of equation [22] cancels to get equation [23]. 
     
       
         
           
             
               
                 
                   
                     
                       E 
                       V 
                     
                     · 
                     
                       G 
                       V 
                     
                   
                   = 
                   
                     
                       
                         E 
                         V 
                       
                       · 
                       
                         G 
                         V 
                       
                       · 
                       
                         
                           G 
                           S 
                         
                         
                           G 
                           F 
                         
                       
                     
                     + 
                     
                       
                         E 
                         S 
                       
                       · 
                       
                         G 
                         S 
                       
                     
                   
                 
               
               
                 
                   [ 
                   23 
                   ] 
                 
               
             
           
         
       
     
     The snapshot exposure time, E S , is solved for in equation [23] to get equation [24]. 
     
       
         
           
             
               
                 
                   
                     E 
                     S 
                   
                   = 
                   
                     
                       
                         
                           E 
                           V 
                         
                         · 
                         
                           G 
                           V 
                         
                       
                       
                         G 
                         S 
                       
                     
                     - 
                     
                       
                         
                           E 
                           V 
                         
                         · 
                         
                           G 
                           V 
                         
                       
                       
                         G 
                         F 
                       
                     
                   
                 
               
               
                 
                   [ 
                   24 
                   ] 
                 
               
             
           
         
       
     
     The terms of equation [24] are rearranged to get equation [25]. 
     
       
         
           
             
               
                 
                   
                     E 
                     S 
                   
                   = 
                   
                     
                       E 
                       V 
                     
                     · 
                     
                       
                         G 
                         V 
                       
                       ⁡ 
                       
                         ( 
                         
                           
                             
                               G 
                               F 
                             
                             - 
                             
                               G 
                               S 
                             
                           
                           
                             
                               G 
                               F 
                             
                             · 
                             
                               G 
                               S 
                             
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   [ 
                   25 
                   ] 
                 
               
             
           
         
       
     
     An auto exposure function in host  110  measures EGP V , i.e., E V ·G V , during viewfinder mode. The snapshot gain, G S , is programmed by a user of system  100 . The flash gain, G F , is programmed by a user of system  100  according to the flash gain of the xenon flash device. Accordingly, host  110  calculates the snapshot gain using equation [25]. 
     The snapshot gain, G S , and exposure time, E S , are stored in registers  124  as indicated by a block  904 . A determination is made as to whether a snapshot signal has been received from host  110  by camera module  112  as indicated by a block  906 . If a snapshot signal has not been received, then the determination of block  906  is made again at a later time. If a snapshot signal has been received, then an exposure is begun to capture an image using image sensor array  128  as indicated by a block  908 . A flash signal is provided to flash device  114  to cause the xenon flash to be fired as indicated by a block  910 . The exposure is finished according to the exposure time as indicated by a block  912 . Processing is performed on the image by gain amplifier  130  using the gain as indicated by a block  914 . The processed image is stored in memory  120  on host  110  as indicated by a block  916 . 
       FIG. 10  illustrates the operation of snapshot mode with a xenon flash device. Timing diagram  1000  illustrates a snapshot signal  1002 , a rows exposed signal  1004 , a xenon flash trigger signal  1006 , and a data out signal  1008 . 
     At a time t 1 , host  110  provides a snapshot signal to camera module  112 . At a time t 2 , all rows of image sensor array  128  begin exposing. The xenon flash is fired at time t 3  in response to a flash signal from camera module  112 . With a xenon flash, the flash signal comprises a pulse with a relatively short duration. The rows of image sensor array  128  finish exposing at time t 4 . At time t 4 , data output from image sensor array  128  to gain amplifier  130  begins and continues until time t 5  when all of the row data has been output. 
       FIG. 11  is a block diagram illustrating an embodiment of a mobile telephone  1100  that comprises the embodiment of  FIG. 1 . Mobile telephone  1100  comprises system  100  as shown in  FIG. 1 . Mobile telephone  1100  is configured to allow a user to place and receive telephone calls and other voice and data transmissions using a wireless network. 
     Mobile telephone  1100  illustrates one embodiment of a system that includes system  100 . In other embodiments, system  100  may be included in other types of portable devices such as personal digital assistants (PDAs), laptop computer systems, handheld electronic devices, or other portable processing systems. System  100  may also be included in other types of non-portable devices such as desktop computer systems, video game machines, or other non-portable processing systems. 
       FIG. 12  is a block diagram illustrating an alternative embodiment of the system of  FIG. 1 . In  FIG. 12 , system  1200  is configured to perform the same functions of system  100  described above. System  1200  comprises host  110 , a camera module  1202 , and flash device  114 . Camera module  1202  comprises interface  122 , registers  124 , control circuit  126 , image sensor array  128 , gain amplifier  130 , analog-to digital converter  132 , image processing circuit  134 , a processor  1204 , and firmware  1206 . 
     In the embodiment of  FIG. 12 , camera module  1202  performs many of the functions described above in  FIGS. 5 ,  7 , and  9  with respect to host  110  using processor  1204  and firmware  1206 . In particular, processor  1204  and firmware  1206  generate parameters used in the viewfinder and snapshot modes of operation of camera module  1202 . These parameters include exposure time, gain, and white balance coefficients. System  1200  may be used in place of system  100  in system  1100  shown in  FIG. 11 . 
     The embodiments described above used various combinations of hardware and software components to implement the features described above. In other embodiments, other combinations of hardware and software components may be used. 
     Although specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that a variety of alternate and/or equivalent implementations may be substituted for the specific embodiments shown and described without departing from the scope of the present invention. This application is intended to cover any adaptations or variations of the specific embodiments discussed herein. Therefore, it is intended that this invention be limited only by the claims and the equivalents thereof.