| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.hardware.mipicsi; |
| using fuchsia.hardware.camera; |
| using zx; |
| |
| type MipiInfo = struct { |
| // Number of channels used. |
| channel uint32; |
| // Number of lanes used. |
| lanes uint32; |
| // Used to program MIPI_PHY_THS_SETTLE. No documentation. |
| ui_value uint32; |
| // MIPI CSI Version. |
| csi_version uint32; |
| }; |
| |
| /// Values for Image Formats. |
| type MipiImageFormat = strict enum : uint32 { |
| AM_RAW6 = 0x1; |
| AM_RAW7 = 0x2; |
| AM_RAW8 = 0x3; |
| AM_RAW10 = 0x4; |
| AM_RAW12 = 0x5; |
| AM_RAW14 = 0x6; |
| }; |
| |
| /// Values for different MIPI modes. |
| type MipiModes = strict enum : uint32 { |
| DDR_MODE = 0x0; |
| // Direct mode. |
| DIR_MODE = 0x1; |
| // Dual Overlay mode. |
| DOL_MODE = 0x2; |
| }; |
| |
| /// Values for virtual channel. |
| type MipiPath = strict enum : uint32 { |
| PATH0 = 0x0; |
| PATH1 = 0x1; |
| }; |
| |
| type MipiAdapInfo = struct { |
| resolution fuchsia.hardware.camera.Dimensions; |
| format MipiImageFormat; |
| mode MipiModes; |
| path MipiPath; |
| }; |
| |
| @transport("Banjo") |
| @banjo_layout("ddk-protocol") |
| protocol MipiCsi { |
| Init(struct { |
| mipi_info MipiInfo; |
| adap_info MipiAdapInfo; |
| }) -> (struct { |
| s zx.status; |
| }); |
| DeInit() -> (struct { |
| s zx.status; |
| }); |
| }; |