[DISCO_F469NI] Added CAN support

Added CAN API support for DISCO_F469NI target.

Change-Id: Icfc52ec532aa71412814f245b41494fa69df4430
pull/1771/head
Bartosz Szczepanski 2016-04-27 08:32:36 +02:00
parent 96787cd79e
commit ce781448b7
8 changed files with 35 additions and 5 deletions

View File

@ -91,6 +91,11 @@ typedef enum {
PWM_14 = (int)TIM14_BASE
} PWMName;
typedef enum {
CAN_1 = (int)CAN1_BASE,
CAN_2 = (int)CAN2_BASE
} CANName;
#ifdef __cplusplus
}
#endif

View File

@ -301,3 +301,13 @@ const PinMap PinMap_SPI_SSEL[] = {
{PI_0, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
{NC, NC, 0}
};
const PinMap PinMap_CAN_RD[] = {
{PB_8 , CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
{NC, NC, 0}
};
const PinMap PinMap_CAN_TD[] = {
{PB_9 , CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
{NC, NC, 0}
};

View File

@ -54,6 +54,8 @@
#define DEVICE_SLEEP 1
#define DEVICE_CAN 1
//=======================================
#define DEVICE_SEMIHOST 0

View File

@ -104,6 +104,11 @@ struct pwmout_s {
uint8_t inverted;
};
struct can_s {
CANName can;
int index;
};
#include "gpio_object.h"
#ifdef __cplusplus

View File

@ -19,6 +19,8 @@ CAN can1(PD_0, PD_1);
defined(TARGET_NUCLEO_F303RE) || defined(TARGET_NUCLEO_F303K8) || \
defined(TARGET_NUCLEO_F302R8) || defined(TARGET_NUCLEO_F446RE)
CAN can1(PA_11, PA_12);
#elif defined(TARGET_DISCO_F469NI)
CAN can1(PB_8, PB_9);
#else
CAN can1(p9, p10);
#endif
@ -27,7 +29,7 @@ CAN can1(p9, p10);
CAN can2(p34, p33);
#elif defined (TARGET_LPC1768)
CAN can2(p30, p29);
#elif defined(TARGET_NUCLEO_F446RE)
#elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_DISCO_F469NI)
CAN can2(PB_5, PB_6);
#endif
char counter = 0;

View File

@ -19,6 +19,8 @@ CAN can1(PD_0, PD_1);
defined(TARGET_NUCLEO_F303RE) || defined(TARGET_NUCLEO_F303K8) || \
defined(TARGET_NUCLEO_F302R8) || defined(TARGET_NUCLEO_F446RE)
CAN can1(PA_11, PA_12);
#elif defined(TARGET_DISCO_F469NI)
CAN can1(PB_8, PB_9);
#else
CAN can1(p9, p10);
#endif
@ -27,7 +29,7 @@ CAN can1(p9, p10);
CAN can2(p34, p33);
#elif defined (TARGET_LPC1768)
CAN can2(p30, p29);
#elif defined(TARGET_NUCLEO_F446RE)
#elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_DISCO_F469NI)
CAN can2(PB_5, PB_6);
#endif
char counter = 0;

View File

@ -18,6 +18,8 @@ CAN can1(P5_9, P5_10);
defined(TARGET_NUCLEO_F303RE) || defined(TARGET_NUCLEO_F303K8) || \
defined(TARGET_NUCLEO_F302R8) || defined(TARGET_NUCLEO_F446RE)
CAN can1(PA_11, PA_12);
#elif defined(TARGET_DISCO_F469NI)
CAN can1(PB_8, PB_9);
#endif
#define TEST_ITERATIONS 127

View File

@ -99,6 +99,7 @@ Wiring:
* NUCLEO_F303K8: (RX=PA_11, TX=PA_12)
* NUCLEO_F302R8: (RX=PA_11, TX=PA_12)
* NUCLEO_F446RE: (RX=PA_11, TX=PA_12)
* DISCO_F469NI: (RX=PB_8, TX=PB_9)
"""
TESTS = [
@ -306,7 +307,8 @@ TESTS = [
"peripherals": ["can_transceiver"],
"mcu": ["LPC1549", "LPC1768","B96B_F446VE", "VK_RZ_A1H",
"NUCLEO_F091RC", "NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8",
"NUCLEO_F303RE", "NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE"],
"NUCLEO_F303RE", "NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE",
"DISCO_F469NI"],
},
{
"id": "MBED_BLINKY", "description": "Blinky",
@ -579,7 +581,7 @@ TESTS = [
"dependencies": [MBED_LIBRARIES],
"mcu": ["LPC1768", "LPC4088", "LPC1549", "RZ_A1H", "B96B_F446VE", "NUCLEO_F091RC",
"NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8", "NUCLEO_F303RE",
"NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE"]
"NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE", "DISCO_F469NI"]
},
{
"id": "MBED_30", "description": "CAN network test using interrupts",
@ -587,7 +589,7 @@ TESTS = [
"dependencies": [MBED_LIBRARIES],
"mcu": ["LPC1768", "LPC4088", "LPC1549", "RZ_A1H", "B96B_F446VE", "NUCLEO_F091RC",
"NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8", "NUCLEO_F303RE",
"NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE"]
"NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE", "DISCO_F469NI"]
},
{
"id": "MBED_31", "description": "PWM LED test",