NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
Loading...
Searching...
No Matches
nhal_common.h
Go to the documentation of this file.
1#ifndef NHAL_COMMON_H
2#define NHAL_COMMON_H
3
4#include <stdint.h>
5
6typedef uint16_t nhal_timeout_ms;
7
14
16 struct nhal_async_impl_config * impl_config;
17};
18
54
55// Common async operation types
56typedef void (*nhal_async_complete_cb_t)(void *context);
57
67void nhal_delay_microseconds(uint32_t microseconds);
68
78void nhal_delay_milliseconds(uint32_t milliseconds);
79
92
105
106#endif
void(* nhal_async_complete_cb_t)(void *context)
Definition nhal_common.h:56
nhal_result_t
Unified HAL result type for all peripheral operations.
Definition nhal_common.h:22
@ NHAL_ERR_OTHER
Unspecified error.
Definition nhal_common.h:52
@ NHAL_ERR_TIMEOUT
Operation timeout.
Definition nhal_common.h:38
@ NHAL_ERR_NOT_STARTED
Operation not started.
Definition nhal_common.h:33
@ NHAL_ERR_BUFFER_OVERFLOW
Buffer overflow.
Definition nhal_common.h:48
@ NHAL_ERR_HW_FAILURE
Hardware failure.
Definition nhal_common.h:39
@ NHAL_ERR_BUFFER_FULL
Buffer full.
Definition nhal_common.h:47
@ NHAL_ERR_UNSUPPORTED
Feature not supported.
Definition nhal_common.h:40
@ NHAL_ERR_ALREADY_INITIALIZED
Already initialized.
Definition nhal_common.h:29
@ NHAL_ERR_ALREADY_STARTED
Already started/running.
Definition nhal_common.h:34
@ NHAL_ERR_NO_RESPONSE
No response from target (NACK, etc.).
Definition nhal_common.h:43
@ NHAL_OK
Operation completed successfully.
Definition nhal_common.h:23
@ NHAL_ERR_OUT_OF_MEMORY
Memory allocation failed.
Definition nhal_common.h:49
@ NHAL_ERR_NOT_INITIALIZED
Peripheral not initialized.
Definition nhal_common.h:28
@ NHAL_ERR_TRANSMISSION_ERROR
General transmission error.
Definition nhal_common.h:44
@ NHAL_ERR_INVALID_CONFIG
Invalid configuration.
Definition nhal_common.h:27
@ NHAL_ERR_NOT_CONFIGURED
Peripheral not configured.
Definition nhal_common.h:30
@ NHAL_ERR_BUSY
Resource busy/locked/unavailable.
Definition nhal_common.h:35
@ NHAL_ERR_INVALID_ARG
Invalid arguments provided.
Definition nhal_common.h:26
uint16_t nhal_timeout_ms
Definition nhal_common.h:6
uint64_t nhal_get_timestamp_microseconds(void)
Get monotonic timestamp in microseconds since boot.
void nhal_delay_milliseconds(uint32_t milliseconds)
Blocking delay for specified number of milliseconds.
nhal_async_status_t
Definition nhal_common.h:8
@ NHAL_ASYNC_STATUS_BUSY
Async operation in progress.
Definition nhal_common.h:10
@ NHAL_ASYNC_STATUS_ERROR
Operation completed with error.
Definition nhal_common.h:12
@ NHAL_ASYNC_STATUS_IDLE
No async operation in progress.
Definition nhal_common.h:9
@ NHAL_ASYNC_STATUS_COMPLETE
Operation completed successfully.
Definition nhal_common.h:11
uint32_t nhal_get_timestamp_milliseconds(void)
Get monotonic timestamp in milliseconds since boot.
void nhal_delay_microseconds(uint32_t microseconds)
Blocking delay for specified number of microseconds.
struct nhal_async_impl_config * impl_config
Platform-specific async config.
Definition nhal_common.h:16