Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of CANnucleo by
Revision 1:eb04f7f0478d, committed 2015-07-19
- Comitter:
- hudakz
- Date:
- Sun Jul 19 14:04:31 2015 +0000
- Parent:
- 0:e29bc8e0dddd
- Child:
- 2:09a0d2838572
- Commit message:
- rev 01
Changed in this revision
--- a/can_api.c Sun Jul 19 09:06:26 2015 +0000
+++ b/can_api.c Sun Jul 19 14:04:31 2015 +0000
@@ -1,15 +1,13 @@
/*
can_api.c for STMicroelectronics mbed boards equipped with Controller Area Network interface:
- NUCLEO-F070RB
NUCLEO-F072RB
+ NUCLEO-F091RC
NUCLEO-F103RB
NUCLEO-F302R8
+ NUCLEO-F303RE
NUCLEO-F334R8
- NUCLEO-F303RE
- NUCLEO-F091RC
DISCO-F334C8
- DISCO-F746NG
Copyright (c) 2015 Zoltan Hudak <hudakz@inbox.com>
All rights reserved.
@@ -63,15 +61,12 @@
* @retval
*/
int can_frequency(can_t* obj, int hz) {
-
- /* Disable the NVIC for CAN reception */
-
HAL_NVIC_DisableIRQ(USB_LP_CAN1_RX0_IRQn);
#if defined(TARGET_NUCLEO_F103RB) || \
defined(TARGET_NUCLEO_F302R8) || \
+ defined(TARGET_NUCLEO_F303RE) || \
defined(TARGET_NUCLEO_F334R8) || \
- defined(TARGET_NUCLEO_F303RE) || \
defined(TARGET_DISCO_F334C8)
// APB1 pheripheral clock = 36000000Hz
@@ -118,8 +113,7 @@
_canHandle.Init.BS2 = CAN_BS2_4TQ;
}
-#elif defined(TARGET_NUCLEO_F070RB) || \
- defined(TARGET_NUCLEO_F072RB) || \
+#elif defined(TARGET_NUCLEO_F072RB) || \
defined(TARGET_NUCLEO_F091RC)
// APB1 pheripheral clock = 48000000Hz
@@ -198,10 +192,6 @@
* @param
* @retval
*/
-//void can_irq_set(can_t* obj, CanIrqType irq, uint32_t enable)
-//{
-
-//}
void can_irq_set(void (*fptr) (void)) {
rxCompleteCallback = fptr;
}
@@ -351,3 +341,4 @@
// not implemented
}
+
--- a/stm32f1xx_hal_msp.c Sun Jul 19 09:06:26 2015 +0000
+++ b/stm32f1xx_hal_msp.c Sun Jul 19 14:04:31 2015 +0000
@@ -76,16 +76,15 @@
// 125kbps bit rate (default)
#if defined(TARGET_NUCLEO_F103RB) || \
defined(TARGET_NUCLEO_F302R8) || \
+ defined(TARGET_NUCLEO_F303RE) || \
defined(TARGET_NUCLEO_F334R8) || \
- defined(TARGET_NUCLEO_F303RE) || \
defined(TARGET_DISCO_F334C8)
// APB1 pheripheral clock = 36000000Hz
_canHandle.Init.Prescaler = 18; // number of time quanta = 36000000/18/125000 = 16
_canHandle.Init.SJW = CAN_SJW_1TQ;
_canHandle.Init.BS1 = CAN_BS1_11TQ; // sample point at (1 + 11) / 16 * 100 = 75%
_canHandle.Init.BS2 = CAN_BS2_4TQ;
-#elif defined(TARGET_NUCLEO_F070RB) || \
- defined(TARGET_NUCLEO_F072RB) || \
+#elif defined(TARGET_NUCLEO_F072RB) || \
defined(TARGET_NUCLEO_F091RC)
// APB1 pheripheral clock = 48000000Hz
_canHandle.Init.Prescaler = 24; // number of time quanta = 48000000/24/125000 = 16
--- a/stm32f1xx_hal_msp.h Sun Jul 19 09:06:26 2015 +0000 +++ b/stm32f1xx_hal_msp.h Sun Jul 19 14:04:31 2015 +0000 @@ -36,9 +36,6 @@ #ifndef stm32f1xx_hal_H #define stm32f1xx_hal_H -//#include "stm32f1xx_hal.h" -//#include "can_api.h" -//#include "can_helper.h" #include "pinmap.h" typedef struct can_s can_t;
