aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Ciesielski2012-10-31 17:01:56 -0700
committerJeff Ciesielski2012-10-31 17:01:56 -0700
commit7e9b79aa55875b636e690ddf6f9ec2ac7aebf786 (patch)
tree0e89a6d98c40963572f9ff76887596e4e057ae45
parentf80bf1ccb107e2ad54d7d8ac586e9ffd09e8730e (diff)
stm32/can: add 'shift' defines for can timing bits
Useful whe you want to return min/max values of timing parameters
-rw-r--r--include/libopencm3/stm32/can.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libopencm3/stm32/can.h b/include/libopencm3/stm32/can.h
index f787df7..1919da4 100644
--- a/include/libopencm3/stm32/can.h
+++ b/include/libopencm3/stm32/can.h
@@ -417,6 +417,7 @@
#define CAN_BTR_SJW_3TQ (0x2 << 24)
#define CAN_BTR_SJW_4TQ (0x3 << 24)
#define CAN_BTR_SJW_MASK (0x3 << 24)
+#define CAN_BTR_SJW_SHIFT 24
/* 23 Reserved, forced by hardware to 0 */
@@ -430,6 +431,7 @@
#define CAN_BTR_TS2_7TQ (0x6 << 20)
#define CAN_BTR_TS2_8TQ (0x7 << 20)
#define CAN_BTR_TS2_MASK (0x7 << 20)
+#define CAN_BTR_TS2_SHIFT 20
/* TS1[3:0]: Time segment 1 */
#define CAN_BTR_TS1_1TQ (0x0 << 16)
@@ -449,6 +451,7 @@
#define CAN_BTR_TS1_15TQ (0xE << 16)
#define CAN_BTR_TS1_16TQ (0xF << 16)
#define CAN_BTR_TS1_MASK (0xF << 16)
+#define CAN_BTR_TS1_SHIFT 16
/* 15:10 Reserved, forced by hardware to 0 */