diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-20 03:37:29 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-20 03:37:29 +0000 |
commit | a89135e23145cd538db501fd5c8b60bc2fcd4cb3 (patch) | |
tree | 11ea8443de9bdfb86fca51e6aef9c480a3af7ae2 /nuttx/arch/arm/src/stm32/stm32_can.h | |
parent | 77c6594eb257557db6111945a3354ded40e41858 (diff) | |
download | px4-nuttx-a89135e23145cd538db501fd5c8b60bc2fcd4cb3.tar.gz px4-nuttx-a89135e23145cd538db501fd5c8b60bc2fcd4cb3.tar.bz2 px4-nuttx-a89135e23145cd538db501fd5c8b60bc2fcd4cb3.zip |
Leverage some bit timing logic from LPC17xx to the STM32 CAN driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4317 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/stm32/stm32_can.h')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_can.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_can.h b/nuttx/arch/arm/src/stm32/stm32_can.h index b842627b8..15203b5c9 100644 --- a/nuttx/arch/arm/src/stm32/stm32_can.h +++ b/nuttx/arch/arm/src/stm32/stm32_can.h @@ -73,6 +73,29 @@ # error "CONFIG_CAN2_BAUD is not defined" #endif +/* User-defined TSEG1 and TSEG2 settings may be used. + * + * CONFIG_CAN_TSEG1 = the number of CAN time quanta in segment 1 + * CONFIG_CAN_TSEG2 = the number of CAN time quanta in segment 2 + * CAN_BIT_QUANTA = The number of CAN time quanta in on bit time + */ + +#ifndef CONFIG_CAN_TSEG1 +# define CONFIG_CAN_TSEG1 6 +#endif + +#if CONFIG_CAN_TSEG1 < 1 || CONFIG_CAN_TSEG1 > CAN_BTR_TSEG1_MAX +# errror "CONFIG_CAN_TSEG1 is out of range" +#endif + +#ifndef CONFIG_CAN_TSEG2 +# define CONFIG_CAN_TSEG2 7 +#endif + +#if CONFIG_CAN_TSEG2 < 1 || CONFIG_CAN_TSEG2 > CAN_BTR_TSEG2_MAX +# errror "CONFIG_CAN_TSEG2 is out of range" +#endif + /************************************************************************************ * Public Types ************************************************************************************/ |