4
4
* SPDX-License-Identifier: Apache-2.0
5
5
*/
6
6
7
+ /**
8
+ * @file
9
+ * @brief Header file for NXP FlexIO driver
10
+ * @ingroup nxp_flexio_interface
11
+ */
12
+
7
13
#ifndef ZEPHYR_DRIVERS_MISC_NXP_FLEXIO_NXP_FLEXIO_H_
8
14
#define ZEPHYR_DRIVERS_MISC_NXP_FLEXIO_NXP_FLEXIO_H_
9
15
16
+ /**
17
+ * @brief NXP FlexIO driver APIs
18
+ * @defgroup nxp_flexio_interface NXP FlexIO driver APIs
19
+ * @ingroup misc_interfaces
20
+ *
21
+ * @{
22
+ */
23
+
10
24
#include <zephyr/device.h>
11
25
12
26
/**
13
- * @struct nxp_flexio_child_res
14
- * @brief Structure containing information about the required
15
- * resources for a FlexIO child.
27
+ * @brief Structure containing information about the required resources for a FlexIO child.
16
28
*/
17
29
struct nxp_flexio_child_res {
30
+ /** Output array where assigned shifter indices are stored.
31
+ *
32
+ * Must point to an array with at least @ref shifter_count entries. Values are 0-based
33
+ * hardware indices valid for the bound FlexIO.
34
+ */
18
35
uint8_t * shifter_index ;
36
+ /** Number of shifter indices required by the child. */
19
37
uint8_t shifter_count ;
38
+ /** Output array where assigned timer indices are stored.
39
+ *
40
+ * Must point to an array with at least @ref timer_count entries. Values are 0-based
41
+ * hardware indices valid for the bound FlexIO.
42
+ */
20
43
uint8_t * timer_index ;
44
+ /** Number of timer indices required by the child. */
21
45
uint8_t timer_count ;
22
46
};
23
47
24
48
/**
25
49
* @typedef nxp_flexio_child_isr_t
26
50
* @brief Callback API to inform API user that FlexIO triggered interrupt
27
51
*
28
- * This callback is called from IRQ context.
52
+ * The controller calls this from IRQ context whenever one of the child's mapped shifters or timers
53
+ * has a pending and enabled interrupt.
54
+ *
55
+ * @param user_data Opaque pointer provided at attachment time.
29
56
*/
30
57
typedef int (* nxp_flexio_child_isr_t )(void * user_data );
31
58
@@ -34,8 +61,13 @@ typedef int (*nxp_flexio_child_isr_t)(void *user_data);
34
61
* @brief Structure containing the required child data for FlexIO
35
62
*/
36
63
struct nxp_flexio_child {
64
+ /** ISR called from the FlexIO controller's IRQ handler.
65
+ * May be @c NULL if the child does not require IRQ notifications.
66
+ */
37
67
nxp_flexio_child_isr_t isr ;
68
+ /** Opaque pointer passed to @ref isr function when it is invoked. */
38
69
void * user_data ;
70
+ /** Resource requirements and output indices filled by nxp_flexio_child_attach(). */
39
71
struct nxp_flexio_child_res res ;
40
72
};
41
73
@@ -85,4 +117,8 @@ int nxp_flexio_get_rate(const struct device *dev, uint32_t *rate);
85
117
int nxp_flexio_child_attach (const struct device * dev ,
86
118
const struct nxp_flexio_child * child );
87
119
120
+ /**
121
+ * @}
122
+ */
123
+
88
124
#endif /* ZEPHYR_DRIVERS_MISC_NXP_FLEXIO_NXP_FLEXIO_H_ */
0 commit comments