Use IPC:MakeHeader instead of hardcoded raw values for IPC command tables. (#6453)

* Use IPC:MakeHeader instead of hardcoded values for IPC command tables.

* Use u32 instead of unsigned int in MakeHeader function

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>

* Fix clang format

---------

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>
This commit is contained in:
PabloMK7 2023-04-28 07:31:03 +02:00 committed by GitHub
parent 9bd8c9290b
commit 63bc0b59bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 1983 additions and 1896 deletions

View file

@ -10,71 +10,70 @@ namespace Service::CAM {
CAM_C::CAM_C(std::shared_ptr<Module> cam) : Module::Interface(std::move(cam), "cam:c", 1) {
static const FunctionInfo functions[] = {
{0x00010040, &CAM_C::StartCapture, "StartCapture"},
{0x00020040, &CAM_C::StopCapture, "StopCapture"},
{0x00030040, &CAM_C::IsBusy, "IsBusy"},
{0x00040040, &CAM_C::ClearBuffer, "ClearBuffer"},
{0x00050040, &CAM_C::GetVsyncInterruptEvent, "GetVsyncInterruptEvent"},
{0x00060040, &CAM_C::GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"},
{0x00070102, &CAM_C::SetReceiving, "SetReceiving"},
{0x00080040, &CAM_C::IsFinishedReceiving, "IsFinishedReceiving"},
{0x00090100, &CAM_C::SetTransferLines, "SetTransferLines"},
{0x000A0080, &CAM_C::GetMaxLines, "GetMaxLines"},
{0x000B0100, &CAM_C::SetTransferBytes, "SetTransferBytes"},
{0x000C0040, &CAM_C::GetTransferBytes, "GetTransferBytes"},
{0x000D0080, &CAM_C::GetMaxBytes, "GetMaxBytes"},
{0x000E0080, &CAM_C::SetTrimming, "SetTrimming"},
{0x000F0040, &CAM_C::IsTrimming, "IsTrimming"},
{0x00100140, &CAM_C::SetTrimmingParams, "SetTrimmingParams"},
{0x00110040, &CAM_C::GetTrimmingParams, "GetTrimmingParams"},
{0x00120140, &CAM_C::SetTrimmingParamsCenter, "SetTrimmingParamsCenter"},
{0x00130040, &CAM_C::Activate, "Activate"},
{0x00140080, &CAM_C::SwitchContext, "SwitchContext"},
{0x00150080, nullptr, "SetExposure"},
{0x00160080, nullptr, "SetWhiteBalance"},
{0x00170080, nullptr, "SetWhiteBalanceWithoutBaseUp"},
{0x00180080, nullptr, "SetSharpness"},
{0x00190080, nullptr, "SetAutoExposure"},
{0x001A0040, nullptr, "IsAutoExposure"},
{0x001B0080, nullptr, "SetAutoWhiteBalance"},
{0x001C0040, nullptr, "IsAutoWhiteBalance"},
{0x001D00C0, &CAM_C::FlipImage, "FlipImage"},
{0x001E0200, &CAM_C::SetDetailSize, "SetDetailSize"},
{0x001F00C0, &CAM_C::SetSize, "SetSize"},
{0x00200080, &CAM_C::SetFrameRate, "SetFrameRate"},
{0x00210080, nullptr, "SetPhotoMode"},
{0x002200C0, &CAM_C::SetEffect, "SetEffect"},
{0x00230080, nullptr, "SetContrast"},
{0x00240080, nullptr, "SetLensCorrection"},
{0x002500C0, &CAM_C::SetOutputFormat, "SetOutputFormat"},
{0x00260140, nullptr, "SetAutoExposureWindow"},
{0x00270140, nullptr, "SetAutoWhiteBalanceWindow"},
{0x00280080, nullptr, "SetNoiseFilter"},
{0x00290080, &CAM_C::SynchronizeVsyncTiming, "SynchronizeVsyncTiming"},
{0x002A0080, &CAM_C::GetLatestVsyncTiming, "GetLatestVsyncTiming"},
{0x002B0000, &CAM_C::GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"},
{0x002C0400, nullptr, "SetStereoCameraCalibrationData"},
{0x002D00C0, nullptr, "WriteRegisterI2c"},
{0x002E00C0, nullptr, "WriteMcuVariableI2c"},
{0x002F0080, nullptr, "ReadRegisterI2cExclusive"},
{0x00300080, nullptr, "ReadMcuVariableI2cExclusive"},
{0x00310180, nullptr, "SetImageQualityCalibrationData"},
{0x00320000, nullptr, "GetImageQualityCalibrationData"},
{0x003302C0, &CAM_C::SetPackageParameterWithoutContext,
"SetPackageParameterWithoutContext"},
{0x00340140, &CAM_C::SetPackageParameterWithContext, "SetPackageParameterWithContext"},
{0x003501C0, &CAM_C::SetPackageParameterWithContextDetail,
"SetPackageParameterWithContextDetail"},
{0x00360000, &CAM_C::GetSuitableY2rStandardCoefficient,
"GetSuitableY2rStandardCoefficient"},
{0x00370202, nullptr, "PlayShutterSoundWithWave"},
{0x00380040, &CAM_C::PlayShutterSound, "PlayShutterSound"},
{0x00390000, &CAM_C::DriverInitialize, "DriverInitialize"},
{0x003A0000, &CAM_C::DriverFinalize, "DriverFinalize"},
{0x003B0000, nullptr, "GetActivatedCamera"},
{0x003C0000, nullptr, "GetSleepCamera"},
{0x003D0040, nullptr, "SetSleepCamera"},
{0x003E0040, nullptr, "SetBrightnessSynchronization"},
// clang-format off
{IPC::MakeHeader(0x0001, 1, 0), &CAM_C::StartCapture, "StartCapture"},
{IPC::MakeHeader(0x0002, 1, 0), &CAM_C::StopCapture, "StopCapture"},
{IPC::MakeHeader(0x0003, 1, 0), &CAM_C::IsBusy, "IsBusy"},
{IPC::MakeHeader(0x0004, 1, 0), &CAM_C::ClearBuffer, "ClearBuffer"},
{IPC::MakeHeader(0x0005, 1, 0), &CAM_C::GetVsyncInterruptEvent, "GetVsyncInterruptEvent"},
{IPC::MakeHeader(0x0006, 1, 0), &CAM_C::GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"},
{IPC::MakeHeader(0x0007, 4, 2), &CAM_C::SetReceiving, "SetReceiving"},
{IPC::MakeHeader(0x0008, 1, 0), &CAM_C::IsFinishedReceiving, "IsFinishedReceiving"},
{IPC::MakeHeader(0x0009, 4, 0), &CAM_C::SetTransferLines, "SetTransferLines"},
{IPC::MakeHeader(0x000A, 2, 0), &CAM_C::GetMaxLines, "GetMaxLines"},
{IPC::MakeHeader(0x000B, 4, 0), &CAM_C::SetTransferBytes, "SetTransferBytes"},
{IPC::MakeHeader(0x000C, 1, 0), &CAM_C::GetTransferBytes, "GetTransferBytes"},
{IPC::MakeHeader(0x000D, 2, 0), &CAM_C::GetMaxBytes, "GetMaxBytes"},
{IPC::MakeHeader(0x000E, 2, 0), &CAM_C::SetTrimming, "SetTrimming"},
{IPC::MakeHeader(0x000F, 1, 0), &CAM_C::IsTrimming, "IsTrimming"},
{IPC::MakeHeader(0x0010, 5, 0), &CAM_C::SetTrimmingParams, "SetTrimmingParams"},
{IPC::MakeHeader(0x0011, 1, 0), &CAM_C::GetTrimmingParams, "GetTrimmingParams"},
{IPC::MakeHeader(0x0012, 5, 0), &CAM_C::SetTrimmingParamsCenter, "SetTrimmingParamsCenter"},
{IPC::MakeHeader(0x0013, 1, 0), &CAM_C::Activate, "Activate"},
{IPC::MakeHeader(0x0014, 2, 0), &CAM_C::SwitchContext, "SwitchContext"},
{IPC::MakeHeader(0x0015, 2, 0), nullptr, "SetExposure"},
{IPC::MakeHeader(0x0016, 2, 0), nullptr, "SetWhiteBalance"},
{IPC::MakeHeader(0x0017, 2, 0), nullptr, "SetWhiteBalanceWithoutBaseUp"},
{IPC::MakeHeader(0x0018, 2, 0), nullptr, "SetSharpness"},
{IPC::MakeHeader(0x0019, 2, 0), nullptr, "SetAutoExposure"},
{IPC::MakeHeader(0x001A, 1, 0), nullptr, "IsAutoExposure"},
{IPC::MakeHeader(0x001B, 2, 0), nullptr, "SetAutoWhiteBalance"},
{IPC::MakeHeader(0x001C, 1, 0), nullptr, "IsAutoWhiteBalance"},
{IPC::MakeHeader(0x001D, 3, 0), &CAM_C::FlipImage, "FlipImage"},
{IPC::MakeHeader(0x001E, 8, 0), &CAM_C::SetDetailSize, "SetDetailSize"},
{IPC::MakeHeader(0x001F, 3, 0), &CAM_C::SetSize, "SetSize"},
{IPC::MakeHeader(0x0020, 2, 0), &CAM_C::SetFrameRate, "SetFrameRate"},
{IPC::MakeHeader(0x0021, 2, 0), nullptr, "SetPhotoMode"},
{IPC::MakeHeader(0x0022, 3, 0), &CAM_C::SetEffect, "SetEffect"},
{IPC::MakeHeader(0x0023, 2, 0), nullptr, "SetContrast"},
{IPC::MakeHeader(0x0024, 2, 0), nullptr, "SetLensCorrection"},
{IPC::MakeHeader(0x0025, 3, 0), &CAM_C::SetOutputFormat, "SetOutputFormat"},
{IPC::MakeHeader(0x0026, 5, 0), nullptr, "SetAutoExposureWindow"},
{IPC::MakeHeader(0x0027, 5, 0), nullptr, "SetAutoWhiteBalanceWindow"},
{IPC::MakeHeader(0x0028, 2, 0), nullptr, "SetNoiseFilter"},
{IPC::MakeHeader(0x0029, 2, 0), &CAM_C::SynchronizeVsyncTiming, "SynchronizeVsyncTiming"},
{IPC::MakeHeader(0x002A, 2, 0), &CAM_C::GetLatestVsyncTiming, "GetLatestVsyncTiming"},
{IPC::MakeHeader(0x002B, 0, 0), &CAM_C::GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"},
{IPC::MakeHeader(0x002C, 16, 0), nullptr, "SetStereoCameraCalibrationData"},
{IPC::MakeHeader(0x002D, 3, 0), nullptr, "WriteRegisterI2c"},
{IPC::MakeHeader(0x002E, 3, 0), nullptr, "WriteMcuVariableI2c"},
{IPC::MakeHeader(0x002F, 2, 0), nullptr, "ReadRegisterI2cExclusive"},
{IPC::MakeHeader(0x0030, 2, 0), nullptr, "ReadMcuVariableI2cExclusive"},
{IPC::MakeHeader(0x0031, 6, 0), nullptr, "SetImageQualityCalibrationData"},
{IPC::MakeHeader(0x0032, 0, 0), nullptr, "GetImageQualityCalibrationData"},
{IPC::MakeHeader(0x0033, 11, 0), &CAM_C::SetPackageParameterWithoutContext, "SetPackageParameterWithoutContext"},
{IPC::MakeHeader(0x0034, 5, 0), &CAM_C::SetPackageParameterWithContext, "SetPackageParameterWithContext"},
{IPC::MakeHeader(0x0035, 7, 0), &CAM_C::SetPackageParameterWithContextDetail, "SetPackageParameterWithContextDetail"},
{IPC::MakeHeader(0x0036, 0, 0), &CAM_C::GetSuitableY2rStandardCoefficient, "GetSuitableY2rStandardCoefficient"},
{IPC::MakeHeader(0x0037, 8, 2), nullptr, "PlayShutterSoundWithWave"},
{IPC::MakeHeader(0x0038, 1, 0), &CAM_C::PlayShutterSound, "PlayShutterSound"},
{IPC::MakeHeader(0x0039, 0, 0), &CAM_C::DriverInitialize, "DriverInitialize"},
{IPC::MakeHeader(0x003A, 0, 0), &CAM_C::DriverFinalize, "DriverFinalize"},
{IPC::MakeHeader(0x003B, 0, 0), nullptr, "GetActivatedCamera"},
{IPC::MakeHeader(0x003C, 0, 0), nullptr, "GetSleepCamera"},
{IPC::MakeHeader(0x003D, 1, 0), nullptr, "SetSleepCamera"},
{IPC::MakeHeader(0x003E, 1, 0), nullptr, "SetBrightnessSynchronization"},
// clang-format on
};
RegisterHandlers(functions);
}

View file

@ -10,71 +10,70 @@ namespace Service::CAM {
CAM_S::CAM_S(std::shared_ptr<Module> cam) : Module::Interface(std::move(cam), "cam:s", 1) {
static const FunctionInfo functions[] = {
{0x00010040, &CAM_S::StartCapture, "StartCapture"},
{0x00020040, &CAM_S::StopCapture, "StopCapture"},
{0x00030040, &CAM_S::IsBusy, "IsBusy"},
{0x00040040, &CAM_S::ClearBuffer, "ClearBuffer"},
{0x00050040, &CAM_S::GetVsyncInterruptEvent, "GetVsyncInterruptEvent"},
{0x00060040, &CAM_S::GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"},
{0x00070102, &CAM_S::SetReceiving, "SetReceiving"},
{0x00080040, &CAM_S::IsFinishedReceiving, "IsFinishedReceiving"},
{0x00090100, &CAM_S::SetTransferLines, "SetTransferLines"},
{0x000A0080, &CAM_S::GetMaxLines, "GetMaxLines"},
{0x000B0100, &CAM_S::SetTransferBytes, "SetTransferBytes"},
{0x000C0040, &CAM_S::GetTransferBytes, "GetTransferBytes"},
{0x000D0080, &CAM_S::GetMaxBytes, "GetMaxBytes"},
{0x000E0080, &CAM_S::SetTrimming, "SetTrimming"},
{0x000F0040, &CAM_S::IsTrimming, "IsTrimming"},
{0x00100140, &CAM_S::SetTrimmingParams, "SetTrimmingParams"},
{0x00110040, &CAM_S::GetTrimmingParams, "GetTrimmingParams"},
{0x00120140, &CAM_S::SetTrimmingParamsCenter, "SetTrimmingParamsCenter"},
{0x00130040, &CAM_S::Activate, "Activate"},
{0x00140080, &CAM_S::SwitchContext, "SwitchContext"},
{0x00150080, nullptr, "SetExposure"},
{0x00160080, nullptr, "SetWhiteBalance"},
{0x00170080, nullptr, "SetWhiteBalanceWithoutBaseUp"},
{0x00180080, nullptr, "SetSharpness"},
{0x00190080, nullptr, "SetAutoExposure"},
{0x001A0040, nullptr, "IsAutoExposure"},
{0x001B0080, nullptr, "SetAutoWhiteBalance"},
{0x001C0040, nullptr, "IsAutoWhiteBalance"},
{0x001D00C0, &CAM_S::FlipImage, "FlipImage"},
{0x001E0200, &CAM_S::SetDetailSize, "SetDetailSize"},
{0x001F00C0, &CAM_S::SetSize, "SetSize"},
{0x00200080, &CAM_S::SetFrameRate, "SetFrameRate"},
{0x00210080, nullptr, "SetPhotoMode"},
{0x002200C0, &CAM_S::SetEffect, "SetEffect"},
{0x00230080, nullptr, "SetContrast"},
{0x00240080, nullptr, "SetLensCorrection"},
{0x002500C0, &CAM_S::SetOutputFormat, "SetOutputFormat"},
{0x00260140, nullptr, "SetAutoExposureWindow"},
{0x00270140, nullptr, "SetAutoWhiteBalanceWindow"},
{0x00280080, nullptr, "SetNoiseFilter"},
{0x00290080, &CAM_S::SynchronizeVsyncTiming, "SynchronizeVsyncTiming"},
{0x002A0080, &CAM_S::GetLatestVsyncTiming, "GetLatestVsyncTiming"},
{0x002B0000, &CAM_S::GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"},
{0x002C0400, nullptr, "SetStereoCameraCalibrationData"},
{0x002D00C0, nullptr, "WriteRegisterI2c"},
{0x002E00C0, nullptr, "WriteMcuVariableI2c"},
{0x002F0080, nullptr, "ReadRegisterI2cExclusive"},
{0x00300080, nullptr, "ReadMcuVariableI2cExclusive"},
{0x00310180, nullptr, "SetImageQualityCalibrationData"},
{0x00320000, nullptr, "GetImageQualityCalibrationData"},
{0x003302C0, &CAM_S::SetPackageParameterWithoutContext,
"SetPackageParameterWithoutContext"},
{0x00340140, &CAM_S::SetPackageParameterWithContext, "SetPackageParameterWithContext"},
{0x003501C0, &CAM_S::SetPackageParameterWithContextDetail,
"SetPackageParameterWithContextDetail"},
{0x00360000, &CAM_S::GetSuitableY2rStandardCoefficient,
"GetSuitableY2rStandardCoefficient"},
{0x00370202, nullptr, "PlayShutterSoundWithWave"},
{0x00380040, &CAM_S::PlayShutterSound, "PlayShutterSound"},
{0x00390000, &CAM_S::DriverInitialize, "DriverInitialize"},
{0x003A0000, &CAM_S::DriverFinalize, "DriverFinalize"},
{0x003B0000, nullptr, "GetActivatedCamera"},
{0x003C0000, nullptr, "GetSleepCamera"},
{0x003D0040, nullptr, "SetSleepCamera"},
{0x003E0040, nullptr, "SetBrightnessSynchronization"},
// clang-format off
{IPC::MakeHeader(0x0001, 1, 0), &CAM_S::StartCapture, "StartCapture"},
{IPC::MakeHeader(0x0002, 1, 0), &CAM_S::StopCapture, "StopCapture"},
{IPC::MakeHeader(0x0003, 1, 0), &CAM_S::IsBusy, "IsBusy"},
{IPC::MakeHeader(0x0004, 1, 0), &CAM_S::ClearBuffer, "ClearBuffer"},
{IPC::MakeHeader(0x0005, 1, 0), &CAM_S::GetVsyncInterruptEvent, "GetVsyncInterruptEvent"},
{IPC::MakeHeader(0x0006, 1, 0), &CAM_S::GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"},
{IPC::MakeHeader(0x0007, 4, 2), &CAM_S::SetReceiving, "SetReceiving"},
{IPC::MakeHeader(0x0008, 1, 0), &CAM_S::IsFinishedReceiving, "IsFinishedReceiving"},
{IPC::MakeHeader(0x0009, 4, 0), &CAM_S::SetTransferLines, "SetTransferLines"},
{IPC::MakeHeader(0x000A, 2, 0), &CAM_S::GetMaxLines, "GetMaxLines"},
{IPC::MakeHeader(0x000B, 4, 0), &CAM_S::SetTransferBytes, "SetTransferBytes"},
{IPC::MakeHeader(0x000C, 1, 0), &CAM_S::GetTransferBytes, "GetTransferBytes"},
{IPC::MakeHeader(0x000D, 2, 0), &CAM_S::GetMaxBytes, "GetMaxBytes"},
{IPC::MakeHeader(0x000E, 2, 0), &CAM_S::SetTrimming, "SetTrimming"},
{IPC::MakeHeader(0x000F, 1, 0), &CAM_S::IsTrimming, "IsTrimming"},
{IPC::MakeHeader(0x0010, 5, 0), &CAM_S::SetTrimmingParams, "SetTrimmingParams"},
{IPC::MakeHeader(0x0011, 1, 0), &CAM_S::GetTrimmingParams, "GetTrimmingParams"},
{IPC::MakeHeader(0x0012, 5, 0), &CAM_S::SetTrimmingParamsCenter, "SetTrimmingParamsCenter"},
{IPC::MakeHeader(0x0013, 1, 0), &CAM_S::Activate, "Activate"},
{IPC::MakeHeader(0x0014, 2, 0), &CAM_S::SwitchContext, "SwitchContext"},
{IPC::MakeHeader(0x0015, 2, 0), nullptr, "SetExposure"},
{IPC::MakeHeader(0x0016, 2, 0), nullptr, "SetWhiteBalance"},
{IPC::MakeHeader(0x0017, 2, 0), nullptr, "SetWhiteBalanceWithoutBaseUp"},
{IPC::MakeHeader(0x0018, 2, 0), nullptr, "SetSharpness"},
{IPC::MakeHeader(0x0019, 2, 0), nullptr, "SetAutoExposure"},
{IPC::MakeHeader(0x001A, 1, 0), nullptr, "IsAutoExposure"},
{IPC::MakeHeader(0x001B, 2, 0), nullptr, "SetAutoWhiteBalance"},
{IPC::MakeHeader(0x001C, 1, 0), nullptr, "IsAutoWhiteBalance"},
{IPC::MakeHeader(0x001D, 3, 0), &CAM_S::FlipImage, "FlipImage"},
{IPC::MakeHeader(0x001E, 8, 0), &CAM_S::SetDetailSize, "SetDetailSize"},
{IPC::MakeHeader(0x001F, 3, 0), &CAM_S::SetSize, "SetSize"},
{IPC::MakeHeader(0x0020, 2, 0), &CAM_S::SetFrameRate, "SetFrameRate"},
{IPC::MakeHeader(0x0021, 2, 0), nullptr, "SetPhotoMode"},
{IPC::MakeHeader(0x0022, 3, 0), &CAM_S::SetEffect, "SetEffect"},
{IPC::MakeHeader(0x0023, 2, 0), nullptr, "SetContrast"},
{IPC::MakeHeader(0x0024, 2, 0), nullptr, "SetLensCorrection"},
{IPC::MakeHeader(0x0025, 3, 0), &CAM_S::SetOutputFormat, "SetOutputFormat"},
{IPC::MakeHeader(0x0026, 5, 0), nullptr, "SetAutoExposureWindow"},
{IPC::MakeHeader(0x0027, 5, 0), nullptr, "SetAutoWhiteBalanceWindow"},
{IPC::MakeHeader(0x0028, 2, 0), nullptr, "SetNoiseFilter"},
{IPC::MakeHeader(0x0029, 2, 0), &CAM_S::SynchronizeVsyncTiming, "SynchronizeVsyncTiming"},
{IPC::MakeHeader(0x002A, 2, 0), &CAM_S::GetLatestVsyncTiming, "GetLatestVsyncTiming"},
{IPC::MakeHeader(0x002B, 0, 0), &CAM_S::GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"},
{IPC::MakeHeader(0x002C, 16, 0), nullptr, "SetStereoCameraCalibrationData"},
{IPC::MakeHeader(0x002D, 3, 0), nullptr, "WriteRegisterI2c"},
{IPC::MakeHeader(0x002E, 3, 0), nullptr, "WriteMcuVariableI2c"},
{IPC::MakeHeader(0x002F, 2, 0), nullptr, "ReadRegisterI2cExclusive"},
{IPC::MakeHeader(0x0030, 2, 0), nullptr, "ReadMcuVariableI2cExclusive"},
{IPC::MakeHeader(0x0031, 6, 0), nullptr, "SetImageQualityCalibrationData"},
{IPC::MakeHeader(0x0032, 0, 0), nullptr, "GetImageQualityCalibrationData"},
{IPC::MakeHeader(0x0033, 11, 0), &CAM_S::SetPackageParameterWithoutContext, "SetPackageParameterWithoutContext"},
{IPC::MakeHeader(0x0034, 5, 0), &CAM_S::SetPackageParameterWithContext, "SetPackageParameterWithContext"},
{IPC::MakeHeader(0x0035, 7, 0), &CAM_S::SetPackageParameterWithContextDetail, "SetPackageParameterWithContextDetail"},
{IPC::MakeHeader(0x0036, 0, 0), &CAM_S::GetSuitableY2rStandardCoefficient, "GetSuitableY2rStandardCoefficient"},
{IPC::MakeHeader(0x0037, 8, 2), nullptr, "PlayShutterSoundWithWave"},
{IPC::MakeHeader(0x0038, 1, 0), &CAM_S::PlayShutterSound, "PlayShutterSound"},
{IPC::MakeHeader(0x0039, 0, 0), &CAM_S::DriverInitialize, "DriverInitialize"},
{IPC::MakeHeader(0x003A, 0, 0), &CAM_S::DriverFinalize, "DriverFinalize"},
{IPC::MakeHeader(0x003B, 0, 0), nullptr, "GetActivatedCamera"},
{IPC::MakeHeader(0x003C, 0, 0), nullptr, "GetSleepCamera"},
{IPC::MakeHeader(0x003D, 1, 0), nullptr, "SetSleepCamera"},
{IPC::MakeHeader(0x003E, 1, 0), nullptr, "SetBrightnessSynchronization"},
// clang-format on
};
RegisterHandlers(functions);
}

View file

@ -10,71 +10,70 @@ namespace Service::CAM {
CAM_U::CAM_U(std::shared_ptr<Module> cam) : Module::Interface(std::move(cam), "cam:u", 1) {
static const FunctionInfo functions[] = {
{0x00010040, &CAM_U::StartCapture, "StartCapture"},
{0x00020040, &CAM_U::StopCapture, "StopCapture"},
{0x00030040, &CAM_U::IsBusy, "IsBusy"},
{0x00040040, &CAM_U::ClearBuffer, "ClearBuffer"},
{0x00050040, &CAM_U::GetVsyncInterruptEvent, "GetVsyncInterruptEvent"},
{0x00060040, &CAM_U::GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"},
{0x00070102, &CAM_U::SetReceiving, "SetReceiving"},
{0x00080040, &CAM_U::IsFinishedReceiving, "IsFinishedReceiving"},
{0x00090100, &CAM_U::SetTransferLines, "SetTransferLines"},
{0x000A0080, &CAM_U::GetMaxLines, "GetMaxLines"},
{0x000B0100, &CAM_U::SetTransferBytes, "SetTransferBytes"},
{0x000C0040, &CAM_U::GetTransferBytes, "GetTransferBytes"},
{0x000D0080, &CAM_U::GetMaxBytes, "GetMaxBytes"},
{0x000E0080, &CAM_U::SetTrimming, "SetTrimming"},
{0x000F0040, &CAM_U::IsTrimming, "IsTrimming"},
{0x00100140, &CAM_U::SetTrimmingParams, "SetTrimmingParams"},
{0x00110040, &CAM_U::GetTrimmingParams, "GetTrimmingParams"},
{0x00120140, &CAM_U::SetTrimmingParamsCenter, "SetTrimmingParamsCenter"},
{0x00130040, &CAM_U::Activate, "Activate"},
{0x00140080, &CAM_U::SwitchContext, "SwitchContext"},
{0x00150080, nullptr, "SetExposure"},
{0x00160080, nullptr, "SetWhiteBalance"},
{0x00170080, nullptr, "SetWhiteBalanceWithoutBaseUp"},
{0x00180080, nullptr, "SetSharpness"},
{0x00190080, nullptr, "SetAutoExposure"},
{0x001A0040, nullptr, "IsAutoExposure"},
{0x001B0080, nullptr, "SetAutoWhiteBalance"},
{0x001C0040, nullptr, "IsAutoWhiteBalance"},
{0x001D00C0, &CAM_U::FlipImage, "FlipImage"},
{0x001E0200, &CAM_U::SetDetailSize, "SetDetailSize"},
{0x001F00C0, &CAM_U::SetSize, "SetSize"},
{0x00200080, &CAM_U::SetFrameRate, "SetFrameRate"},
{0x00210080, nullptr, "SetPhotoMode"},
{0x002200C0, &CAM_U::SetEffect, "SetEffect"},
{0x00230080, nullptr, "SetContrast"},
{0x00240080, nullptr, "SetLensCorrection"},
{0x002500C0, &CAM_U::SetOutputFormat, "SetOutputFormat"},
{0x00260140, nullptr, "SetAutoExposureWindow"},
{0x00270140, nullptr, "SetAutoWhiteBalanceWindow"},
{0x00280080, nullptr, "SetNoiseFilter"},
{0x00290080, &CAM_U::SynchronizeVsyncTiming, "SynchronizeVsyncTiming"},
{0x002A0080, &CAM_U::GetLatestVsyncTiming, "GetLatestVsyncTiming"},
{0x002B0000, &CAM_U::GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"},
{0x002C0400, nullptr, "SetStereoCameraCalibrationData"},
{0x002D00C0, nullptr, "WriteRegisterI2c"},
{0x002E00C0, nullptr, "WriteMcuVariableI2c"},
{0x002F0080, nullptr, "ReadRegisterI2cExclusive"},
{0x00300080, nullptr, "ReadMcuVariableI2cExclusive"},
{0x00310180, nullptr, "SetImageQualityCalibrationData"},
{0x00320000, nullptr, "GetImageQualityCalibrationData"},
{0x003302C0, &CAM_U::SetPackageParameterWithoutContext,
"SetPackageParameterWithoutContext"},
{0x00340140, &CAM_U::SetPackageParameterWithContext, "SetPackageParameterWithContext"},
{0x003501C0, &CAM_U::SetPackageParameterWithContextDetail,
"SetPackageParameterWithContextDetail"},
{0x00360000, &CAM_U::GetSuitableY2rStandardCoefficient,
"GetSuitableY2rStandardCoefficient"},
{0x00370202, nullptr, "PlayShutterSoundWithWave"},
{0x00380040, &CAM_U::PlayShutterSound, "PlayShutterSound"},
{0x00390000, &CAM_U::DriverInitialize, "DriverInitialize"},
{0x003A0000, &CAM_U::DriverFinalize, "DriverFinalize"},
{0x003B0000, nullptr, "GetActivatedCamera"},
{0x003C0000, nullptr, "GetSleepCamera"},
{0x003D0040, nullptr, "SetSleepCamera"},
{0x003E0040, nullptr, "SetBrightnessSynchronization"},
// clang-format off
{IPC::MakeHeader(0x0001, 1, 0), &CAM_U::StartCapture, "StartCapture"},
{IPC::MakeHeader(0x0002, 1, 0), &CAM_U::StopCapture, "StopCapture"},
{IPC::MakeHeader(0x0003, 1, 0), &CAM_U::IsBusy, "IsBusy"},
{IPC::MakeHeader(0x0004, 1, 0), &CAM_U::ClearBuffer, "ClearBuffer"},
{IPC::MakeHeader(0x0005, 1, 0), &CAM_U::GetVsyncInterruptEvent, "GetVsyncInterruptEvent"},
{IPC::MakeHeader(0x0006, 1, 0), &CAM_U::GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"},
{IPC::MakeHeader(0x0007, 4, 2), &CAM_U::SetReceiving, "SetReceiving"},
{IPC::MakeHeader(0x0008, 1, 0), &CAM_U::IsFinishedReceiving, "IsFinishedReceiving"},
{IPC::MakeHeader(0x0009, 4, 0), &CAM_U::SetTransferLines, "SetTransferLines"},
{IPC::MakeHeader(0x000A, 2, 0), &CAM_U::GetMaxLines, "GetMaxLines"},
{IPC::MakeHeader(0x000B, 4, 0), &CAM_U::SetTransferBytes, "SetTransferBytes"},
{IPC::MakeHeader(0x000C, 1, 0), &CAM_U::GetTransferBytes, "GetTransferBytes"},
{IPC::MakeHeader(0x000D, 2, 0), &CAM_U::GetMaxBytes, "GetMaxBytes"},
{IPC::MakeHeader(0x000E, 2, 0), &CAM_U::SetTrimming, "SetTrimming"},
{IPC::MakeHeader(0x000F, 1, 0), &CAM_U::IsTrimming, "IsTrimming"},
{IPC::MakeHeader(0x0010, 5, 0), &CAM_U::SetTrimmingParams, "SetTrimmingParams"},
{IPC::MakeHeader(0x0011, 1, 0), &CAM_U::GetTrimmingParams, "GetTrimmingParams"},
{IPC::MakeHeader(0x0012, 5, 0), &CAM_U::SetTrimmingParamsCenter, "SetTrimmingParamsCenter"},
{IPC::MakeHeader(0x0013, 1, 0), &CAM_U::Activate, "Activate"},
{IPC::MakeHeader(0x0014, 2, 0), &CAM_U::SwitchContext, "SwitchContext"},
{IPC::MakeHeader(0x0015, 2, 0), nullptr, "SetExposure"},
{IPC::MakeHeader(0x0016, 2, 0), nullptr, "SetWhiteBalance"},
{IPC::MakeHeader(0x0017, 2, 0), nullptr, "SetWhiteBalanceWithoutBaseUp"},
{IPC::MakeHeader(0x0018, 2, 0), nullptr, "SetSharpness"},
{IPC::MakeHeader(0x0019, 2, 0), nullptr, "SetAutoExposure"},
{IPC::MakeHeader(0x001A, 1, 0), nullptr, "IsAutoExposure"},
{IPC::MakeHeader(0x001B, 2, 0), nullptr, "SetAutoWhiteBalance"},
{IPC::MakeHeader(0x001C, 1, 0), nullptr, "IsAutoWhiteBalance"},
{IPC::MakeHeader(0x001D, 3, 0), &CAM_U::FlipImage, "FlipImage"},
{IPC::MakeHeader(0x001E, 8, 0), &CAM_U::SetDetailSize, "SetDetailSize"},
{IPC::MakeHeader(0x001F, 3, 0), &CAM_U::SetSize, "SetSize"},
{IPC::MakeHeader(0x0020, 2, 0), &CAM_U::SetFrameRate, "SetFrameRate"},
{IPC::MakeHeader(0x0021, 2, 0), nullptr, "SetPhotoMode"},
{IPC::MakeHeader(0x0022, 3, 0), &CAM_U::SetEffect, "SetEffect"},
{IPC::MakeHeader(0x0023, 2, 0), nullptr, "SetContrast"},
{IPC::MakeHeader(0x0024, 2, 0), nullptr, "SetLensCorrection"},
{IPC::MakeHeader(0x0025, 3, 0), &CAM_U::SetOutputFormat, "SetOutputFormat"},
{IPC::MakeHeader(0x0026, 5, 0), nullptr, "SetAutoExposureWindow"},
{IPC::MakeHeader(0x0027, 5, 0), nullptr, "SetAutoWhiteBalanceWindow"},
{IPC::MakeHeader(0x0028, 2, 0), nullptr, "SetNoiseFilter"},
{IPC::MakeHeader(0x0029, 2, 0), &CAM_U::SynchronizeVsyncTiming, "SynchronizeVsyncTiming"},
{IPC::MakeHeader(0x002A, 2, 0), &CAM_U::GetLatestVsyncTiming, "GetLatestVsyncTiming"},
{IPC::MakeHeader(0x002B, 0, 0), &CAM_U::GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"},
{IPC::MakeHeader(0x002C, 16, 0), nullptr, "SetStereoCameraCalibrationData"},
{IPC::MakeHeader(0x002D, 3, 0), nullptr, "WriteRegisterI2c"},
{IPC::MakeHeader(0x002E, 3, 0), nullptr, "WriteMcuVariableI2c"},
{IPC::MakeHeader(0x002F, 2, 0), nullptr, "ReadRegisterI2cExclusive"},
{IPC::MakeHeader(0x0030, 2, 0), nullptr, "ReadMcuVariableI2cExclusive"},
{IPC::MakeHeader(0x0031, 6, 0), nullptr, "SetImageQualityCalibrationData"},
{IPC::MakeHeader(0x0032, 0, 0), nullptr, "GetImageQualityCalibrationData"},
{IPC::MakeHeader(0x0033, 11, 0), &CAM_U::SetPackageParameterWithoutContext, "SetPackageParameterWithoutContext"},
{IPC::MakeHeader(0x0034, 5, 0), &CAM_U::SetPackageParameterWithContext, "SetPackageParameterWithContext"},
{IPC::MakeHeader(0x0035, 7, 0), &CAM_U::SetPackageParameterWithContextDetail, "SetPackageParameterWithContextDetail"},
{IPC::MakeHeader(0x0036, 0, 0), &CAM_U::GetSuitableY2rStandardCoefficient, "GetSuitableY2rStandardCoefficient"},
{IPC::MakeHeader(0x0037, 8, 2), nullptr, "PlayShutterSoundWithWave"},
{IPC::MakeHeader(0x0038, 1, 0), &CAM_U::PlayShutterSound, "PlayShutterSound"},
{IPC::MakeHeader(0x0039, 0, 0), &CAM_U::DriverInitialize, "DriverInitialize"},
{IPC::MakeHeader(0x003A, 0, 0), &CAM_U::DriverFinalize, "DriverFinalize"},
{IPC::MakeHeader(0x003B, 0, 0), nullptr, "GetActivatedCamera"},
{IPC::MakeHeader(0x003C, 0, 0), nullptr, "GetSleepCamera"},
{IPC::MakeHeader(0x003D, 1, 0), nullptr, "SetSleepCamera"},
{IPC::MakeHeader(0x003E, 1, 0), nullptr, "SetBrightnessSynchronization"},
// clang-format on
};
RegisterHandlers(functions);
}