Skip to content

Commit c54f51c

Browse files
committed
Improve documents
1 parent aabac13 commit c54f51c

File tree

4 files changed

+229
-58
lines changed

4 files changed

+229
-58
lines changed

Doxyfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ INLINE_SIMPLE_STRUCTS = NO
434434
# types are typedef'ed and only the typedef is referenced, never the tag name.
435435
# The default value is: NO.
436436

437-
TYPEDEF_HIDES_STRUCT = NO
437+
TYPEDEF_HIDES_STRUCT = YES
438438

439439
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
440440
# cache is used to resolve symbols given their name and scope. Since this can be
@@ -485,7 +485,7 @@ EXTRACT_PACKAGE = NO
485485
# included in the documentation.
486486
# The default value is: NO.
487487

488-
EXTRACT_STATIC = NO
488+
EXTRACT_STATIC = YES
489489

490490
# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
491491
# locally in source files will be included in the documentation. If set to NO,
@@ -610,7 +610,7 @@ SORT_MEMBER_DOCS = YES
610610
# this will also influence the order of the classes in the class list.
611611
# The default value is: NO.
612612

613-
SORT_BRIEF_DOCS = NO
613+
SORT_BRIEF_DOCS = YES
614614

615615
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
616616
# (brief and detailed) documentation of class members so that constructors and
@@ -1699,7 +1699,7 @@ EXTRA_SEARCH_MAPPINGS =
16991699
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
17001700
# The default value is: YES.
17011701

1702-
GENERATE_LATEX = YES
1702+
GENERATE_LATEX = NO
17031703

17041704
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
17051705
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
@@ -2161,7 +2161,7 @@ INCLUDE_FILE_PATTERNS =
21612161
# recursively expanded use the := operator instead of the = operator.
21622162
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
21632163

2164-
PREDEFINED =
2164+
PREDEFINED = _DOXYGEN_
21652165

21662166
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
21672167
# tag can be used to specify a list of macro names that should be expanded. The

