From da49e0a7071c4a216f7952545a0fca01544faba3 Mon Sep 17 00:00:00 2001 From: harjeb Date: Mon, 1 Apr 2019 18:55:23 +0800 Subject: [PATCH] docs(*): update iic --- docs/src/control/contents.rst | 3 +- docs/src/control/iic_address.rst | 58 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 docs/src/control/iic_address.rst diff --git a/docs/src/control/contents.rst b/docs/src/control/contents.rst index 7f07276..573ca06 100644 --- a/docs/src/control/contents.rst +++ b/docs/src/control/contents.rst @@ -10,4 +10,5 @@ MYNT® EYE Control auto_exposure manual_exposure infrared - imu_low_pass_filter \ No newline at end of file + imu_low_pass_filter + iic_address \ No newline at end of file diff --git a/docs/src/control/iic_address.rst b/docs/src/control/iic_address.rst new file mode 100644 index 0000000..d9c7c8d --- /dev/null +++ b/docs/src/control/iic_address.rst @@ -0,0 +1,58 @@ +.. _iic_address: + +Set IIC Address +================ + +Using the ``SetOptionValue()`` function in the API, you can set various control values for the current device. + +To set the IIC address, set ``Option::IIC_ADDRESS_SETTING``. + + +.. Attention:: + Only support S210A + +Reference Code: + +s210a: + +.. code-block:: c++ + + auto &&api = API::Create(argc, argv); + if (!api) return 1; + bool ok; + auto &&request = api->SelectStreamRequest(&ok); + if (!ok) return 1; + api->ConfigStreamRequest(request); + Model model = api->GetModel(); + if (model == Model::STANDARD210A) { + api->SetOptionValue(Option::IIC_ADDRESS_SETTING, 0x31); + LOG(INFO) << "Set iic address to " << std::hex << "0x" + << api->GetOptionValue(Option::IIC_ADDRESS_SETTING); + } + + +Reference running results on Linux: + +s210a: + +.. code-block:: bash + + $ ./samples/_output/bin/tutorials/ctrl_iic_adress + I/utils.cc:30 Detecting MYNT EYE devices + I/utils.cc:40 MYNT EYE devices: + I/utils.cc:43 index: 0, name: MYNT-EYE-S210A, sn: 07C41A190009071F + I/utils.cc:51 Only one MYNT EYE device, select index: 0 + I/utils.cc:79 MYNT EYE devices: + I/utils.cc:82 index: 0, request: width: 1280, height: 400, format: Format::BGR888, fps: 10 + I/utils.cc:82 index: 1, request: width: 1280, height: 400, format: Format::BGR888, fps: 20 + I/utils.cc:82 index: 2, request: width: 1280, height: 400, format: Format::BGR888, fps: 30 + I/utils.cc:82 index: 3, request: width: 1280, height: 400, format: Format::BGR888, fps: 60 + I/utils.cc:82 index: 4, request: width: 2560, height: 800, format: Format::BGR888, fps: 10 + I/utils.cc:82 index: 5, request: width: 2560, height: 800, format: Format::BGR888, fps: 20 + I/utils.cc:82 index: 6, request: width: 2560, height: 800, format: Format::BGR888, fps: 30 + I/utils.cc:93 There are 7 stream requests, select index: + 3 + I/imu_range.cc:51 Set iic address to 0x31 + +After the sample program finishes running with ``ESC/Q``. +Complete code samples,please see `iic_address.cc `_.