aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/SAMA/LLD/SDMMCv1/ch_sdmmc_macros.h
diff options
context:
space:
mode:
authorareviu <areviu.info@gmail.com>2018-01-07 11:28:07 +0000
committerareviu <areviu.info@gmail.com>2018-01-07 11:28:07 +0000
commit5a733a0d43e0b37f6ff63bab0f3c3084e8b219cb (patch)
treed2ecbd60f3ac9646abb7f2770836c79a27cdc568 /os/hal/ports/SAMA/LLD/SDMMCv1/ch_sdmmc_macros.h
parent6b741c1eb4e8c25d1421ff1abe61b57341a3c8fd (diff)
downloadChibiOS-5a733a0d43e0b37f6ff63bab0f3c3084e8b219cb.tar.gz
ChibiOS-5a733a0d43e0b37f6ff63bab0f3c3084e8b219cb.tar.bz2
ChibiOS-5a733a0d43e0b37f6ff63bab0f3c3084e8b219cb.zip
first draft. initialization working
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11231 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/SAMA/LLD/SDMMCv1/ch_sdmmc_macros.h')
-rw-r--r--os/hal/ports/SAMA/LLD/SDMMCv1/ch_sdmmc_macros.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/os/hal/ports/SAMA/LLD/SDMMCv1/ch_sdmmc_macros.h b/os/hal/ports/SAMA/LLD/SDMMCv1/ch_sdmmc_macros.h
new file mode 100644
index 000000000..52f82fd03
--- /dev/null
+++ b/os/hal/ports/SAMA/LLD/SDMMCv1/ch_sdmmc_macros.h
@@ -0,0 +1,29 @@
+#ifndef CH_SDMMC_MACROS_H_
+#define CH_SDMMC_MACROS_H_
+
+
+
+#define CACHE_ALIGNED __attribute__((aligned(L1_CACHE_BYTES)))
+
+
+#define IS_CACHE_ALIGNED(x) ((((uint32_t)(x)) & (L1_CACHE_BYTES - 1)) == 0)
+#define ROUND_INT_DIV(n,d) (((n) + ((d)-1)) / (d))
+#define ROUND_UP_MULT(x,m) (((x) + ((m)-1)) & ~((m)-1))
+#define CEIL_INT_DIV(n,d) (((n) + (d) - 1) / (d))
+#define ABS_DIFF(a,b) ((a) < (b) ? (b) - (a) : (a) - (b))
+#define ARRAY_SIZE(x) (sizeof ((x)) / sizeof(*(x)))
+
+#define _PrintTitle(s) TRACE(s)
+#define _PrintField(f,v) TRACE_1(f,v)
+
+static inline uint32_t max_u32(uint32_t a, uint32_t b)
+{
+ return a > b ? a : b;
+}
+
+static inline uint32_t min_u32(uint32_t a, uint32_t b)
+{
+ return a < b ? a : b;
+}
+
+#endif /* CH_SDMMC_MACROS_H_ */