Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STM32F1xx] CAN development for STM32F1xx family #1772

Merged
merged 2 commits into from
Jun 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions hal/targets/hal/TARGET_STM/TARGET_STM32F1/PeripheralPins.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,9 @@ extern const PinMap PinMap_SPI_MISO[];
extern const PinMap PinMap_SPI_SCLK[];
extern const PinMap PinMap_SPI_SSEL[];

//*** CAN ***

extern const PinMap PinMap_CAN_RD[];
extern const PinMap PinMap_CAN_TD[];

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ typedef enum {
PWM_4 = (int)TIM4_BASE
} PWMName;

typedef enum {
CAN_1 = (int)CAN1_BASE
} CANName;

#ifdef __cplusplus
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,15 @@ const PinMap PinMap_SPI_SSEL[] = {
{PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
{NC, NC, 0}
};

const PinMap PinMap_CAN_RD[] = {
{PA_11, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
{PB_8 , CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 1)},
{NC, NC, 0}
};

const PinMap PinMap_CAN_TD[] = {
{PA_12, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 0)},
{PB_9 , CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 1)},
{NC, NC, 0}
};
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@



#define DEVICE_CAN 1

//=======================================

#define DEVICE_ID_LENGTH 24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ struct pwmout_s {
uint32_t pulse;
};

struct can_s {
CANName can;
int index;
};

#include "gpio_object.h"

#ifdef __cplusplus
Expand Down
Loading