Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🔧 hal::hw

Hardware Utility Functions

366 satır Utilities

📖 Genel Bakış

Hardware utilities: atomic operations, critical sections, memory barriers, watchdog

🚀 Kullanım

içe_aktar hal::hw

// Critical section (disable interrupts)
hw.enter_critical()
// ... critical code ...
hw.exit_critical()

// Atomic operations
hw.atomic_add(&counter, 1)
hw.atomic_sub(&counter, 1)
hw.atomic_exchange(&value, new_value)

// Memory barriers
hw.memory_barrier()
hw.data_sync_barrier()

// Watchdog
hw.watchdog_init(1000)  // 1 second timeout
hw.watchdog_refresh()

// Reset
hw.reset()
hw.reset_cause()  // Get last reset reason

← HAL Modülleri