From b45437a2f82dc43c38fc9412cf27bee24dd4da63 Mon Sep 17 00:00:00 2001 From: sidney Date: Tue, 31 Oct 2023 10:40:43 +0800 Subject: [PATCH] rename as mcp canbus, prepare to publish to library index --- LICENSE | 21 +++++++++++ README.md | 36 ++++--------------- examples/OBDII_PIDs/getRpm/getRpm.ino | 2 +- examples/OBDII_PIDs/getSpeed/getSpeed.ino | 2 +- examples/recv/recv.ino | 2 +- examples/send/send.ino | 2 +- .../set_mask_filter_recv.ino | 5 +-- .../set_mask_filter_send.ino | 2 +- library.properties | 4 +-- mcp_can.cpp => mcp_canbus.cpp | 2 +- mcp_can.h => mcp_canbus.h | 0 11 files changed, 36 insertions(+), 42 deletions(-) create mode 100644 LICENSE rename mcp_can.cpp => mcp_canbus.cpp (96%) rename mcp_can.h => mcp_canbus.h (100%) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d1cb698 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 @ Longan Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index dd7956e..1977fd6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # CAN Bus Library - -[![Actions Status](https://github.com/arduino/arduino-cli-example/workflows/test/badge.svg)](https://github.com/arduino/arduino-cli-example/actions) -[![Spell Check](https://github.com/arduino/compile-sketches/workflows/Spell%20Check/badge.svg)](https://github.com/arduino/compile-sketches/actions?workflow=Spell+Check) -[![codecov](https://codecov.io/gh/arduino/compile-sketches/branch/main/graph/badge.svg?token=Uv6f1ebMZ4)](https://codecov.io/gh/arduino/compile-sketches) +[![GitHub](https://img.shields.io/github/license/Longan-Labs/Arduino_CAN_BUS_MCP2515)](https://github.com/Longan-Labs/Arduino_CAN_BUS_MCP2515/blob/master/LICENSE) +[![Installation instructions](https://www.ardu-badge.com/badge/mcp_canbus.svg?)](https://www.ardu-badge.com/mcp_canbus) +[![GitHub version](https://img.shields.io/github/release/Longan-Labs/Arduino_CAN_BUS_MCP2515.svg?logo=github&logoColor=ffffff)](https://github.com/Longan-Labs/Arduino_CAN_BUS_MCP2515/releases/latest) +[![GitHub Release Date](https://img.shields.io/github/release-date/Longan-Labs/Arduino_CAN_BUS_MCP2515.svg?logo=github&logoColor=ffffff)](https://github.com/Longan-Labs/Arduino_CAN_BUS_MCP2515/releases/latest) +[![GitHub Repo stars](https://img.shields.io/github/stars/Longan-Labs/Arduino_CAN_BUS_MCP2515?logo=github&logoColor=ffffff)](https://github.com/Longan-Labs/Arduino_CAN_BUS_MCP2515/stargazers) +[![GitHub issues](https://img.shields.io/github/issues/Longan-Labs/Arduino_CAN_BUS_MCP2515.svg?logo=github&logoColor=ffffff)](https://github.com/Longan-Labs/Arduino_CAN_BUS_MCP2515/issues) Arduino library for MCP2515, it's available for most of theArduino boards, we test it with Arduino UNO, Leonardo, Mega as well as Zero. @@ -119,32 +121,6 @@ If you need a Dev board, plese try, - [CANBed M0](https://www.longan-labs.cc/1030014.html) - [OBD-II CAN Bus GPS Dev Kit](https://www.longan-labs.cc/1030003.html) -## License - -``` -MIT License - -Copyright (c) 2018 @ Longan Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -``` - ## Contact us If you have any question, please feel free to contact [support@longan-labs.cc](support@longan-labs.cc) diff --git a/examples/OBDII_PIDs/getRpm/getRpm.ino b/examples/OBDII_PIDs/getRpm/getRpm.ino index 1324a7f..6519150 100644 --- a/examples/OBDII_PIDs/getRpm/getRpm.ino +++ b/examples/OBDII_PIDs/getRpm/getRpm.ino @@ -13,7 +13,7 @@ ***************************************************************************************************/ #include -#include "mcp_can.h" +#include /* Please modify SPI_CS_PIN to adapt to your board. diff --git a/examples/OBDII_PIDs/getSpeed/getSpeed.ino b/examples/OBDII_PIDs/getSpeed/getSpeed.ino index faf1227..db00d72 100644 --- a/examples/OBDII_PIDs/getSpeed/getSpeed.ino +++ b/examples/OBDII_PIDs/getSpeed/getSpeed.ino @@ -13,7 +13,7 @@ ***************************************************************************************************/ #include -#include "mcp_can.h" +#include /* Please modify SPI_CS_PIN to adapt to your board. diff --git a/examples/recv/recv.ino b/examples/recv/recv.ino index 06e357c..fb2a80e 100644 --- a/examples/recv/recv.ino +++ b/examples/recv/recv.ino @@ -28,7 +28,7 @@ */ #include -#include "mcp_can.h" +#include /* Please modify SPI_CS_PIN to adapt to your board. diff --git a/examples/send/send.ino b/examples/send/send.ino index 17063a4..930c29f 100644 --- a/examples/send/send.ino +++ b/examples/send/send.ino @@ -22,7 +22,7 @@ #define CAN_1000KBPS 18 */ -#include +#include #include /* Please modify SPI_CS_PIN to adapt to your board. diff --git a/examples/set_mask_filter_recv/set_mask_filter_recv.ino b/examples/set_mask_filter_recv/set_mask_filter_recv.ino index 2ae3c47..bce6dec 100644 --- a/examples/set_mask_filter_recv/set_mask_filter_recv.ino +++ b/examples/set_mask_filter_recv/set_mask_filter_recv.ino @@ -28,10 +28,7 @@ */ #include -#include "mcp_can.h" - -#include -#include "mcp_can.h" +#include /* Please modify SPI_CS_PIN to adapt to your board. diff --git a/examples/set_mask_filter_send/set_mask_filter_send.ino b/examples/set_mask_filter_send/set_mask_filter_send.ino index 6f70034..4e02f47 100644 --- a/examples/set_mask_filter_send/set_mask_filter_send.ino +++ b/examples/set_mask_filter_send/set_mask_filter_send.ino @@ -28,7 +28,7 @@ OBD-II CAN Bus GPS Dev Kit: https://www.longan-labs.cc/1030003.html */ -#include +#include #include /* Please modify SPI_CS_PIN to adapt to your board. diff --git a/library.properties b/library.properties index 26efd37..2e27dd8 100644 --- a/library.properties +++ b/library.properties @@ -1,9 +1,9 @@ -name=Arduino CAN Bus Library for MCP2515 +name=mcp_canbus version=1.0.0 author=Longan Labs maintainer=Longan Labs sentence=A library for MCP2515 paragraph=Arduino CAN Bus Library for MCP2515 -category=CAN Bus +category=Communication url=https://github.com/Longan-Labs/Aruino_CAN_BUS_MCP2515 architectures=* diff --git a/mcp_can.cpp b/mcp_canbus.cpp similarity index 96% rename from mcp_can.cpp rename to mcp_canbus.cpp index dbb21d1..4a6da95 100644 --- a/mcp_can.cpp +++ b/mcp_canbus.cpp @@ -41,7 +41,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "mcp_can.h" +#include "mcp_canbus.h" #define spi_readwrite SPI.transfer #define spi_read() spi_readwrite(0x00) diff --git a/mcp_can.h b/mcp_canbus.h similarity index 100% rename from mcp_can.h rename to mcp_canbus.h