Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions FrameworkArgb/Device.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Microsoft Corporation, All Rights Reserved.
Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

device.c - Device handling events for example driver.
Expand Down
5 changes: 5 additions & 0 deletions FrameworkArgb/Device.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Microsoft Corporation, All Rights Reserved.
Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

device.h
Expand Down
5 changes: 5 additions & 0 deletions FrameworkArgb/Driver.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Microsoft Corporation, All Rights Reserved.
Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

driver.c
Expand Down
5 changes: 5 additions & 0 deletions FrameworkArgb/Driver.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Microsoft Corporation, All Rights Reserved.
Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

driver.h
Expand Down
33 changes: 20 additions & 13 deletions FrameworkArgb/EcCommunication.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
// Copyright (C) Framework Computer Inc, All Rights Reserved.
//
// Abstract:
//
// This module contains the implementation of communication with the embedded controller.
//
// Only need EC commands to use EC_CMD_MOTION_SENSE_CMD to determine which
// accel sensors there are and which position they are. ALl the rest can be
// done using memory map reads.
//
// Environment:
//
// Windows User-Mode Driver Framework (UMDF)
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

EcCommunication.cpp

Abstract:

This module contains the implementation of communication with the embedded
controller via the crosecbus KMDF driver.

Environment:

User-mode Driver Framework 2

--*/

#include "EcCommunication.h"
#include <windows.h>
Expand Down
52 changes: 25 additions & 27 deletions FrameworkArgb/EcCommunication.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
//Copyright (C) Framework Computer Inc
//Copyright (C) 2014 The ChromiumOS Authors
//
//Abstract:
//
// Definitions for accessing EC
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

EcCommunication.h

Abstract:

This file contains definitions for accessing the EC via the crosecbus
KMDF driver.

Environment:

User-mode Driver Framework 2

--*/

#pragma once

Expand All @@ -16,24 +30,11 @@ extern "C" {
#include <wdf.h>
#include "trace.h"

/* Command version mask */
#define EC_VER_MASK(version) (1UL << (version))

#define EC_MEMMAP_ALS 0x80 /* ALS readings in lux (2 X 16 bits) */
/* Unused 0x84 - 0x8f */
#define EC_MEMMAP_ACC_STATUS 0x90 /* Accelerometer status (8 bits )*/
/* Unused 0x91 */
#define EC_MEMMAP_ACC_DATA 0x92 /* Accelerometers data 0x92 - 0x9f */
/* 0x92: Lid Angle if available, LID_ANGLE_UNRELIABLE otherwise */
/* 0x94 - 0x99: 1st Accelerometer */
/* 0x9a - 0x9f: 2nd Accelerometer */

/* Define the format of the accelerometer mapped memory status byte. */
#define EC_MEMMAP_ACC_STATUS_SAMPLE_ID_MASK 0x0f
// BIT(4)
#define EC_MEMMAP_ACC_STATUS_BUSY_BIT (1 << 4)
// BIT(7)
#define EC_MEMMAP_ACC_STATUS_PRESENCE_BIT (1 << 7)
#include "ec_compat_win.h"
#pragma pack(push, 1)
#include "ec_commands.h"
#pragma pack(pop)
#pragma warning(pop) /* matches push in ec_compat_win.h */

#define FILE_DEVICE_CROS_EMBEDDED_CONTROLLER 0x80EC

Expand All @@ -49,9 +50,6 @@ NTSTATUS ConnectToEc(
_Inout_ HANDLE* Handle
);

#define EC_CMD_RGBKBD_SET_COLOR 0x013A
#define EC_CMD_RGBKBD 0x013B

#define EC_RES_SUCCESS 0
#define EC_INVALID_COMMAND 1
#define EC_ERROR 2
Expand Down
1 change: 1 addition & 0 deletions FrameworkArgb/FrameworkArgb.inf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
;/*++
; SPDX-License-Identifier: MS-PL
;
;Copyright (c) Framework Computer Inc
;
Expand Down
3 changes: 2 additions & 1 deletion FrameworkArgb/FrameworkArgb.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<ClInclude Include="Device.h" />
<ClInclude Include="Driver.h" />
<ClInclude Include="EcCommunication.h" />
<ClInclude Include="ec_commands.h" />
<ClInclude Include="LampArrayStructs.h" />
<ClInclude Include="LampArray.h" />
<ClInclude Include="Public.h" />
Expand Down Expand Up @@ -167,4 +168,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
5 changes: 4 additions & 1 deletion FrameworkArgb/FrameworkArgb.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<ClInclude Include="EcCommunication.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ec_commands.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="LampArray.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -69,4 +72,4 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
</Project>
5 changes: 5 additions & 0 deletions FrameworkArgb/LampArray.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Microsoft Corporation, All Rights Reserved.
Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

LampArray.h
Expand Down
5 changes: 5 additions & 0 deletions FrameworkArgb/LampArrayStructs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Microsoft Corporation, All Rights Reserved.
Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

LampArrayStructs.h
Expand Down
5 changes: 5 additions & 0 deletions FrameworkArgb/Queue.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Microsoft Corporation, All Rights Reserved.
Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

queue.c
Expand Down
5 changes: 5 additions & 0 deletions FrameworkArgb/Queue.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/*++

SPDX-License-Identifier: MS-PL

Copyright (C) Microsoft Corporation, All Rights Reserved.
Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

queue.h
Expand Down
5 changes: 4 additions & 1 deletion FrameworkArgb/Trace.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*++

Copyright (C) Microsoft Corporation, All Rights Reserved.
Copyright (C) Framework Computer Inc, All Rights Reserved.

Module Name:

Internal.h
Expand Down Expand Up @@ -74,4 +77,4 @@ Module Name:
//
#if UMDF_VERSION_MAJOR == 2 && UMDF_VERSION_MINOR == 0
#define MYDRIVER_TRACING_ID L"Microsoft\\UMDF2.0\\FrameworkArgb V1.0"
#endif
#endif
Loading