aboutsummaryrefslogtreecommitdiff
path: root/hsm-cam/FFI/Cam.hpp
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-08-20 02:23:39 +0000
committerPaul Oliver <contact@pauloliver.dev>2025-08-23 22:59:12 +0000
commit6db2d77345b1d3da432a73d9eaf0be34165567c3 (patch)
tree0bc2606a60a3458aacb04fd5c3765d2554295e81 /hsm-cam/FFI/Cam.hpp
parent5a78bc1885ad7d6fd7ad63d6ef900188ab38a80c (diff)
Adds camera service
Diffstat (limited to 'hsm-cam/FFI/Cam.hpp')
-rw-r--r--hsm-cam/FFI/Cam.hpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/hsm-cam/FFI/Cam.hpp b/hsm-cam/FFI/Cam.hpp
index c2cd4ed..374e16a 100644
--- a/hsm-cam/FFI/Cam.hpp
+++ b/hsm-cam/FFI/Cam.hpp
@@ -1,6 +1,16 @@
#ifndef CAM_HPP
#define CAM_HPP
+// RGB888 configuration for ov5647 sensor (Raspberry Pi Camera Module)
+// Must be updated if either:
+// - Pixel format changes (e.g., to BGR, YUV, etc.)
+// - Camera module is replaced
+#define FRAME_WIDTH (800)
+#define FRAME_HEIGHT (600)
+#define FRAME_LINE (FRAME_WIDTH * 3)
+#define FRAME_STRIDE (FRAME_LINE + 32)
+#define FRAME_BUFFER_LENGTH (FRAME_STRIDE * FRAME_HEIGHT + 3072)
+
enum Severity
{
Attention = 0,
@@ -9,7 +19,7 @@ enum Severity
};
typedef void (*HsLogger)(enum Severity, const char *);
-typedef void (*HsCallback)(int fd);
+typedef void (*HsCallback)();
#ifdef __cplusplus
extern "C"
@@ -17,9 +27,18 @@ extern "C"
#endif
void register_logger(HsLogger hs_logger);
void register_callback(HsCallback hs_callback);
- void initialize_ffi();
- void shutdown_ffi();
- void request_capture();
+ void start_camera_manager();
+ void stop_camera_manager();
+ void acquire_camera();
+ void release_camera();
+ void allocate_frame_buffer();
+ void free_frame_buffer();
+ void start_camera();
+ void stop_camera();
+ void create_request();
+
+ int get_dma_buffer_fd();
+ void request_frame();
#ifdef __cplusplus
}
#endif