caffeine-sal 0.1.17
Header-only polymorphic middleware services layer for the Caffeine Framework
Loading...
Searching...
No Matches
cfn_sal_dev_composite.h
Go to the documentation of this file.
1
6#ifndef CAFFEINE_SAL_DEV_COMPOSITE_H
7#define CAFFEINE_SAL_DEV_COMPOSITE_H
8
9#ifdef __cplusplus
10extern "C"
11{
12#endif
13
14/* Includes ---------------------------------------------------------*/
15#include "cfn_sal.h"
16
17/* Types Structs ----------------------------------------------------*/
18
31
32/* Functions inline ------------------------------------------------- */
33
41CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_dev_composite_init(cfn_sal_dev_composite_shared_t *state,
42 const cfn_sal_phy_t *phy)
43{
44 if ((state == NULL) || (phy == NULL))
45 {
46 return CFN_HAL_ERROR_BAD_PARAM;
47 }
48
49 state->phy = phy;
50 state->init_ref_count = 0;
51 state->hw_initialized = false;
52
53 return CFN_HAL_ERROR_OK;
54}
55
62CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_dev_composite_deinit(cfn_sal_dev_composite_shared_t *state)
63{
64 if (state == NULL)
65 {
66 return CFN_HAL_ERROR_BAD_PARAM;
67 }
68
69 state->phy = NULL;
70 state->init_ref_count = 0;
71 state->hw_initialized = false;
72
73 return CFN_HAL_ERROR_OK;
74}
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif /* CAFFEINE_SAL_DEV_COMPOSITE_H */
Core definitions and macros for Caffeine SAL.
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_dev_composite_deinit(cfn_sal_dev_composite_shared_t *state)
Deinitialize the shared composite state.
Definition cfn_sal_dev_composite.h:62
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_dev_composite_init(cfn_sal_dev_composite_shared_t *state, const cfn_sal_phy_t *phy)
Initialize the shared composite state.
Definition cfn_sal_dev_composite.h:41
Standardized shared state for composite (multi-function) sensors. This structure should be embedded w...
Definition cfn_sal_dev_composite.h:26
const cfn_sal_phy_t * phy
Definition cfn_sal_dev_composite.h:27
bool hw_initialized
Definition cfn_sal_dev_composite.h:29
uint8_t init_ref_count
Definition cfn_sal_dev_composite.h:28
Generic physical mapping for services.
Definition cfn_sal_types.h:26