diff --git a/en/device-dev/driver/driver-platform-mipicsi-develop.md b/en/device-dev/driver/driver-platform-mipicsi-develop.md new file mode 100644 index 0000000000000000000000000000000000000000..f5691e402b30a14bf5316490a5fa83a504f2d0e9 --- /dev/null +++ b/en/device-dev/driver/driver-platform-mipicsi-develop.md @@ -0,0 +1,503 @@ +# MIPI CSI + +- [Overview](#section72226945170128) +- [Available APIs](#section735525713405) +- [How to Develop](#section378858277170128) +- [Development Example](#section2049027816170128) + +## Overview + +Defined by the Mobile Industry Processor Interface \(MIPI\) Alliance, the Camera Serial Interface \(CSI\) is a specification that allows data to be transmitted from the camera to the host processor on mobile platforms. In the Hardware Driver Foundation \(HDF\), the MIPI CSI module uses the service-free mode for API adaptation. The service-free mode applies to the devices that do not provide user-mode APIs or the OS that does not distinguish the user mode and the kernel mode. In the service-free mode, DevHandle \(a void pointer\) directly points to the kernel-mode address of the device object. + +**Figure 1** Service-free mode + +![](figures/service-free-mode.png "Service-free mode") + +## Available APIs + +MipiCsiCntlrMethod: + +``` +struct MipiCsiCntlrMethod { + int32_t (*setComboDevAttr)(struct MipiCsiCntlr *cntlr, ComboDevAttr *pAttr); + int32_t (*setPhyCmvmode)(struct MipiCsiCntlr *cntlr, uint8_t devno, PhyCmvMode cmvMode); + int32_t (*setExtDataType)(struct MipiCsiCntlr *cntlr, ExtDataType* dataType); + int32_t (*setHsMode)(struct MipiCsiCntlr *cntlr, LaneDivideMode laneDivideMode); + int32_t (*enableClock)(struct MipiCsiCntlr *cntlr, uint8_t comboDev); + int32_t (*disableClock)(struct MipiCsiCntlr *cntlr, uint8_t comboDev); + int32_t (*resetRx)(struct MipiCsiCntlr *cntlr, uint8_t comboDev); + int32_t (*unresetRx)(struct MipiCsiCntlr *cntlr, uint8_t comboDev); + int32_t (*enableSensorClock)(struct MipiCsiCntlr *cntlr, uint8_t snsClkSource); + int32_t (*disableSensorClock)(struct MipiCsiCntlr *cntlr, uint8_t snsClkSource); + int32_t (*resetSensor)(struct MipiCsiCntlr *cntlr, uint8_t snsResetSource); + int32_t (*unresetSensor)(struct MipiCsiCntlr *cntlr, uint8_t snsResetSource); +}; +``` + +**Table 1** Callbacks for the members in the MipiCsiCntlrMethod structure + + +
+ | ++ | +
---|---|
+ | ++ | +
+ | ++ | +
+ | ++ | +
+ | ++ | +
+ | ++ | +
+ | ++ | +
+ | ++ | +
---|---|
+ | +Lists the hardware events supported by the performance monitoring unit (PMU). + |
+
+ | ++ | +
+ | ++ | +
+ | ++ | +
+ | ++ | +
- | -- | -
---|---|
- | -这个宏决定系统是使用内核的内部堆内存还是用户的堆内存,默认为0(即使用内部的堆内存),大小为0x10000;如果用户需要基于外部的堆内存,那么可以将该宏设置为1。 - |
-
- | -- | -
- | -- | -