From 22d8ac4e8052b823f13c8f3cbfc3f1469679100e Mon Sep 17 00:00:00 2001 From: Kostas Missos Date: Wed, 7 Mar 2018 01:50:33 +0200 Subject: [PATCH] [irs] Add supported modes --- nx/include/switch/services/irs.h | 20 ++++++++++++-------- nx/source/services/irs.c | 1 - 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/nx/include/switch/services/irs.h b/nx/include/switch/services/irs.h index abfeee54..67b340f0 100644 --- a/nx/include/switch/services/irs.h +++ b/nx/include/switch/services/irs.h @@ -26,22 +26,22 @@ typedef struct { } PACKED irsPackedMomentProcessorConfig; typedef struct { - u64 exposure; ///< IR Sensor exposure time in microseconds. - u32 ir_leds; ///< Controls IR leds. Can be all, group 1, group 2 or none. + u64 exposure; ///< IR Sensor exposure time in nanoseconds. + u32 ir_leds; ///< Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None. u32 digital_gain; ///< IR sensor signal's digital gain. - u8 negative; ///< Inverts the captured image. + u8 negative; ///< Inverts the captured image. 0: Normal image, 1: Negative image. u8 pad[7]; - u32 sensor_res; ///< IR Sensor resolution. + u32 sensor_res; ///< IR Sensor resolution. 0: 240x320, 1: 120x160, 2: 60x80. } irsImageTransferProcessorConfig; typedef struct { - u64 exposure; ///< IR Sensor exposure time in microseconds. - u8 ir_leds; ///< Controls IR leds. Can be all, group 1, group 2 or none. + u64 exposure; ///< IR Sensor exposure time in nanoseconds. + u8 ir_leds; ///< Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None. u8 digital_gain; ///< IR sensor signal's digital gain. - u8 negative; ///< Inverts the captured image. + u8 negative; ///< Inverts the captured image. 0: Normal image, 1: Negative image. u8 pad[5]; u32 unk_constant;//offset 0x10 - u8 sensor_res; ///< IR Sensor resolution. + u8 sensor_res; ///< IR Sensor resolution. 0: 240x320, 1: 120x160, 2: 60x80. u8 pad2[3]; } irsPackedImageTransferProcessorConfig; @@ -79,4 +79,8 @@ Result irsStopImageProcessor(u32 IrCameraHandle); /// TODO: What does this really do? Result irsSuspendImageProcessor(u32 IrCameraHandle); +/** + * Gets the default configuration for Image Transfer mode. + * Defaults are exposure 300us, IR LEDs all ON, 8x digital gain, normal image and resolution 240 x 320. + */ void irsGetDefaultImageTransferProcessorConfig(irsImageTransferProcessorConfig *config); diff --git a/nx/source/services/irs.c b/nx/source/services/irs.c index 37fdeb34..aecac488 100644 --- a/nx/source/services/irs.c +++ b/nx/source/services/irs.c @@ -416,7 +416,6 @@ Result irsGetImageTransferProcessorState(u32 IrCameraHandle, void* buffer, size_ void irsGetDefaultImageTransferProcessorConfig(irsImageTransferProcessorConfig *config) { memset(config, 0, sizeof(irsImageTransferProcessorConfig)); - //Set default exposure 300ms, IR LEDs all ON, 8x digital gain, normal image and resolution 240 x 320. config->exposure = 300000; config->ir_leds = 0; config->digital_gain = 8;