From a7644c020c4c2b72fc0f13aeea4be47ba08f1961 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sun, 19 Jan 2025 18:45:05 +0800 Subject: Try with aliznayem C port (no luck). --- aliznayem/spi.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 aliznayem/spi.c (limited to 'aliznayem/spi.c') diff --git a/aliznayem/spi.c b/aliznayem/spi.c new file mode 100644 index 0000000..9145109 --- /dev/null +++ b/aliznayem/spi.c @@ -0,0 +1,80 @@ +/* + Copyright (c) 2007 Stefan Engelke + + 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. + + $Id$ +*/ + +#include +#include "spi.h" + +void spi_init() +// Initialize pins for spi communication +{ + SPI_DDR &= ~((1<