CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
camera_capture.c File Reference
#include "littlefs/littlefs_helper.h"
#include "littlefs/lfs.h"
#include "littlefs/littlefs_driver.h"
#include "debug_tools/debug_uart.h"
#include "camera/camera_capture.h"
#include "uart_handler/uart_handler.h"
#include "log/log.h"
#include "eps_drivers/eps_channel_control.h"
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#include "main.h"
Include dependency graph for camera_capture.c:

Functions

static void CAM_end_camera_receive_due_to_error (lfs_file_t *img_file)
 
static uint8_t CAM_receive_image (lfs_file_t *img_file)
 Capture an image, writing to a file in LFS.
 
CAM_capture_status_enum CAM_capture_image (char filename_str[], char lighting_mode)
 Capture an image, writing to a file in LFS.
 
void CAM_repeated_error_log_message ()
 

Variables

static const uint32_t CAMERA_RX_TOTAL_TIMEOUT_DURATION_MS = 12000
 Timeout duration for camera receive in milliseconds.
 

Function Documentation

◆ CAM_capture_image()

CAM_capture_status_enum CAM_capture_image ( char filename_str[],
char lighting_mode )

Capture an image, writing to a file in LFS.

Parameters
filename_strThe name of the file to write to.
lighting_modeShould be a lower-case char d - daylight ambient light m - medium ambient light n - night ambient light s - solar sail contrast and light
Returns
0: Successfully captured image, more than 0, error occurred
Note
This function does not validate that the camera is connected or powered on.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CAM_end_camera_receive_due_to_error()

static void CAM_end_camera_receive_due_to_error ( lfs_file_t * img_file)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CAM_receive_image()

static uint8_t CAM_receive_image ( lfs_file_t * img_file)
static

Capture an image, writing to a file in LFS.

Returns
0: Success, 3: Failed UART reception, 4: Timeout while waiting for data
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CAM_repeated_error_log_message()

void CAM_repeated_error_log_message ( )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CAMERA_RX_TOTAL_TIMEOUT_DURATION_MS

const uint32_t CAMERA_RX_TOTAL_TIMEOUT_DURATION_MS = 12000
static

Timeout duration for camera receive in milliseconds.