自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
local_time_hw_device 結構體參考資料
#include <
local_time_hal.h
>
在實驗室環境中收集低層同步處理資料的方法。大多數 HAL 實作方式會將此成員設為 NULL,或傳回 -EINVAL,表示不支援此功能。正式版 HAL 不應支援此方法。
定義位於檔案
local_time_hal.h
的
98
行。
設定振盪器的 HW 斜率,驅動系統全域本機時間計數器。成功時,平台應傳回 0。不支援硬體偏移的平台應將此方法設為 NULL。
有效的 rate 值範圍從 MIN_INT16 到 MAX_INT16。平台實作應嘗試將此範圍線性對應至硬體的最小/最大轉速率。
定義位於檔案
local_time_hal.h
的
89
行。
這個結構體的說明文件是由下列檔案產生:
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Android Hardware Abstraction Layer: local_time_hw_device Struct Reference\n\nlocal_time_hw_device Struct Reference\n=====================================\n\n[Data Fields](#pub-attribs) \nlocal_time_hw_device Struct Reference \n\n`\n#include \u003c\n`[local_time_hal.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)`\n\u003e\n`\n\n|----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| struct [hw_device_t](/reference/hal/structhw__device__t) | [common](/reference/hal/structlocal__time__hw__device#a86a0ca82dd3f02023e259b8b5e155dbe) |\n| ||\n| int64_t(\\* | [get_local_time](/reference/hal/structlocal__time__hw__device#aa2fced6a37dbd2b5f72c8148a52c611a) )(struct [local_time_hw_device](/reference/hal/structlocal__time__hw__device) \\*dev) |\n| ||\n| uint64_t(\\* | [get_local_freq](/reference/hal/structlocal__time__hw__device#a761e4dab7f805e4a1810a2214aabb2f3) )(struct [local_time_hw_device](/reference/hal/structlocal__time__hw__device) \\*dev) |\n| ||\n| int(\\* | [set_local_slew](/reference/hal/structlocal__time__hw__device#af05541302faa15c0eb8a04c0765297b0) )(struct [local_time_hw_device](/reference/hal/structlocal__time__hw__device) \\*dev, int16_t rate) |\n| ||\n| int(\\* | [get_debug_log](/reference/hal/structlocal__time__hw__device#a3c571551268d4ba712c129ac665d0ff5) )(struct [local_time_hw_device](/reference/hal/structlocal__time__hw__device) \\*dev, struct [local_time_debug_event](/reference/hal/structlocal__time__debug__event) \\*records, int max_records) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nDefinition at line\n[57](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\nof file\n[local_time_hal.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------------------------------------------------|\n| struct [hw_device_t](/reference/hal/structhw__device__t) common |\n\n\nCommon methods of the local time hardware device. This\n*must*\nbe the first member of\n[local_time_hw_device](/reference/hal/structlocal__time__hw__device)\nas users of this structure will cast a\n[hw_device_t](/reference/hal/structhw__device__t)\nto\n[local_time_hw_device](/reference/hal/structlocal__time__hw__device)\npointer in contexts where it's known the\n[hw_device_t](/reference/hal/structhw__device__t)\nreferences a\n[local_time_hw_device](/reference/hal/structlocal__time__hw__device)\n.\n\n\nDefinition at line\n[64](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\nof file\n[local_time_hal.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\n.\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* get_debug_log)(struct [local_time_hw_device](/reference/hal/structlocal__time__hw__device) \\*dev, struct [local_time_debug_event](/reference/hal/structlocal__time__debug__event) \\*records, int max_records) |\n\n\nA method used to collect low level sync data in a lab environments. Most HAL implementations will simply set this member to NULL, or return -EINVAL to indicate that this functionality is not supported. Production HALs should never support this method.\n\n\nDefinition at line\n[98](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\nof file\n[local_time_hal.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\n.\n\n|----------------------------------------------------------------------------------------------------------------|\n| uint64_t(\\* get_local_freq)(struct [local_time_hw_device](/reference/hal/structlocal__time__hw__device) \\*dev) |\n\n\nReturns the nominal frequency (in hertz) of the system wide local time counter\n\n\nDefinition at line\n[77](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\nof file\n[local_time_hal.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\n.\n\n|---------------------------------------------------------------------------------------------------------------|\n| int64_t(\\* get_local_time)(struct [local_time_hw_device](/reference/hal/structlocal__time__hw__device) \\*dev) |\n\n\nReturns the current value of the system wide local time counter\n\n\nDefinition at line\n[70](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\nof file\n[local_time_hal.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\n.\n\n|-------------------------------------------------------------------------------------------------------------------------|\n| int(\\* set_local_slew)(struct [local_time_hw_device](/reference/hal/structlocal__time__hw__device) \\*dev, int16_t rate) |\n\n\nSets the HW slew rate of oscillator which drives the system wide local time counter. On success, platforms should return 0. Platforms which do not support HW slew should leave this method set to NULL.\n\n\nValid values for rate range from MIN_INT16 to MAX_INT16. Platform implementations should attempt map this range linearly to the min/max slew rate of their hardware.\n\n\nDefinition at line\n[89](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\nof file\n[local_time_hal.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [local_time_hal.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/local_time_hal.h)"]]