summaryrefslogtreecommitdiffstats
path: root/bsps/arm/imxrt/include/fsl_qtmr.h
diff options
context:
space:
mode:
authorChristian Mauderer <christian.mauderer@embedded-brains.de>2021-02-04 14:27:50 +0100
committerChristian Mauderer <oss@c-mauderer.de>2021-03-21 12:30:29 +0100
commit65ab1cda10f26935cad2ba01426077079cd96af3 (patch)
tree810cb7ce137a3afc235ce6a5ebe8c5d8126a9b8c /bsps/arm/imxrt/include/fsl_qtmr.h
parentrtems: Relax mode checks in rtems_signal_catch() (diff)
downloadrtems-65ab1cda10f26935cad2ba01426077079cd96af3.tar.bz2
bsps/arm/imxrt: Add FDT and FDT helper for QTMR
Makes it simpler to access the QTMR in an application via a FDT name or link in an application specific FDT entry.
Diffstat (limited to 'bsps/arm/imxrt/include/fsl_qtmr.h')
-rw-r--r--bsps/arm/imxrt/include/fsl_qtmr.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/bsps/arm/imxrt/include/fsl_qtmr.h b/bsps/arm/imxrt/include/fsl_qtmr.h
index 589b9c3597..a675413f8d 100644
--- a/bsps/arm/imxrt/include/fsl_qtmr.h
+++ b/bsps/arm/imxrt/include/fsl_qtmr.h
@@ -8,6 +8,9 @@
#define _FSL_QTMR_H_
#include "fsl_common.h"
+#ifdef __rtems__
+#include <rtems.h>
+#endif /* __rtems__ */
/*!
* @addtogroup qtmr
@@ -177,6 +180,37 @@ extern "C" {
* @name Initialization and deinitialization
* @{
*/
+#ifdef __rtems__
+/*!
+ * @brief Return the timer base based on a FDT node.
+ *
+ * @param fdt Pointer to the fdt
+ * @param node The FDT node
+ *
+ * @return Pointer to the timer. NULL on error (for example if node isn't
+ * compatible).
+ */
+TMR_Type *QTMR_get_regs_from_fdt(const void *fdt, int node);
+
+/*!
+ * @brief Return the timer IRQ vector based on a FDT node.
+ *
+ * @param fdt Pointer to the fdt
+ * @param node The FDT node
+ *
+ * @return IRQ vector number. BSP_INTERRUPT_VECTOR_INVALID on error.
+ */
+rtems_vector_number QTMR_get_IRQ_from_fdt(const void *fdt, int node);
+
+/*!
+ * @brief Return the clock source frequency of the quad timer.
+ *
+ * @param base Quad Timer peripheral base address.
+ *
+ * @return IRQ vector number. BSP_INTERRUPT_VECTOR_INVALID on error.
+ */
+uint32_t QTMR_get_src_clk(TMR_Type *base);
+#endif /* __rtems__ */
/*!
* @brief Ungates the Quad Timer clock and configures the peripheral for basic operation.