Skip to content

Commit 7301780

Browse files
Merge pull request #11 from FrameworkComputer/license
Add LICENSE file, SPDX header, copyright header
2 parents 907af91 + b3c2f80 commit 7301780

17 files changed

Lines changed: 9107 additions & 43 deletions

FrameworkArgb/Device.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/*++
22
3+
SPDX-License-Identifier: MS-PL
4+
5+
Copyright (C) Microsoft Corporation, All Rights Reserved.
6+
Copyright (C) Framework Computer Inc, All Rights Reserved.
7+
38
Module Name:
49
510
device.c - Device handling events for example driver.

FrameworkArgb/Device.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/*++
22
3+
SPDX-License-Identifier: MS-PL
4+
5+
Copyright (C) Microsoft Corporation, All Rights Reserved.
6+
Copyright (C) Framework Computer Inc, All Rights Reserved.
7+
38
Module Name:
49
510
device.h

FrameworkArgb/Driver.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/*++
22
3+
SPDX-License-Identifier: MS-PL
4+
5+
Copyright (C) Microsoft Corporation, All Rights Reserved.
6+
Copyright (C) Framework Computer Inc, All Rights Reserved.
7+
38
Module Name:
49
510
driver.c

FrameworkArgb/Driver.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/*++
22
3+
SPDX-License-Identifier: MS-PL
4+
5+
Copyright (C) Microsoft Corporation, All Rights Reserved.
6+
Copyright (C) Framework Computer Inc, All Rights Reserved.
7+
38
Module Name:
49
510
driver.h

FrameworkArgb/EcCommunication.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
// Copyright (C) Framework Computer Inc, All Rights Reserved.
2-
//
3-
// Abstract:
4-
//
5-
// This module contains the implementation of communication with the embedded controller.
6-
//
7-
// Only need EC commands to use EC_CMD_MOTION_SENSE_CMD to determine which
8-
// accel sensors there are and which position they are. ALl the rest can be
9-
// done using memory map reads.
10-
//
11-
// Environment:
12-
//
13-
// Windows User-Mode Driver Framework (UMDF)
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.cpp
10+
11+
Abstract:
12+
13+
This module contains the implementation of communication with the embedded
14+
controller via the crosecbus KMDF driver.
15+
16+
Environment:
17+
18+
User-mode Driver Framework 2
19+
20+
--*/
1421

1522
#include "EcCommunication.h"
1623
#include <windows.h>

FrameworkArgb/EcCommunication.h

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
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

FrameworkArgb/FrameworkArgb.inf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
;/*++
2+
; SPDX-License-Identifier: MS-PL
23
;
34
;Copyright (c) Framework Computer Inc
45
;

FrameworkArgb/FrameworkArgb.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<ClInclude Include="Device.h" />
3333
<ClInclude Include="Driver.h" />
3434
<ClInclude Include="EcCommunication.h" />
35+
<ClInclude Include="ec_commands.h" />
3536
<ClInclude Include="LampArrayStructs.h" />
3637
<ClInclude Include="LampArray.h" />
3738
<ClInclude Include="Public.h" />
@@ -167,4 +168,4 @@
167168
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
168169
<ImportGroup Label="ExtensionTargets">
169170
</ImportGroup>
170-
</Project>
171+
</Project>

FrameworkArgb/FrameworkArgb.vcxproj.filters

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
<ClInclude Include="EcCommunication.h">
4646
<Filter>Header Files</Filter>
4747
</ClInclude>
48+
<ClInclude Include="ec_commands.h">
49+
<Filter>Header Files</Filter>
50+
</ClInclude>
4851
<ClInclude Include="LampArray.h">
4952
<Filter>Header Files</Filter>
5053
</ClInclude>
@@ -69,4 +72,4 @@
6972
<Filter>Source Files</Filter>
7073
</ClCompile>
7174
</ItemGroup>
72-
</Project>
75+
</Project>

FrameworkArgb/LampArray.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/*++
22
3+
SPDX-License-Identifier: MS-PL
4+
5+
Copyright (C) Microsoft Corporation, All Rights Reserved.
6+
Copyright (C) Framework Computer Inc, All Rights Reserved.
7+
38
Module Name:
49
510
LampArray.h

0 commit comments

Comments
 (0)