One: Preparation of the development environment
Host development Environment:
- Visual Studio Professional
- Windows SDK 8.2
- Windows Driver Kit 8.2
- Windows ADK for Windows 8.1 update
Target Board
- WINDOWS10 Build 9879 for x86
- Shark Cove BSP
Two. Target Board configuration
Two: Write the driver Code of light sensor.
- Open Spbaccelerometer.inx, and modify ACPI. The code is modified as follows:
Modified before:%spbaccelerometer.devicedesc% = Spbaccelerometer_install,acpi\spbaccelerometer
Modified:%spbaccelerometer.devicedesc% = Spbaccelerometer_install,acpi\ps
- Open the Adx1345.h and modify the register address and register configuration according to the specifications of the PS sensor that will be used.
- Open AccelerometerDevice.cpp, modify the chip initialization configuration and interrupt handler function.
- Modify the configuration of the BIOS section
(1) Copy the ASL.exe to the Sharks Cove board.
(2) Open the Command line tool and enter the command ASL/TAB=SSDT. The command creates a file Ssdt.asl
(3) Open the SSDT.ASL and modify the BIOS configuration. The boldface section is the default setting. Configuration can be modified according to the actual situation.
Definitionblock ("SSDT. AML "," SSDT ", 0x01," Intel_ "," Adebtabl ", 0x00001000)
{
Scope (¥)
{
Name (DPTR, 0x3bf2d000)
Name (Eptr, 0x3bf3d000)
Name (CPTR, 0x3bf2d010)
Mutex (Mmut, 0x0)
Method (MDBG, 0x1, serialized)
{
Store (Acquire (Mmut, 0x3e8), Local0)
If (LEqual (Local0, Zero))
{
Operationregion (Ablk, Systemmemory, CPTR, 0x10)
Field (Ablk, BYTEACC, NoLock, Preserve)
{
AAAA, 128
}
Store (Arg0, AAAA)
ADD (CPTR, 0x10, CPTR)
If (Lnot (lless (CPTR, eptr)))
{
ADD (DPTR, 0x10, CPTR)
}
Release (Mmut)
}
Return (LOCAL0)
}
}
Scope (_sb_)
{
Device (SPBA)
{
Name (_hid, "PS")
Name (_uid, 1)
Method (_crs, 0x0, notserialized)
{
Name (RBUF, Resourcetemplate ()
{
I2cserialbus (0x38, controllerinitiated, 400000, Addressingmode7bit, "¥¥_SB. I2c3 ", 0, Resourceconsumer)
Gpioint (Edge, Activehigh, Exclusive, PullDown, 0, "¥¥_SB. GPO2 ") {0x6}
})
Return (RBUF)
}
}//Device (SPBA)
}//Scope (_sb_)
}
(4) Enter the command ASL SSDT.ASL, generate the Ssdt.aml file.
(5) Verify that the test signing on the Shark Cove is on
(6) Enter command asl/loadtable ssdt.aml load SSDT file
- Restart Shark Cove. In device management, see if the device is loaded correctly.
- Use Traceview.exe to view log information.
Development of PS Drive under WINDOWS10 environment