Wirepas SDK
|
The hardware library allows telling the stack that a certain hardware peripheral is in use by the application, so that the stack does not use the peripheral at the same time. Also vice versa, hardware library tells application if it is trying to use hardware peripheral used by the stack. The stack needs to know chip temperature to do periodic RF calibrations on some platforms, and that may require the stack to access hardware peripherals that the application also uses.
The application may use a peripheral either intermittently or permanently.
This library also allows the activation of a hardware peripheral. In fact, some peripheral may be needed by the application or the stack with a concurrent access as the activation of an external crystal for more precision.
Library services are accessed via lib_hw handle.
Definition in file wms_hardware.h.
Go to the source code of this file.
Typedefs | |
typedef app_res_e(* | app_lib_hardware_activate_peripheral_f) (app_lib_hardware_activable_peripheral_e peripheral) |
Request for peripheral activation. More... | |
typedef app_res_e(* | app_lib_hardware_deactivate_peripheral_f) (app_lib_hardware_activable_peripheral_e peripheral) |
Request for peripheral deactivation. More... | |
typedef app_res_e(* | app_lib_hardware_is_peripheral_activated_f) (app_lib_hardware_activable_peripheral_e peripheral, bool *activated_p, uint32_t timeout_us) |
Request for peripheral status. More... | |
Data Structures | |
struct | app_lib_hardware_t |
List of library functions. More... | |
Enumerations | |
enum | app_lib_hardware_activable_peripheral_e { APP_LIB_HARDWARE_PERIPHERAL_HFXO = 0 } |
Hardware peripherals to activate. More... | |
Macros | |
#define | APP_LIB_HARDWARE_NAME 0x014eff15 |
Library symbolic name More... | |
#define | APP_LIB_HARDWARE_VERSION 0x203 |
Maximum supported library version. More... | |
typedef app_res_e(* app_lib_hardware_activate_peripheral_f) (app_lib_hardware_activable_peripheral_e peripheral) |
Request for peripheral activation.
peripheral | Hardware peripheral to activate |
Definition at line 68 of file wms_hardware.h.
typedef app_res_e(* app_lib_hardware_deactivate_peripheral_f) (app_lib_hardware_activable_peripheral_e peripheral) |
Request for peripheral deactivation.
peripheral | Hardware peripheral to deactivate |
Definition at line 81 of file wms_hardware.h.
typedef app_res_e(* app_lib_hardware_is_peripheral_activated_f) (app_lib_hardware_activable_peripheral_e peripheral, bool *activated_p, uint32_t timeout_us) |
Request for peripheral status.
The given timeout_us
is the maximum time to wait for peripheral activation. Each peripheral has a maximum timeout dependent on the platform.
peripheral | Hardware peripheral to check status |
activated_p | Pointer to store the status: true if activated, false otherwise |
timeout_us | Maximum time to wait for activation |
timeout_us
is too long APP_RES_INVALID_VALUE is returned. Otherwise, APP_RES_OK is returned and activated_p
is updated. Definition at line 104 of file wms_hardware.h.
struct app_lib_hardware_t |
List of library functions.
Definition at line 112 of file wms_hardware.h.
Data Fields | ||
---|---|---|
app_lib_hardware_activate_peripheral_f | activatePeripheral | |
app_lib_hardware_deactivate_peripheral_f | deactivatePeripheral | |
app_lib_hardware_is_peripheral_activated_f | isPeripheralActivated |
Hardware peripherals to activate.
To be used with services lib_hw->activatePeripheral() and lib_hw->deactivatePeripheral().
Enumerator | |
---|---|
APP_LIB_HARDWARE_PERIPHERAL_HFXO | General high frequency external crystal |
Definition at line 52 of file wms_hardware.h.
#define APP_LIB_HARDWARE_NAME 0x014eff15 |
#define APP_LIB_HARDWARE_VERSION 0x203 |
Maximum supported library version.
Definition at line 41 of file wms_hardware.h.