Win32 API 日本語リファレンス
ホームDevices.Display › MIPI_DSI_CAPS

MIPI_DSI_CAPS

構造体
サイズx64: 20 バイト / x86: 20 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
DSITypeMajorBYTE1+0+0MIPI DSIタイプのメジャー番号を示す1バイト値。
DSITypeMinorBYTE1+1+1MIPI DSIタイプのマイナー番号を示す1バイト値。
SpecVersionMajorBYTE1+2+2DSI仕様バージョンのメジャー番号を示す1バイト値。
SpecVersionMinorBYTE1+3+3DSI仕様バージョンのマイナー番号を示す1バイト値。
SpecVersionPatchBYTE1+4+4DSI仕様バージョンのパッチ番号を示す1バイト値。
TargetMaximumReturnPacketSizeWORD2+6+6対象が返せる最大リターンパケットサイズをバイト単位で示すWORD。
ResultCodeFlagsBYTE1+8+8コマンド結果のフラグを示す1バイト値。
ResultCodeStatusBYTE1+9+9コマンド結果のステータスを示す1バイト値。
RevisionBYTE1+10+10デバイスのリビジョンを示す1バイト値。
LevelBYTE1+11+11デバイスのレベルを示す1バイト値。
DeviceClassHiBYTE1+12+12デバイスクラスの上位バイトを示す。
DeviceClassLoBYTE1+13+13デバイスクラスの下位バイトを示す。
ManufacturerHiBYTE1+14+14製造者IDの上位バイトを示す。
ManufacturerLoBYTE1+15+15製造者IDの下位バイトを示す。
ProductHiBYTE1+16+16製品IDの上位バイトを示す。
ProductLoBYTE1+17+17製品IDの下位バイトを示す。
LengthHiBYTE1+18+18長さフィールドの上位バイトを示す。
LengthLoBYTE1+19+19長さフィールドの下位バイトを示す。

各言語での定義

#include <windows.h>