src/se/drivers/default/lmic_se_default.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ static int aes_verifyMic (const u1_t *key, u4_t devaddr, u4_t seqno, int dndir,
9797
\par "Implementation Details"
9898
This implementation requires that \p iKey be \ref LMIC_SecureElement_KeySelector_Unicast.
9999
100-
\retval \ref LMIC_SecureElement_Error_OK means that the MIC was valid.
101-
\retval \ref LMIC_SecureElement_Error_InvalidMIC means that the MIC was not valid.
100+
\retval LMIC_SecureElement_Error_OK means that the MIC was valid.
101+
\retval LMIC_SecureElement_Error_InvalidMIC means that the MIC was not valid.
102102
103103
*/
104104

@@ -152,8 +152,8 @@ static void aes_cipher (xref2cu1_t key, u4_t devaddr, u4_t seqno, int dndir, xre
152152
the port number. This is used to select either \c AppSKey or \c NwkSKey to
153153
encode and MIC the message.
154154
155-
\retval \ref LMIC_SecureElement_Error_OK means that the MIC was valid.
156-
\retval \ref LMIC_SecureElement_Error_InvalidMIC means that the MIC was not valid.
155+
\retval LMIC_SecureElement_Error_OK means that the MIC was valid.
156+
\retval LMIC_SecureElement_Error_InvalidMIC means that the MIC was not valid.
157157
158158
*/
159159

@@ -380,6 +380,7 @@ LMIC_SecureElement_Default_decodeJoinAccept(
380380
381381
\post
382382
\ref AESKey is set to the contents of \p pKey.
383+
383384
*/
384385

385386
LMIC_SecureElement_Error_t

src/se/i/lmic_secure_element_api.h

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,39 @@ Copyright & License:
3030
| static binding.
3131
\****************************************************************************/
3232

33+
#if defined(_DOXYGEN_)
34+
/// \brief Select the secure-element driver
35+
///
36+
/// \details
37+
/// This macro must be set to the name used by the secure element driver for
38+
/// its API functions. The default is `Default`.
39+
///
40+
/// \hideinitializer
41+
///
42+
# define LMIC_CFG_SecureElement_DRIVER Default
43+
44+
/// \brief Select linkage style
45+
///
46+
/// \details
47+
/// If this macro is defined and non-zero, the secure element will
48+
/// be integrated with the LMIC at compile time. If defined and zero,
49+
/// the secure element driver will be accessed via external functions,
50+
/// allowing the integration to be deferred to link time or run time.
51+
///
52+
/// \note
53+
/// At present, only compile-time integration is implemented.
54+
///
55+
/// \hideinitializer
56+
////
57+
# define LMIC_ENABLE_SecureElement_STATIC 1
58+
#endif
59+
3360
#if ! defined(LMIC_CFG_SecureElement_DRIVER)
3461
# define LMIC_CFG_SecureElement_DRIVER Default
3562
#endif
3663

3764
#if ! defined(LMIC_ENABLE_SecureElement_STATIC)
38-
#define LMIC_ENABLE_SecureElement_STATIC 1
65+
# define LMIC_ENABLE_SecureElement_STATIC 1
3966
#endif
4067

4168
/****************************************************************************\
@@ -71,12 +98,65 @@ LMIC_SecureElement_aes128Encrypt_t LMIC_SecureElement_aes128Encrypt;
7198
/*
7299
|| Use static linkage for the APIs.
73100
*/
101+
102+
/// \brief Generate a method function name without argument expansion
103+
/// \param a_driver The name of the driver (will be macro-expanded)
104+
/// \param a_fn The function-name fragment (will be macro-expanded)
105+
///
106+
/// \details
107+
/// This macro is like \ref LMIC_SecureElement_METHOD() except that
108+
/// macros in the arguments are not expanded prior performing string substitution.
109+
///
110+
/// For example, writing:
111+
///
112+
/// \code
113+
/// #define LMIC_CFG_SecureElement_DRIVER Foo
114+
/// LMIC_SecureElement_METHOD(LMIC_CFG_SecureElement_DRIVER, initialize)();
115+
/// \endcode
116+
///
117+
/// is the same as writing:
118+
///
119+
/// \code
120+
/// LMIC_SecureElement_LMIC_CFG_SecureElement_DRIVER_initialize();
121+
/// \endcode
122+
///
123+
/// \see LMIC_SecureElement_METHOD()
124+
/// \hideinitializer
125+
///
74126
#define LMIC_SecureElement_METHOD_(a_driver, a_fn) \
75127
(LMIC_SecureElement_##a_driver##_##a_fn)
128+
129+
/// \brief Generate a method function name
130+
/// \param a_driver The name of the driver (will be macro-expanded)
131+
/// \param a_fn The function-name fragment (will be macro-expanded)
132+
///
133+
/// \details
134+
/// This macro returns a standard method function name. Standard method
135+
/// function names begin with `LMIC_SecureElement_`, followed by _a_driver_,
136+
/// followed by an underscore `_`, and ending with _a_fn_.
137+
/// For example, writing:
138+
///
139+
/// \code
140+
/// #define LMIC_CFG_SecureElement_DRIVER Foo
141+
/// LMIC_SecureElement_METHOD(LMIC_CFG_SecureElement_DRIVER, initialize)();
142+
/// \endcode
143+
///
144+
/// is the same as writing:
145+
///
146+
/// \code
147+
/// LMIC_SecureElement_Foo_initialize();
148+
/// \endcode
149+
///
150+
/// This macro is primarily intended for internal use.
151+
///
152+
/// \hideinitializer
153+
///
76154
#define LMIC_SecureElement_METHOD(a_driver, a_fn) \
77155
LMIC_SecureElement_METHOD_(a_driver, a_fn)
78156

157+
/// \cond FALSE
79158
LMIC_SecureElement_DECLARE_DRIVER_FNS(Default);
159+
/// \endcond
80160

81161
/// \copydoc LMIC_SecureElement_initialize_t
82162
static inline
@@ -200,7 +280,7 @@ LMIC_SecureElement_Error_t LMIC_ABI_STD
200280
LMIC_SecureElement_decodeMessage(
201281
const uint8_t *pPhyPayload, uint8_t nPhyPayload,
202282
uint32_t devAddr, uint32_t FCntDown,
203-
LMIC_SecureElement_KeySelector_t iKey,
283+
LMIC_SecureElement_KeySelector_t iKey,
204284
uint8_t *pClearTextBuffer
205285
) {
206286
return LMIC_SecureElement_METHOD(LMIC_CFG_SecureElement_DRIVER, decodeMessage)(

0 commit comments

Comments
 (0)