[irs] Add supported modes

This commit is contained in:
Kostas Missos 2018-03-07 01:50:33 +02:00
parent 84ef73fce9
commit 22d8ac4e80
2 changed files with 12 additions and 9 deletions

View File

@ -26,22 +26,22 @@ typedef struct {
} PACKED irsPackedMomentProcessorConfig; } PACKED irsPackedMomentProcessorConfig;
typedef struct { typedef struct {
u64 exposure; ///< IR Sensor exposure time in microseconds. u64 exposure; ///< IR Sensor exposure time in nanoseconds.
u32 ir_leds; ///< Controls IR leds. Can be all, group 1, group 2 or none. 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. 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]; u8 pad[7];
u32 sensor_res; ///< IR Sensor resolution. u32 sensor_res; ///< IR Sensor resolution. 0: 240x320, 1: 120x160, 2: 60x80.
} irsImageTransferProcessorConfig; } irsImageTransferProcessorConfig;
typedef struct { typedef struct {
u64 exposure; ///< IR Sensor exposure time in microseconds. u64 exposure; ///< IR Sensor exposure time in nanoseconds.
u8 ir_leds; ///< Controls IR leds. Can be all, group 1, group 2 or none. 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 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]; u8 pad[5];
u32 unk_constant;//offset 0x10 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]; u8 pad2[3];
} irsPackedImageTransferProcessorConfig; } irsPackedImageTransferProcessorConfig;
@ -79,4 +79,8 @@ Result irsStopImageProcessor(u32 IrCameraHandle);
/// TODO: What does this really do? /// TODO: What does this really do?
Result irsSuspendImageProcessor(u32 IrCameraHandle); 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); void irsGetDefaultImageTransferProcessorConfig(irsImageTransferProcessorConfig *config);

View File

@ -416,7 +416,6 @@ Result irsGetImageTransferProcessorState(u32 IrCameraHandle, void* buffer, size_
void irsGetDefaultImageTransferProcessorConfig(irsImageTransferProcessorConfig *config) { void irsGetDefaultImageTransferProcessorConfig(irsImageTransferProcessorConfig *config) {
memset(config, 0, sizeof(irsImageTransferProcessorConfig)); 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->exposure = 300000;
config->ir_leds = 0; config->ir_leds = 0;
config->digital_gain = 8; config->digital_gain = 8;