stm32/can: add 'shift' defines for can timing bits
Useful whe you want to return min/max values of timing parameters
This commit is contained in:
parent
f80bf1ccb1
commit
7e9b79aa55
@ -417,6 +417,7 @@
|
|||||||
#define CAN_BTR_SJW_3TQ (0x2 << 24)
|
#define CAN_BTR_SJW_3TQ (0x2 << 24)
|
||||||
#define CAN_BTR_SJW_4TQ (0x3 << 24)
|
#define CAN_BTR_SJW_4TQ (0x3 << 24)
|
||||||
#define CAN_BTR_SJW_MASK (0x3 << 24)
|
#define CAN_BTR_SJW_MASK (0x3 << 24)
|
||||||
|
#define CAN_BTR_SJW_SHIFT 24
|
||||||
|
|
||||||
/* 23 Reserved, forced by hardware to 0 */
|
/* 23 Reserved, forced by hardware to 0 */
|
||||||
|
|
||||||
@ -430,6 +431,7 @@
|
|||||||
#define CAN_BTR_TS2_7TQ (0x6 << 20)
|
#define CAN_BTR_TS2_7TQ (0x6 << 20)
|
||||||
#define CAN_BTR_TS2_8TQ (0x7 << 20)
|
#define CAN_BTR_TS2_8TQ (0x7 << 20)
|
||||||
#define CAN_BTR_TS2_MASK (0x7 << 20)
|
#define CAN_BTR_TS2_MASK (0x7 << 20)
|
||||||
|
#define CAN_BTR_TS2_SHIFT 20
|
||||||
|
|
||||||
/* TS1[3:0]: Time segment 1 */
|
/* TS1[3:0]: Time segment 1 */
|
||||||
#define CAN_BTR_TS1_1TQ (0x0 << 16)
|
#define CAN_BTR_TS1_1TQ (0x0 << 16)
|
||||||
@ -449,6 +451,7 @@
|
|||||||
#define CAN_BTR_TS1_15TQ (0xE << 16)
|
#define CAN_BTR_TS1_15TQ (0xE << 16)
|
||||||
#define CAN_BTR_TS1_16TQ (0xF << 16)
|
#define CAN_BTR_TS1_16TQ (0xF << 16)
|
||||||
#define CAN_BTR_TS1_MASK (0xF << 16)
|
#define CAN_BTR_TS1_MASK (0xF << 16)
|
||||||
|
#define CAN_BTR_TS1_SHIFT 16
|
||||||
|
|
||||||
/* 15:10 Reserved, forced by hardware to 0 */
|
/* 15:10 Reserved, forced by hardware to 0 */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user