Kaynağa Gözat

SPI API platform implementation stubs

Christopher Pepper 6 yıl önce
ebeveyn
işleme
32e759c928

Marlin/src/HAL/HAL_AVR/persistent_store.cpp → Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp Dosyayı Görüntüle

@@ -1,3 +1,5 @@
1
+#ifdef ARDUINO_ARCH_AVR
2
+
1 3
 #include "../persistent_store_api.h"
2 4
 
3 5
 #include "../../../types.h"
@@ -5,7 +7,6 @@
5 7
 #include "../../../serial.h"
6 8
 #include "../../../utility.h"
7 9
 
8
-#ifdef ARDUINO_ARCH_AVR
9 10
 #if ENABLED(EEPROM_SETTINGS)
10 11
 
11 12
 namespace HAL {

+ 51
- 0
Marlin/src/HAL/HAL_AVR/spi_impl.cpp Dosyayı Görüntüle

@@ -0,0 +1,51 @@
1
+#ifdef ARDUINO_ARCH_AVR
2
+
3
+#include <stdint.h>
4
+
5
+namespace HAL {
6
+namespace SPI {
7
+
8
+bool initialise(uint8_t channel) {
9
+  return false;
10
+}
11
+
12
+bool enable_cs(uint8_t channel) {
13
+  return false;
14
+}
15
+
16
+void disable_cs(uint8_t channel) {
17
+
18
+}
19
+
20
+void set_frequency(uint8_t channel, uint32_t frequency) {
21
+
22
+}
23
+
24
+void read(uint8_t channel, uint8_t *buffer, uint32_t length) {
25
+
26
+}
27
+
28
+uint8_t read(uint8_t channel) {
29
+  return '\0';
30
+}
31
+
32
+void write(uint8_t channel, const uint8_t *buffer, uint32_t length) {
33
+
34
+}
35
+
36
+void write(uint8_t channel, uint8_t value) {
37
+
38
+}
39
+
40
+void transfer(uint8_t channel, const uint8_t *buffer_write, uint8_t *buffer_read, uint32_t length) {
41
+
42
+}
43
+
44
+uint8_t transfer(uint8_t channel, uint8_t value) {
45
+  return '\0';
46
+}
47
+
48
+} // namespace SPI
49
+} // namespace HAL
50
+
51
+#endif //#ifdef ARDUINO_ARCH_AVR

+ 4
- 0
Marlin/src/HAL/HAL_AVR/spi_pins.h Dosyayı Görüntüle

@@ -20,6 +20,10 @@
20 20
 #ifndef SPI_PINS_H_
21 21
 #define SPI_PINS_H_
22 22
 
23
+#define SD_SPI_CHANNEL (HAL::SPI::CHANNEL_0)
24
+#define LCD_SPI_FREQUENCY 4000000
25
+#define LCD_SPI_CHANNEL (HAL::SPI::CHANNEL_1)
26
+
23 27
 /**
24 28
  * Define SPI Pins: SCK, MISO, MOSI, SS
25 29
  */

Marlin/src/HAL/HAL_DUE/persistent_store.cpp → Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp Dosyayı Görüntüle

@@ -1,3 +1,5 @@
1
+#ifdef ARDUINO_ARCH_SAM
2
+
1 3
 #include "../persistent_store_api.h"
2 4
 
3 5
 #include "../../../types.h"
@@ -5,7 +7,6 @@
5 7
 #include "../../../serial.h"
6 8
 #include "../../../utility.h"
7 9
 
8
-#ifdef ARDUINO_ARCH_SAM
9 10
 #if ENABLED(EEPROM_SETTINGS)
10 11
 
11 12
 namespace HAL {

+ 51
- 0
Marlin/src/HAL/HAL_DUE/spi_impl.cpp Dosyayı Görüntüle

@@ -0,0 +1,51 @@
1
+#ifdef ARDUINO_ARCH_SAM
2
+
3
+#include <stdint.h>
4
+
5
+namespace HAL {
6
+namespace SPI {
7
+
8
+bool initialise(uint8_t channel) {
9
+  return false;
10
+}
11
+
12
+bool enable_cs(uint8_t channel) {
13
+  return false;
14
+}
15
+
16
+void disable_cs(uint8_t channel) {
17
+
18
+}
19
+
20
+void set_frequency(uint8_t channel, uint32_t frequency) {
21
+
22
+}
23
+
24
+void read(uint8_t channel, uint8_t *buffer, uint32_t length) {
25
+
26
+}
27
+
28
+uint8_t read(uint8_t channel) {
29
+  return '\0';
30
+}
31
+
32
+void write(uint8_t channel, const uint8_t *buffer, uint32_t length) {
33
+
34
+}
35
+
36
+void write(uint8_t channel, uint8_t value) {
37
+
38
+}
39
+
40
+void transfer(uint8_t channel, const uint8_t *buffer_write, uint8_t *buffer_read, uint32_t length) {
41
+
42
+}
43
+
44
+uint8_t transfer(uint8_t channel, uint8_t value) {
45
+  return '\0';
46
+}
47
+
48
+} // namespace SPI
49
+} // namespace HAL
50
+
51
+#endif //#ifdef ARDUINO_ARCH_AVR

+ 5
- 0
Marlin/src/HAL/HAL_DUE/spi_pins.h Dosyayı Görüntüle

@@ -21,6 +21,11 @@
21 21
 #ifndef SPI_PINS_H_
22 22
 #define SPI_PINS_H_
23 23
 
24
+//new config options
25
+#define SD_SPI_CHANNEL (HAL::SPI::CHANNEL_0)
26
+#define LCD_SPI_FREQUENCY 4000000
27
+#define LCD_SPI_CHANNEL (HAL::SPI::CHANNEL_1)
28
+
24 29
 /**
25 30
  * Define SPI Pins: SCK, MISO, MOSI, SS
26 31
  *

Marlin/src/HAL/HAL_LPC1768/persistent_store.cpp → Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp Dosyayı Görüntüle


Marlin/src/HAL/HAL_TEENSY35_36/persistent_store.cpp → Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp Dosyayı Görüntüle

@@ -1,3 +1,5 @@
1
+#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
2
+
1 3
 #include "../persistent_store_api.h"
2 4
 
3 5
 #include "../../../types.h"
@@ -5,7 +7,6 @@
5 7
 #include "../../../serial.h"
6 8
 #include "../../../utility.h"
7 9
 
8
-#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
9 10
 #if ENABLED(EEPROM_SETTINGS)
10 11
 
11 12
 namespace HAL {

+ 51
- 0
Marlin/src/HAL/HAL_TEENSY35_36/spi_impl.cpp Dosyayı Görüntüle

@@ -0,0 +1,51 @@
1
+#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
2
+
3
+#include <stdint.h>
4
+
5
+namespace HAL {
6
+namespace SPI {
7
+
8
+bool initialise(uint8_t channel) {
9
+  return false;
10
+}
11
+
12
+bool enable_cs(uint8_t channel) {
13
+  return false;
14
+}
15
+
16
+void disable_cs(uint8_t channel) {
17
+
18
+}
19
+
20
+void set_frequency(uint8_t channel, uint32_t frequency) {
21
+
22
+}
23
+
24
+void read(uint8_t channel, uint8_t *buffer, uint32_t length) {
25
+
26
+}
27
+
28
+uint8_t read(uint8_t channel) {
29
+  return '\0';
30
+}
31
+
32
+void write(uint8_t channel, const uint8_t *buffer, uint32_t length) {
33
+
34
+}
35
+
36
+void write(uint8_t channel, uint8_t value) {
37
+
38
+}
39
+
40
+void transfer(uint8_t channel, const uint8_t *buffer_write, uint8_t *buffer_read, uint32_t length) {
41
+
42
+}
43
+
44
+uint8_t transfer(uint8_t channel, uint8_t value) {
45
+  return '\0';
46
+}
47
+
48
+} // namespace SPI
49
+} // namespace HAL
50
+
51
+#endif //#ifdef ARDUINO_ARCH_AVR

+ 5
- 0
Marlin/src/HAL/HAL_TEENSY35_36/spi_pins.h Dosyayı Görüntüle

@@ -20,6 +20,11 @@
20 20
 #ifndef SPI_PINS_H_
21 21
 #define SPI_PINS_H_
22 22
 
23
+//new config options
24
+#define SD_SPI_CHANNEL (HAL::SPI::CHANNEL_0)
25
+#define LCD_SPI_FREQUENCY 4000000
26
+#define LCD_SPI_CHANNEL (HAL::SPI::CHANNEL_1)
27
+
23 28
 #define SCK_PIN		13
24 29
 #define MISO_PIN	12
25 30
 #define MOSI_PIN	11

Loading…
İptal
Kaydet