Skip to content
Snippets Groups Projects
Commit 60af705e authored by Scott Lahteine's avatar Scott Lahteine
Browse files

Relocate SPI.h to the HAL folder

parent 46aae4c6
Branches
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#ifndef _HAL_H #ifndef _HAL_H
#define _HAL_H #define _HAL_H
#include "../inc/SPI.h" #include "SPI.h"
#ifdef __AVR__ #ifdef __AVR__
#include "HAL_AVR/HAL_AVR.h" #include "HAL_AVR/HAL_AVR.h"
... ...
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include "../HAL.h" #include "../HAL.h"
#include "SPI.h" #include "../SPI.h"
#include "pins_arduino.h" #include "pins_arduino.h"
#include "spi_pins.h" #include "spi_pins.h"
#include "../../core/macros.h" #include "../../core/macros.h"
... ...
......
#include <stdint.h> /**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* HAL/SPI.h
* Core Marlin definitions for SPI, implemented in the HALs
*/
#ifndef _SPI_H_
#define _SPI_H_
//#include "../inc/MarlinConfig.h"
#include <stdint.h>
#ifndef SPI_FULL_SPEED #ifndef SPI_FULL_SPEED
...@@ -20,20 +51,13 @@ ...@@ -20,20 +51,13 @@
* On other platforms, speed should be in range given above where possible. * On other platforms, speed should be in range given above where possible.
*/ */
/** Set SCK to max rate */ #define SPI_FULL_SPEED 0 // Set SCK to max rate
#define SPI_FULL_SPEED 0 #define SPI_HALF_SPEED 1 // Set SCK rate to half of max rate
/** Set SCK rate to half max rate. */ #define SPI_QUARTER_SPEED 2 // Set SCK rate to quarter of max rate
#define SPI_HALF_SPEED 1 #define SPI_EIGHTH_SPEED 3 // Set SCK rate to 1/8 of max rate
/** Set SCK rate to quarter max rate. */ #define SPI_SIXTEENTH_SPEED 4 // Set SCK rate to 1/16 of max rate
#define SPI_QUARTER_SPEED 2 #define SPI_SPEED_5 5 // Set SCK rate to 1/32 of max rate
/** Set SCK rate to 1/8 max rate. */ #define SPI_SPEED_6 6 // Set SCK rate to 1/64 of max rate
#define SPI_EIGHTH_SPEED 3
/** Set SCK rate to 1/16 of max rate. */
#define SPI_SIXTEENTH_SPEED 4
/** Set SCK rate to 1/32 of max rate. */
#define SPI_SPEED_5 5
/** Set SCK rate to 1/64 of max rate. */
#define SPI_SPEED_6 6
// Standard SPI functions // Standard SPI functions
/** Initialise SPI bus */ /** Initialise SPI bus */
...@@ -49,4 +73,6 @@ void spiRead(uint8_t* buf, uint16_t nbyte); ...@@ -49,4 +73,6 @@ void spiRead(uint8_t* buf, uint16_t nbyte);
/** Write token and then write from 512 byte buffer to SPI (for SD card) */ /** Write token and then write from 512 byte buffer to SPI (for SD card) */
void spiSendBlock(uint8_t token, const uint8_t* buf); void spiSendBlock(uint8_t token, const uint8_t* buf);
#endif #endif // SPI_FULL_SPEED
#endif // _SPI_H_
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "../core/boards.h" #include "../core/boards.h"
#include "../core/macros.h" #include "../core/macros.h"
#include "Version.h" #include "Version.h"
#include "SPI.h" #include "../HAL/SPI.h"
#include "../../Configuration.h" #include "../../Configuration.h"
#include "Conditionals_LCD.h" #include "Conditionals_LCD.h"
#include "../../Configuration_adv.h" #include "../../Configuration_adv.h"
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment