請先看『使用說明』
DPC Module:DPC under Windows
From LEXWiKi
Line 17: | Line 17: | ||
[[Image:DPC_IMG_002.jpg]]<br /> | [[Image:DPC_IMG_002.jpg]]<br /> | ||
- | 1. Frequency of panel selection | + | 1. Frequency of panel selection. |
- | 2. Apply the frequency of panel which user selected | + | 2. Apply the frequency of panel which user selected. |
3. If checked to save DPC setting , the setting of frequency and duty cycle will be reserved. | 3. If checked to save DPC setting , the setting of frequency and duty cycle will be reserved. | ||
Line 27: | Line 27: | ||
5. Brightness control scrollbar, you can adjust volume of brightness. | 5. Brightness control scrollbar, you can adjust volume of brightness. | ||
- | 6. Show the brightness | + | 6. Show the brightness value which you adjust. |
7. When click the LightOff button, the panel will become darkness. | 7. When click the LightOff button, the panel will become darkness. | ||
- | 8. | + | 8. Set step add / subtract brightness unit. |
- | 9. | + | 9. Apply the step unit. |
- | 10. | + | 10. Reset the record of hot key and picked up area. |
- | 11. | + | 11. Click the button. User can pick up the area from object 13. When clicking area, the panel will be light on from darkness. |
+ | 12. Click the button. User can set the hotkey. When push hot key, the panel will be light on from darkness. | ||
[[Image:DPC_AP_3.jpg]]<br /> | [[Image:DPC_AP_3.jpg]]<br /> | ||
- | + | 13. The light on mouse position and hotkay can not use together , after you record hotkey , you can't use the position anymore. | |
[[Image:DPC_IMG_004.jpg]]<br /> | [[Image:DPC_IMG_004.jpg]]<br /> |
Revision as of 11:23, 14 July 2020
Contents |
The Sample code source you can download form
Binary file:
DPCv4.2.3W_bin.zip
DPC_LightSensor_4.2.3W_bin.zip
How to use the DEMO application
When the DPC utility starts, it will hide in the notification area (like below picture),
and double click the tray icon (shown as the red square below), 'DPC v4.2.3w', it will show.
1. Frequency of panel selection.
2. Apply the frequency of panel which user selected.
3. If checked to save DPC setting , the setting of frequency and duty cycle will be reserved.
4. It will show the MCU version of DPC.
5. Brightness control scrollbar, you can adjust volume of brightness.
6. Show the brightness value which you adjust.
7. When click the LightOff button, the panel will become darkness.
8. Set step add / subtract brightness unit.
9. Apply the step unit.
10. Reset the record of hot key and picked up area.
11. Click the button. User can pick up the area from object 13. When clicking area, the panel will be light on from darkness.
12. Click the button. User can set the hotkey. When push hot key, the panel will be light on from darkness.
13. The light on mouse position and hotkay can not use together , after you record hotkey , you can't use the position anymore.
13. First key of hotkey
15. Second key of hotkey
16. Third key hotkey
17. Confirm the hotkey which you entered
18. Show hotkey which you set.
19. Hotkey will show here.
20. If you want to exit DPC , you should click right button of mouse on the icon and choose exit.
21. Check this grid program will automatically grab the light size to adjust the DPC light and dark
22. Showing the device name
23. Showing the mode in use
24. Showing the range in used
25. Showing calculated LUX values
26. Mode and Range detail settings
27. Choose which mode to use
28. Choose which range to use
29. Custom DPC Max brightness
30. Set the DPC brightness intermediate reference value
31. Custom DPC Min brightness
32. Complete the settings button but without leaving the window
33. Complete the settings button and exit leaving the window
34. exit leaving the window
Sample code Introduction
Define SMBus register
#define SMBUSPORT 0x0500 #define HST_STS SMBUSPORT+0x00 #define HST_CNT SMBUSPORT+0x02 #define HST_CMD SMBUSPORT+0x03 #define XMIT_SLVA SMBUSPORT+0x04 #define HST_D0 SMBUSPORT+0x05 #define bSize 1 #define SADD 0xb0 #define PWMFeq 0x01 #define PWMDuty 0x02
Set Frequency data
DWORD dwPortVal; bool bResult; bResult = InitializeWinIo(); if (bResult){ SetPortVal(HST_STS, 0xFE, bSize); //start Sleep(20); SetPortVal(XMIT_SLVA, SADD, bSize); //set Sleep(20); SetPortVal(HST_CMD, PWMFeq, bSize); //set frequency Sleep(20); GetPortVal(HST_STS, &dwPortVal, bSize); Sleep(20); dwPortVal = dwPortVal & 0x01; if (dwPortVal == 0){ SetPortVal(HST_D0, fvalue, bSize); //write data into frequency Sleep(20); SetPortVal(HST_CNT, 0x48, bSize); //stop Sleep(20); ShutdownWinIo(); } else ShutdownWinIo(); } ShutdownWinIo();
Set Duty data
UpdateData(TRUE); DWORD dwPortVal; bool bResult; bResult = InitializeWinIo(); if (bResult){ SetPortVal(HST_STS, 0xFE, bSize); //start Sleep(20); SetPortVal(XMIT_SLVA, SADD, bSize); //set Sleep(20); SetPortVal(HST_CMD, PWMDuty, bSize); //set duty Sleep(20); GetPortVal(HST_STS, &dwPortVal, bSize); Sleep(20); dwPortVal = dwPortVal & 0x01; if (dwPortVal == 0){ if (inverter == false) SetPortVal(HST_D0, dvalue * 10 , bSize); //write data into data else if (inverter == true) SetPortVal(HST_D0, (10 - dvalue) * 10 , bSize); Sleep(20); SetPortVal(HST_CNT, 0x48, bSize); //stop Sleep(20); ShutdownWinIo(); } else ShutdownWinIo(); } ShutdownWinIo();