Commit 6e8e28dc authored by Papy's avatar Papy

library/boards/brain: add canbus declarations

parent a82f28c9
......@@ -11,6 +11,10 @@
CONFIG_NET_ETHERNET
%end
%subsection canbus
CONFIG_DRIVER_STM32_CANBUS
%end
%section bmaaa-pinky
%inherit nrf51-xxac
......
......@@ -27,6 +27,7 @@
#include <device/class/iomux.h>
#include <device/class/uart.h>
#include <device/class/timer.h>
#include <device/class/canbus.h>
#include <arch/stm32/irq.h>
#include <arch/stm32/mmap.h>
......@@ -126,6 +127,27 @@ DEV_DECLARE_STATIC(dwc10100_dev, "eth0", 0, dwc10100_drv,
);
#endif
#if defined(CONFIG_DRIVER_STM32_CANBUS)
/* CAN bus controller */
DEV_DECLARE_STATIC(canbus_dev, "canbus1", 0, stm32_canbus_drv,
DEV_STATIC_RES_MEM(STM32_BXCAN_ADDR, STM32_BXCAN_ADDR + STM32_BXCAN_SIZE),
DEV_STATIC_RES_FREQ(36000000, 1),
DEV_STATIC_RES_DEV_ICU("/cpu"),
DEV_STATIC_RES_IRQ(0, STM32_IRQ_CAN1_RX0, DEV_IRQ_SENSE_HIGH_LEVEL, 0, 0x1),
DEV_STATIC_RES_IRQ(1, STM32_IRQ_CAN1_RX1, DEV_IRQ_SENSE_HIGH_LEVEL, 0, 0x1),
DEV_STATIC_RES_IRQ(2, STM32_IRQ_CAN1_TX, DEV_IRQ_SENSE_HIGH_LEVEL, 0, 0x1),
DEV_STATIC_RES_IRQ(3, STM32_IRQ_CAN1_SCE, DEV_IRQ_SENSE_HIGH_LEVEL, 0, 0x1),
DEV_STATIC_RES_DEV_IOMUX("/gpio"),
DEV_STATIC_RES_IOMUX("rx", 0, STM32_PD0, 0, 0),
DEV_STATIC_RES_IOMUX("tx", 0, STM32_PD1, 0, 0),
DEV_STATIC_RES_CANBUS_INFO(500000 /* 500kbps */, 2 /* meters */)
);
#endif
#include <hexo/endian.h>
#include <hexo/iospace.h>
#include <arch/stm32/f1/rcc.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment