Port of TI's CC3100 Websock camera demo. Using FreeRTOS, mbedTLS, also parts of Arducam for cams ov5642 and 0v2640. Can also use MT9D111. Work in progress. Be warned some parts maybe a bit flacky. This is for Seeed Arch max only, for an M3, see the demo for CM3 using the 0v5642 aducam mini.

Dependencies:   mbed

Revision:
16:7e5aab2fabba
Parent:
15:5433f9d94cd7
Child:
18:3f1b52616d00
--- a/camera_app/camera_app.cpp	Fri Aug 28 21:04:44 2015 +0000
+++ b/camera_app/camera_app.cpp	Sun Aug 30 21:10:11 2015 +0000
@@ -429,7 +429,7 @@
     //
     // Create JPEG Header
     //
-#ifndef OV2640_CAM    
+#ifdef MT9D111_CAM    
 #ifdef ENABLE_JPEG
     memset(g_image.g_header, '\0', sizeof(g_image.g_header));
     g_header_length = CreateJpegHeader((char *)&(g_image.g_header[0]), PIXELS_IN_X_AXIS, PIXELS_IN_Y_AXIS, 0, 0x0020, 9);
@@ -449,7 +449,7 @@
 #endif//ENABLE_JPEG
     *WriteBuffer = (char*)Image;
     return(g_header_length += g_frame_size_in_bytes);
-#endif//OV2640_CAM    
+#endif//MT9D111_CAM    
     *WriteBuffer = (char*)Image;
 
     return(g_frame_size_in_bytes);
@@ -470,11 +470,9 @@
 
     phdcmi.Init.SynchroMode      = DCMI_SYNCHRO_HARDWARE;
 #ifdef OV5642_CAM       
-//    phdcmi.Init.PCKPolarity      = DCMI_PCKPOLARITY_FALLING;//Data clocked out on falling edge
     phdcmi.Init.PCKPolarity      = DCMI_PCKPOLARITY_RISING;//Data clocked out on rising edge
-    phdcmi.Init.VSPolarity       = DCMI_VSPOLARITY_LOW;//Active low
-//    phdcmi.Init.HSPolarity       = DCMI_HSPOLARITY_LOW;//Active low
-    phdcmi.Init.HSPolarity       = DCMI_HSPOLARITY_HIGH;//Active high
+    phdcmi.Init.VSPolarity       = DCMI_VSPOLARITY_HIGH;//Active high
+    phdcmi.Init.HSPolarity       = DCMI_HSPOLARITY_LOW;//Active low
 #endif    
 #ifdef OV2640_CAM    
     phdcmi.Init.PCKPolarity      = DCMI_PCKPOLARITY_RISING;//Data clocked out on rising edge
@@ -483,10 +481,8 @@
 #endif    
 #ifdef MT9D111_CAM
     phdcmi.Init.PCKPolarity      = DCMI_PCKPOLARITY_RISING;//Data clocked out on rising edge 
-//    phdcmi.Init.PCKPolarity      = DCMI_PCKPOLARITY_FALLING;//Data clocked out on falling edge 
-    phdcmi.Init.VSPolarity       = DCMI_VSPOLARITY_HIGH;//Active high       
-//    phdcmi.Init.VSPolarity       = DCMI_VSPOLARITY_LOW;//Active high
-//    phdcmi.Init.HSPolarity       = DCMI_HSPOLARITY_LOW;//Active low
+//    phdcmi.Init.PCKPolarity      = DCMI_PCKPOLARITY_FALLING;//Data clocked out on falling edge       
+    phdcmi.Init.VSPolarity       = DCMI_VSPOLARITY_LOW;//Active high
     phdcmi.Init.HSPolarity       = DCMI_HSPOLARITY_HIGH;//Active high    
 #endif        
     phdcmi.Init.CaptureRate      = DCMI_CR_ALL_FRAME;
@@ -600,11 +596,11 @@
 
         /*** Configure the NVIC for DCMI and DMA ***/
         /* NVIC configuration for DCMI transfer complete interrupt */
-        HAL_NVIC_SetPriority(DCMI_IRQn, 1, 0);
+        HAL_NVIC_SetPriority(DCMI_IRQn, 3, 0);
         HAL_NVIC_EnableIRQ(DCMI_IRQn);
 
         /* NVIC configuration for DMA2 transfer complete interrupt */
-        HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 1, 0);
+        HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 3, 0);
         HAL_NVIC_EnableIRQ(DMA2_Stream1_IRQn);
 
         HAL_DMA_Init(&phdma_dcmi);