NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
|
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | nhal_async_config |
Typedefs | |
typedef uint16_t | nhal_timeout_ms |
typedef void(* | nhal_async_complete_cb_t) (void *context) |
Enumerations | |
enum | nhal_async_status_t { NHAL_ASYNC_STATUS_IDLE , NHAL_ASYNC_STATUS_BUSY , NHAL_ASYNC_STATUS_COMPLETE , NHAL_ASYNC_STATUS_ERROR } |
enum | nhal_result_t { NHAL_OK = 0 , NHAL_ERR_INVALID_ARG , NHAL_ERR_INVALID_CONFIG , NHAL_ERR_NOT_INITIALIZED , NHAL_ERR_ALREADY_INITIALIZED , NHAL_ERR_NOT_CONFIGURED , NHAL_ERR_NOT_STARTED , NHAL_ERR_ALREADY_STARTED , NHAL_ERR_BUSY , NHAL_ERR_TIMEOUT , NHAL_ERR_HW_FAILURE , NHAL_ERR_UNSUPPORTED , NHAL_ERR_NO_RESPONSE , NHAL_ERR_TRANSMISSION_ERROR , NHAL_ERR_BUFFER_FULL , NHAL_ERR_BUFFER_OVERFLOW , NHAL_ERR_OUT_OF_MEMORY , NHAL_ERR_OTHER } |
Unified HAL result type for all peripheral operations. More... | |
Functions | |
void | nhal_delay_microseconds (uint32_t microseconds) |
Blocking delay for specified number of microseconds. | |
void | nhal_delay_milliseconds (uint32_t milliseconds) |
Blocking delay for specified number of milliseconds. | |
uint64_t | nhal_get_timestamp_microseconds (void) |
Get monotonic timestamp in microseconds since boot. | |
uint32_t | nhal_get_timestamp_milliseconds (void) |
Get monotonic timestamp in milliseconds since boot. | |
typedef void(* nhal_async_complete_cb_t) (void *context) |
Definition at line 56 of file nhal_common.h.
typedef uint16_t nhal_timeout_ms |
Definition at line 6 of file nhal_common.h.
enum nhal_async_status_t |
Definition at line 8 of file nhal_common.h.
enum nhal_result_t |
Unified HAL result type for all peripheral operations.
Definition at line 22 of file nhal_common.h.
void nhal_delay_microseconds | ( | uint32_t | microseconds | ) |
Blocking delay for specified number of microseconds.
This function performs a busy-wait delay, blocking the calling thread for the specified duration. Should be used for precise timing requirements where scheduler-based delays are insufficient.
microseconds | Number of microseconds to delay |
void nhal_delay_milliseconds | ( | uint32_t | milliseconds | ) |
Blocking delay for specified number of milliseconds.
This function performs a busy-wait delay, blocking the calling thread for the specified duration. Should be used for precise timing requirements where scheduler-based delays are insufficient.
milliseconds | Number of milliseconds to delay |
uint64_t nhal_get_timestamp_microseconds | ( | void | ) |
Get monotonic timestamp in microseconds since boot.
This function returns a monotonic timestamp suitable for measuring time intervals with microsecond precision. The timestamp resets on system boot and may rollover after ~4294 seconds on 32-bit systems. Unsigned arithmetic automatically handles rollover correctly for interval calculations.
uint32_t nhal_get_timestamp_milliseconds | ( | void | ) |
Get monotonic timestamp in milliseconds since boot.
This function returns a monotonic timestamp suitable for measuring time intervals with millisecond precision. The timestamp resets on system boot and may rollover after ~49 days on 32-bit systems. Unsigned arithmetic automatically handles rollover correctly for interval calculations.