mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-13 06:55:31 +08:00
[BSP][ls1c]Add can driver and lib
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* File : bxcan.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-01-06 sundm75 first version
|
||||
*/
|
||||
|
||||
#ifndef LS1C_DRV_CAN_H
|
||||
#define LS1C_DRV_CAN_H
|
||||
|
||||
extern int ls1c_bxcan_init(void);
|
||||
|
||||
#endif /*DRV_CAN_H_*/
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
// 龙芯1c外设寄存器
|
||||
// 龙芯1c外设寄存器
|
||||
|
||||
|
||||
#ifndef __OPENLOONGSON_LS1C_REGS_H
|
||||
@@ -7,12 +7,12 @@
|
||||
|
||||
|
||||
|
||||
// 时钟相关寄存器地址
|
||||
// 时钟相关寄存器地址
|
||||
#define LS1C_START_FREQ (0xbfe78030)
|
||||
#define LS1C_CLK_DIV_PARAM (0xbfe78034)
|
||||
|
||||
|
||||
// gpio相关寄存器地址
|
||||
// gpio相关寄存器地址
|
||||
#define LS1C_GPIO_CFG0 (0xbfd010c0)
|
||||
#define LS1C_GPIO_EN0 (0xbfd010d0)
|
||||
#define LS1C_GPIO_IN0 (0xbfd010e0)
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
|
||||
|
||||
// 复用相关寄存器
|
||||
// 复用相关寄存器
|
||||
#define LS1C_CBUS_FIRST0 (0xbfd011c0)
|
||||
#define LS1C_CBUS_SECOND0 (0xbfd011d0)
|
||||
#define LS1C_CBUS_THIRD0 (0xbfd011e0)
|
||||
@@ -61,20 +61,22 @@
|
||||
#define LS1C_CBUS_FIFTH3 (0xbfd0120c)
|
||||
|
||||
|
||||
// PWM寄存器偏移
|
||||
// PWM寄存器偏移
|
||||
#define LS1C_PWM_CNTR (0x0)
|
||||
#define LS1C_PWM_HRC (0x4)
|
||||
#define LS1C_PWM_LRC (0x8)
|
||||
#define LS1C_PWM_CTRL (0xC)
|
||||
// PWM基地址
|
||||
// PWM基地址
|
||||
#define LS1C_REG_BASE_PWM0 (0xbfe5c000)
|
||||
#define LS1C_REG_BASE_PWM1 (0xbfe5c010)
|
||||
#define LS1C_REG_BASE_PWM2 (0xbfe5c020)
|
||||
#define LS1C_REG_BASE_PWM3 (0xbfe5c030)
|
||||
|
||||
//CAN基地址
|
||||
#define LS1C_REG_BASE_CAN0 (0xbfe50000)
|
||||
#define LS1C_REG_BASE_CAN1 (0xbfe54000)
|
||||
|
||||
|
||||
// 中断配置寄存器
|
||||
// 中断配置寄存器
|
||||
#define LS1C_INT0_SR (0xbfd01040)
|
||||
#define LS1C_INT0_EN (0xbfd01044)
|
||||
#define LS1C_INT0_SET (0xbfd01048)
|
||||
@@ -111,18 +113,18 @@
|
||||
#define LS1C_INT4_EDGE (0xbfd010b4)
|
||||
|
||||
|
||||
// I2C寄存器
|
||||
// I2C寄存器
|
||||
#define LS1C_I2C0_BASE (0xbfe58000)
|
||||
#define LS1C_I2C1_BASE (0xbfe68000)
|
||||
#define LS1C_I2C2_BASE (0xbfe70000)
|
||||
|
||||
|
||||
// SPI寄存器
|
||||
// SPI寄存器
|
||||
#define LS1C_SPI0_BASE (0xbfe80000)
|
||||
#define LS1C_SPI1_BASE (0xbfec0000)
|
||||
|
||||
|
||||
// 串口寄存器
|
||||
// 串口寄存器
|
||||
#define LS1C_UART0_BASE (0xbfe40000)
|
||||
#define LS1C_UART1_BASE (0xbfe44000)
|
||||
#define LS1C_UART2_BASE (0xbfe48000)
|
||||
|
||||
Reference in New Issue
Block a user