mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-05 08:20:24 +08:00
206 lines
8.9 KiB
Go
206 lines
8.9 KiB
Go
// Code generated by cmd/gen. DO NOT EDIT.
|
|
|
|
/*
|
|
*
|
|
* Copyright (C) 2019-2025 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* @file zes_api.h
|
|
* @version v1.15-r1.15.31
|
|
*
|
|
*/
|
|
|
|
package gozel
|
|
|
|
import (
|
|
"unsafe"
|
|
|
|
"github.com/fumiama/gozel/internal/zecall"
|
|
)
|
|
|
|
// ZesLedProperties (zes_led_properties_t) LED properties
|
|
type ZesLedProperties struct {
|
|
Stype ZesStructureType // Stype [in] type of this structure
|
|
Pnext unsafe.Pointer // Pnext [in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
|
|
Onsubdevice ZeBool // Onsubdevice [out] True if the resource is located on a sub-device; false means that the resource is on the device of the calling Sysman handle
|
|
Subdeviceid uint32 // Subdeviceid [out] If onSubdevice is true, this gives the ID of the sub-device
|
|
Cancontrol ZeBool // Cancontrol [out] Indicates if software can control the LED assuming the user has permissions
|
|
Havergb ZeBool // Havergb [out] Indicates if the LED is RGB capable
|
|
|
|
}
|
|
|
|
// ZesLedColor (zes_led_color_t) LED color
|
|
type ZesLedColor struct {
|
|
Red float64 // Red [in,out][range(0.0, 1.0)] The LED red value. On output, a value less than 0.0 indicates that the color is not known.
|
|
Green float64 // Green [in,out][range(0.0, 1.0)] The LED green value. On output, a value less than 0.0 indicates that the color is not known.
|
|
Blue float64 // Blue [in,out][range(0.0, 1.0)] The LED blue value. On output, a value less than 0.0 indicates that the color is not known.
|
|
|
|
}
|
|
|
|
// ZesLedState (zes_led_state_t) LED state
|
|
type ZesLedState struct {
|
|
Stype ZesStructureType // Stype [in] type of this structure
|
|
Pnext unsafe.Pointer // Pnext [in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
|
|
Ison ZeBool // Ison [out] Indicates if the LED is on or off
|
|
Color ZesLedColor // Color [out] Color of the LED
|
|
|
|
}
|
|
|
|
// ZesDeviceEnumLeds Get handle of LEDs
|
|
// /
|
|
// / @details
|
|
// / - The application may call this function from simultaneous threads.
|
|
// / - The implementation of this function should be lock-free.
|
|
// /
|
|
// / @returns
|
|
// / - ::ZE_RESULT_SUCCESS
|
|
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
|
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
|
|
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hDevice`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == pCount`
|
|
func ZesDeviceEnumLeds(
|
|
hDevice ZesDeviceHandle, // hDevice [in] Sysman handle of the device.
|
|
pCount *uint32, // pCount [in,out] pointer to the number of components of this type. if count is zero, then the driver shall update the value with the total number of components of this type that are available. if count is greater than the number of components of this type that are available, then the driver shall update the value with the correct number of components.
|
|
phLed *ZesLedHandle, // phLed [in,out][optional][range(0, *pCount)] array of handle of components of this type. if count is less than the number of components of this type that are available, then the driver shall only retrieve that number of component handles.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zesDeviceEnumLeds", uintptr(hDevice), uintptr(unsafe.Pointer(pCount)), uintptr(unsafe.Pointer(phLed)))
|
|
}
|
|
|
|
// ZesLedGetProperties Get LED properties
|
|
// /
|
|
// / @details
|
|
// / - The application may call this function from simultaneous threads.
|
|
// / - The implementation of this function should be lock-free.
|
|
// /
|
|
// / @returns
|
|
// / - ::ZE_RESULT_SUCCESS
|
|
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
|
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
|
|
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hLed`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == pProperties`
|
|
func ZesLedGetProperties(
|
|
hLed ZesLedHandle, // hLed [in] Handle for the component.
|
|
pProperties *ZesLedProperties, // pProperties [in,out] Will contain the properties of the LED.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zesLedGetProperties", uintptr(hLed), uintptr(unsafe.Pointer(pProperties)))
|
|
}
|
|
|
|
// ZesLedGetState Get current state of a LED - on/off, color
|
|
// /
|
|
// / @details
|
|
// / - The application may call this function from simultaneous threads.
|
|
// / - The implementation of this function should be lock-free.
|
|
// /
|
|
// / @returns
|
|
// / - ::ZE_RESULT_SUCCESS
|
|
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
|
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
|
|
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hLed`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == pState`
|
|
func ZesLedGetState(
|
|
hLed ZesLedHandle, // hLed [in] Handle for the component.
|
|
pState *ZesLedState, // pState [in,out] Will contain the current state of the LED.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zesLedGetState", uintptr(hLed), uintptr(unsafe.Pointer(pState)))
|
|
}
|
|
|
|
// ZesLedSetState Turn the LED on/off
|
|
// /
|
|
// / @details
|
|
// / - The application may call this function from simultaneous threads.
|
|
// / - The implementation of this function should be lock-free.
|
|
// /
|
|
// / @returns
|
|
// / - ::ZE_RESULT_SUCCESS
|
|
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
|
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
|
|
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hLed`
|
|
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
|
|
// / + User does not have permissions to make these modifications.
|
|
func ZesLedSetState(
|
|
hLed ZesLedHandle, // hLed [in] Handle for the component.
|
|
enable ZeBool, // enable [in] Set to TRUE to turn the LED on, FALSE to turn off.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zesLedSetState", uintptr(hLed), uintptr(enable))
|
|
}
|
|
|
|
// ZesLedSetColor Set the color of the LED
|
|
// /
|
|
// / @details
|
|
// / - The application may call this function from simultaneous threads.
|
|
// / - The implementation of this function should be lock-free.
|
|
// /
|
|
// / @returns
|
|
// / - ::ZE_RESULT_SUCCESS
|
|
// / - ::ZE_RESULT_ERROR_UNINITIALIZED
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_LOST
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
|
|
// / - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
|
// / - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_NOT_AVAILABLE
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
|
|
// / - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
|
|
// / - ::ZE_RESULT_ERROR_UNKNOWN
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
|
// / + `nullptr == hLed`
|
|
// / - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
|
// / + `nullptr == pColor`
|
|
// / - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
|
|
// / + User does not have permissions to make these modifications.
|
|
// / - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
|
|
// / + This LED doesn't not support color changes. See the `haveRGB` member of ::zes_led_properties_t.
|
|
func ZesLedSetColor(
|
|
hLed ZesLedHandle, // hLed [in] Handle for the component.
|
|
pColor *ZesLedColor, // pColor [in] New color of the LED.
|
|
) (ZeResult, error) {
|
|
return zecall.Call[ZeResult]("zesLedSetColor", uintptr(hLed), uintptr(unsafe.Pointer(pColor)))
|
|
}
|