1- //Copyright (C) Framework Computer Inc
2- //Copyright (C) 2014 The ChromiumOS Authors
3- //
4- //Abstract:
5- //
6- // Definitions for accessing EC
1+ /*++
2+
3+ SPDX-License-Identifier: MS-PL
4+
5+ Copyright (C) Framework Computer Inc, All Rights Reserved.
6+
7+ Module Name:
8+
9+ EcCommunication.h
10+
11+ Abstract:
12+
13+ This file contains definitions for accessing the EC via the crosecbus
14+ KMDF driver.
15+
16+ Environment:
17+
18+ User-mode Driver Framework 2
19+
20+ --*/
721
822#pragma once
923
@@ -16,24 +30,11 @@ extern "C" {
1630#include <wdf.h>
1731#include "trace.h"
1832
19- /* Command version mask */
20- #define EC_VER_MASK (version ) (1UL << (version))
21-
22- #define EC_MEMMAP_ALS 0x80 /* ALS readings in lux (2 X 16 bits) */
23- /* Unused 0x84 - 0x8f */
24- #define EC_MEMMAP_ACC_STATUS 0x90 /* Accelerometer status (8 bits )*/
25- /* Unused 0x91 */
26- #define EC_MEMMAP_ACC_DATA 0x92 /* Accelerometers data 0x92 - 0x9f */
27- /* 0x92: Lid Angle if available, LID_ANGLE_UNRELIABLE otherwise */
28- /* 0x94 - 0x99: 1st Accelerometer */
29- /* 0x9a - 0x9f: 2nd Accelerometer */
30-
31- /* Define the format of the accelerometer mapped memory status byte. */
32- #define EC_MEMMAP_ACC_STATUS_SAMPLE_ID_MASK 0x0f
33- // BIT(4)
34- #define EC_MEMMAP_ACC_STATUS_BUSY_BIT (1 << 4)
35- // BIT(7)
36- #define EC_MEMMAP_ACC_STATUS_PRESENCE_BIT (1 << 7)
33+ #include "ec_compat_win.h"
34+ #pragma pack(push, 1)
35+ #include "ec_commands.h"
36+ #pragma pack(pop)
37+ #pragma warning(pop) /* matches push in ec_compat_win.h */
3738
3839#define FILE_DEVICE_CROS_EMBEDDED_CONTROLLER 0x80EC
3940
@@ -49,9 +50,6 @@ NTSTATUS ConnectToEc(
4950 _Inout_ HANDLE * Handle
5051);
5152
52- #define EC_CMD_RGBKBD_SET_COLOR 0x013A
53- #define EC_CMD_RGBKBD 0x013B
54-
5553#define EC_RES_SUCCESS 0
5654#define EC_INVALID_COMMAND 1
5755#define EC_ERROR 2
0 commit comments