// MIPI_DSI_CAPS  (x64 20 / x86 20 バイト)
typedef struct MIPI_DSI_CAPS {
    BYTE DSITypeMajor;
    BYTE DSITypeMinor;
    BYTE SpecVersionMajor;
    BYTE SpecVersionMinor;
    BYTE SpecVersionPatch;
    WORD TargetMaximumReturnPacketSize;
    BYTE ResultCodeFlags;
    BYTE ResultCodeStatus;
    BYTE Revision;
    BYTE Level;
    BYTE DeviceClassHi;
    BYTE DeviceClassLo;
    BYTE ManufacturerHi;
    BYTE ManufacturerLo;
    BYTE ProductHi;
    BYTE ProductLo;
    BYTE LengthHi;
    BYTE LengthLo;
} MIPI_DSI_CAPS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIPI_DSI_CAPS
{
    public byte DSITypeMajor;
    public byte DSITypeMinor;
    public byte SpecVersionMajor;
    public byte SpecVersionMinor;
    public byte SpecVersionPatch;
    public ushort TargetMaximumReturnPacketSize;
    public byte ResultCodeFlags;
    public byte ResultCodeStatus;
    public byte Revision;
    public byte Level;
    public byte DeviceClassHi;
    public byte DeviceClassLo;
    public byte ManufacturerHi;
    public byte ManufacturerLo;
    public byte ProductHi;
    public byte ProductLo;
    public byte LengthHi;
    public byte LengthLo;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIPI_DSI_CAPS
    Public DSITypeMajor As Byte
    Public DSITypeMinor As Byte
    Public SpecVersionMajor As Byte
    Public SpecVersionMinor As Byte
    Public SpecVersionPatch As Byte
    Public TargetMaximumReturnPacketSize As UShort
    Public ResultCodeFlags As Byte
    Public ResultCodeStatus As Byte
    Public Revision As Byte
    Public Level As Byte
    Public DeviceClassHi As Byte
    Public DeviceClassLo As Byte
    Public ManufacturerHi As Byte
    Public ManufacturerLo As Byte
    Public ProductHi As Byte
    Public ProductLo As Byte
    Public LengthHi As Byte
    Public LengthLo As Byte
End Structure
import ctypes
from ctypes import wintypes

class MIPI_DSI_CAPS(ctypes.Structure):
    _fields_ = [
        ("DSITypeMajor", ctypes.c_ubyte),
        ("DSITypeMinor", ctypes.c_ubyte),
        ("SpecVersionMajor", ctypes.c_ubyte),
        ("SpecVersionMinor", ctypes.c_ubyte),
        ("SpecVersionPatch", ctypes.c_ubyte),
        ("TargetMaximumReturnPacketSize", ctypes.c_ushort),
        ("ResultCodeFlags", ctypes.c_ubyte),
        ("ResultCodeStatus", ctypes.c_ubyte),
        ("Revision", ctypes.c_ubyte),
        ("Level", ctypes.c_ubyte),
        ("DeviceClassHi", ctypes.c_ubyte),
        ("DeviceClassLo", ctypes.c_ubyte),
        ("ManufacturerHi", ctypes.c_ubyte),
        ("ManufacturerLo", ctypes.c_ubyte),
        ("ProductHi", ctypes.c_ubyte),
        ("ProductLo", ctypes.c_ubyte),
        ("LengthHi", ctypes.c_ubyte),
        ("LengthLo", ctypes.c_ubyte),
    ]
#[repr(C)]
pub struct MIPI_DSI_CAPS {
    pub DSITypeMajor: u8,
    pub DSITypeMinor: u8,
    pub SpecVersionMajor: u8,
    pub SpecVersionMinor: u8,
    pub SpecVersionPatch: u8,
    pub TargetMaximumReturnPacketSize: u16,
    pub ResultCodeFlags: u8,
    pub ResultCodeStatus: u8,
    pub Revision: u8,
    pub Level: u8,
    pub DeviceClassHi: u8,
    pub DeviceClassLo: u8,
    pub ManufacturerHi: u8,
    pub ManufacturerLo: u8,
    pub ProductHi: u8,
    pub ProductLo: u8,
    pub LengthHi: u8,
    pub LengthLo: u8,
}
import "golang.org/x/sys/windows"

type MIPI_DSI_CAPS struct {
	DSITypeMajor byte
	DSITypeMinor byte
	SpecVersionMajor byte
	SpecVersionMinor byte
	SpecVersionPatch byte
	TargetMaximumReturnPacketSize uint16
	ResultCodeFlags byte
	ResultCodeStatus byte
	Revision byte
	Level byte
	DeviceClassHi byte
	DeviceClassLo byte
	ManufacturerHi byte
	ManufacturerLo byte
	ProductHi byte
	ProductLo byte
	LengthHi byte
	LengthLo byte
}
type
  MIPI_DSI_CAPS = record
    DSITypeMajor: Byte;
    DSITypeMinor: Byte;
    SpecVersionMajor: Byte;
    SpecVersionMinor: Byte;
    SpecVersionPatch: Byte;
    TargetMaximumReturnPacketSize: Word;
    ResultCodeFlags: Byte;
    ResultCodeStatus: Byte;
    Revision: Byte;
    Level: Byte;
    DeviceClassHi: Byte;
    DeviceClassLo: Byte;
    ManufacturerHi: Byte;
    ManufacturerLo: Byte;
    ProductHi: Byte;
    ProductLo: Byte;
    LengthHi: Byte;
    LengthLo: Byte;
  end;
const MIPI_DSI_CAPS = extern struct {
    DSITypeMajor: u8,
    DSITypeMinor: u8,
    SpecVersionMajor: u8,
    SpecVersionMinor: u8,
    SpecVersionPatch: u8,
    TargetMaximumReturnPacketSize: u16,
    ResultCodeFlags: u8,
    ResultCodeStatus: u8,
    Revision: u8,
    Level: u8,
    DeviceClassHi: u8,
    DeviceClassLo: u8,
    ManufacturerHi: u8,
    ManufacturerLo: u8,
    ProductHi: u8,
    ProductLo: u8,
    LengthHi: u8,
    LengthLo: u8,
};
type
  MIPI_DSI_CAPS {.bycopy.} = object
    DSITypeMajor: uint8
    DSITypeMinor: uint8
    SpecVersionMajor: uint8
    SpecVersionMinor: uint8
    SpecVersionPatch: uint8
    TargetMaximumReturnPacketSize: uint16
    ResultCodeFlags: uint8
    ResultCodeStatus: uint8
    Revision: uint8
    Level: uint8
    DeviceClassHi: uint8
    DeviceClassLo: uint8
    ManufacturerHi: uint8
    ManufacturerLo: uint8
    ProductHi: uint8
    ProductLo: uint8
    LengthHi: uint8
    LengthLo: uint8
struct MIPI_DSI_CAPS
{
    ubyte DSITypeMajor;
    ubyte DSITypeMinor;
    ubyte SpecVersionMajor;
    ubyte SpecVersionMinor;
    ubyte SpecVersionPatch;
    ushort TargetMaximumReturnPacketSize;
    ubyte ResultCodeFlags;
    ubyte ResultCodeStatus;
    ubyte Revision;
    ubyte Level;
    ubyte DeviceClassHi;
    ubyte DeviceClassLo;
    ubyte ManufacturerHi;
    ubyte ManufacturerLo;
    ubyte ProductHi;
    ubyte ProductLo;
    ubyte LengthHi;
    ubyte LengthLo;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIPI_DSI_CAPS サイズ: 20 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; DSITypeMajor : BYTE (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; DSITypeMinor : BYTE (+1, 1byte)  poke st,1,値  /  値 = peek(st,1)
; SpecVersionMajor : BYTE (+2, 1byte)  poke st,2,値  /  値 = peek(st,2)
; SpecVersionMinor : BYTE (+3, 1byte)  poke st,3,値  /  値 = peek(st,3)
; SpecVersionPatch : BYTE (+4, 1byte)  poke st,4,値  /  値 = peek(st,4)
; TargetMaximumReturnPacketSize : WORD (+6, 2byte)  wpoke st,6,値  /  値 = wpeek(st,6)
; ResultCodeFlags : BYTE (+8, 1byte)  poke st,8,値  /  値 = peek(st,8)
; ResultCodeStatus : BYTE (+9, 1byte)  poke st,9,値  /  値 = peek(st,9)
; Revision : BYTE (+10, 1byte)  poke st,10,値  /  値 = peek(st,10)
; Level : BYTE (+11, 1byte)  poke st,11,値  /  値 = peek(st,11)
; DeviceClassHi : BYTE (+12, 1byte)  poke st,12,値  /  値 = peek(st,12)
; DeviceClassLo : BYTE (+13, 1byte)  poke st,13,値  /  値 = peek(st,13)
; ManufacturerHi : BYTE (+14, 1byte)  poke st,14,値  /  値 = peek(st,14)
; ManufacturerLo : BYTE (+15, 1byte)  poke st,15,値  /  値 = peek(st,15)
; ProductHi : BYTE (+16, 1byte)  poke st,16,値  /  値 = peek(st,16)
; ProductLo : BYTE (+17, 1byte)  poke st,17,値  /  値 = peek(st,17)
; LengthHi : BYTE (+18, 1byte)  poke st,18,値  /  値 = peek(st,18)
; LengthLo : BYTE (+19, 1byte)  poke st,19,値  /  値 = peek(st,19)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MIPI_DSI_CAPS
    #field byte DSITypeMajor
    #field byte DSITypeMinor
    #field byte SpecVersionMajor
    #field byte SpecVersionMinor
    #field byte SpecVersionPatch
    #field short TargetMaximumReturnPacketSize
    #field byte ResultCodeFlags
    #field byte ResultCodeStatus
    #field byte Revision
    #field byte Level
    #field byte DeviceClassHi
    #field byte DeviceClassLo
    #field byte ManufacturerHi
    #field byte ManufacturerLo
    #field byte ProductHi
    #field byte ProductLo
    #field byte LengthHi
    #field byte LengthLo
#endstruct

stdim st, MIPI_DSI_CAPS        ; NSTRUCT 変数を確保
st->DSITypeMajor = 100
mes "DSITypeMajor=" + st->DSITypeMajor