caffeine-sal 0.1.17
Header-only polymorphic middleware services layer for the Caffeine Framework
Loading...
Searching...
No Matches
cfn_sal.h
Go to the documentation of this file.
1
6#ifndef CAFFEINE_SAL_CFN_SAL_H
7#define CAFFEINE_SAL_CFN_SAL_H
8
9#ifdef __cplusplus
10extern "C"
11{
12#endif
13
14/* Includes ---------------------------------------------------------*/
15#include "cfn_hal.h"
16#include "cfn_hal_base.h"
17#include "cfn_sal_types.h"
18
19/* Defines ----------------------------------------------------------*/
20
25#define CFN_SAL_PREFIX 'S'
26
30#define CFN_SAL_TYPE(a, b, c) CFN_HAL_MAKE_TYPE(CFN_SAL_PREFIX, a, b, c)
31
36#define CFN_SAL_ERROR_BASE 0x600
37
38#define CFN_SAL_CREATE_DRIVER_TYPE(prefix, config_type, api_type, phy_type, cb_type) \
39 struct cfn_##prefix##_s \
40 { \
41 cfn_hal_driver_t base; \
42 const config_type *config; \
43 const api_type *api; \
44 const phy_type *phy; \
45 cb_type cb; \
46 void *cb_user_arg; \
47 }; \
48 typedef struct cfn_##prefix##_s cfn_##prefix##_t
49
50/* Types Enums ------------------------------------------------------*/
51
52/* Extend cfn_hal_error_code_t with service specific errors if needed */
53
54/* Types Structs ----------------------------------------------------*/
55
56/* Functions prototypes ---------------------------------------------*/
57
58#ifdef __cplusplus
59}
60#endif
61
62#endif /* CAFFEINE_SAL_CFN_SAL_H */
Common types for Caffeine SAL.