Переглянути джерело

Combine channel-based SPI headers

Scott Lahteine 4 роки тому
джерело
коміт
8d036e94bf

+ 0
- 11
Marlin/src/HAL/HAL_DUE/HAL.h Переглянути файл

@@ -95,17 +95,6 @@ void HAL_clear_reset_source(void);  // clear reset reason
95 95
 uint8_t HAL_get_reset_source(void); // get reset reason
96 96
 
97 97
 //
98
-// SPI: Extended functions taking a channel number (Hardware SPI only)
99
-//
100
-
101
-// Write single byte to specified SPI channel
102
-void spiSend(uint32_t chan, byte b);
103
-// Write buffer to specified SPI channel
104
-void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
105
-// Read single byte from specified SPI channel
106
-uint8_t spiRec(uint32_t chan);
107
-
108
-//
109 98
 // EEPROM
110 99
 //
111 100
 void eeprom_write_byte(uint8_t *pos, unsigned char value);

+ 0
- 8
Marlin/src/HAL/HAL_LINUX/HAL.h Переглянути файл

@@ -86,14 +86,6 @@ inline void HAL_init(void) { }
86 86
 int freeMemory(void);
87 87
 #pragma GCC diagnostic pop
88 88
 
89
-// SPI: Extended functions which take a channel number (hardware SPI only)
90
-/** Write single byte to specified SPI channel */
91
-void spiSend(uint32_t chan, byte b);
92
-/** Write buffer to specified SPI channel */
93
-void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
94
-/** Read single byte from specified SPI channel */
95
-uint8_t spiRec(uint32_t chan);
96
-
97 89
 // ADC
98 90
 #define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin)
99 91
 #define HAL_START_ADC(pin)     HAL_adc_start_conversion(pin)

+ 0
- 11
Marlin/src/HAL/HAL_LPC1768/HAL.h Переглянути файл

@@ -117,17 +117,6 @@ int freeMemory(void);
117 117
 #pragma GCC diagnostic pop
118 118
 
119 119
 //
120
-// SPI: Extended functions taking a channel number (Hardware SPI only)
121
-//
122
-
123
-// Write single byte to specified SPI channel
124
-void spiSend(uint32_t chan, byte b);
125
-// Write buffer to specified SPI channel
126
-void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
127
-// Read single byte from specified SPI channel
128
-uint8_t spiRec(uint32_t chan);
129
-
130
-//
131 120
 // ADC API
132 121
 //
133 122
 

+ 0
- 11
Marlin/src/HAL/HAL_STM32/HAL.h Переглянути файл

@@ -170,17 +170,6 @@ static inline int freeMemory() {
170 170
 #pragma GCC diagnostic pop
171 171
 
172 172
 //
173
-// SPI: Extended functions which take a channel number (hardware SPI only)
174
-//
175
-
176
-// Write single byte to specified SPI channel
177
-void spiSend(uint32_t chan, byte b);
178
-// Write buffer to specified SPI channel
179
-void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
180
-// Read single byte from specified SPI channel
181
-uint8_t spiRec(uint32_t chan);
182
-
183
-//
184 173
 // EEPROM
185 174
 //
186 175
 

+ 0
- 11
Marlin/src/HAL/HAL_STM32F1/HAL.h Переглянути файл

@@ -209,17 +209,6 @@ static int freeMemory() {
209 209
 #pragma GCC diagnostic pop
210 210
 
211 211
 //
212
-// SPI: Extended functions which take a channel number (hardware SPI only)
213
-//
214
-
215
-// Write single byte to specified SPI channel
216
-void spiSend(uint32_t chan, byte b);
217
-// Write buffer to specified SPI channel
218
-void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
219
-// Read single byte from specified SPI channel
220
-uint8_t spiRec(uint32_t chan);
221
-
222
-//
223 212
 // EEPROM
224 213
 //
225 214
 

+ 0
- 11
Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h Переглянути файл

@@ -187,17 +187,6 @@ static inline int freeMemory(void) {
187 187
 #pragma GCC diagnostic pop
188 188
 
189 189
 //
190
-// SPI: Extended functions which take a channel number (hardware SPI only)
191
-//
192
-
193
-// Write single byte to specified SPI channel
194
-void spiSend(uint32_t chan, byte b);
195
-// Write buffer to specified SPI channel
196
-void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
197
-// Read single byte from specified SPI channel
198
-uint8_t spiRec(uint32_t chan);
199
-
200
-//
201 190
 // EEPROM
202 191
 //
203 192
 

+ 0
- 11
Marlin/src/HAL/HAL_TEENSY31_32/HAL.h Переглянути файл

@@ -104,17 +104,6 @@ extern "C" {
104 104
 }
105 105
 #pragma GCC diagnostic pop
106 106
 
107
-// SPI: Extended functions which take a channel number (hardware SPI only)
108
-
109
-// Write single byte to specified SPI channel
110
-void spiSend(uint32_t chan, byte b);
111
-
112
-// Write buffer to specified SPI channel
113
-void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
114
-
115
-// Read single byte from specified SPI channel
116
-uint8_t spiRec(uint32_t chan);
117
-
118 107
 // ADC
119 108
 
120 109
 void HAL_adc_init();

+ 0
- 8
Marlin/src/HAL/HAL_TEENSY35_36/HAL.h Переглянути файл

@@ -110,14 +110,6 @@ extern "C" {
110 110
 }
111 111
 #pragma GCC diagnostic pop
112 112
 
113
-// SPI: Extended functions which take a channel number (hardware SPI only)
114
-// Write single byte to specified SPI channel
115
-void spiSend(uint32_t chan, byte b);
116
-// Write buffer to specified SPI channel
117
-void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
118
-// Read single byte from specified SPI channel
119
-uint8_t spiRec(uint32_t chan);
120
-
121 113
 // ADC
122 114
 
123 115
 void HAL_adc_init();

+ 31
- 8
Marlin/src/HAL/shared/HAL_SPI.h Переглянути файл

@@ -22,10 +22,11 @@
22 22
 #pragma once
23 23
 
24 24
 /**
25
- * HAL/HAL_SPI.h
25
+ * HAL/shared/HAL_SPI.h
26 26
  * Core Marlin definitions for SPI, implemented in the HALs
27 27
  */
28 28
 
29
+#include "Marduino.h"
29 30
 #include <stdint.h>
30 31
 
31 32
 /**
@@ -53,18 +54,40 @@
53 54
 #define SPI_SPEED_5         5   // Set SCK rate to 1/32 of max rate
54 55
 #define SPI_SPEED_6         6   // Set SCK rate to 1/64 of max rate
55 56
 
57
+//
56 58
 // Standard SPI functions
57
-/** Initialize SPI bus */
59
+//
60
+
61
+// Initialize SPI bus
58 62
 void spiBegin(void);
59
-/** Configure SPI for specified SPI speed */
63
+
64
+// Configure SPI for specified SPI speed
60 65
 void spiInit(uint8_t spiRate);
61
-/** Write single byte to SPI */
66
+
67
+// Write single byte to SPI
62 68
 void spiSend(uint8_t b);
63
-/** Read single byte from SPI */
69
+
70
+// Read single byte from SPI
64 71
 uint8_t spiRec(void);
65
-/** Read from SPI into buffer */
72
+
73
+// Read from SPI into buffer
66 74
 void spiRead(uint8_t* buf, uint16_t nbyte);
67
-/** Write token and then write from 512 byte buffer to SPI (for SD card) */
75
+
76
+// Write token and then write from 512 byte buffer to SPI (for SD card)
68 77
 void spiSendBlock(uint8_t token, const uint8_t* buf);
69
-/** Begin SPI transaction, set clock, bit order, data mode */
78
+
79
+// Begin SPI transaction, set clock, bit order, data mode
70 80
 void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode);
81
+
82
+//
83
+// Extended SPI functions taking a channel number (Hardware SPI only)
84
+//
85
+
86
+// Write single byte to specified SPI channel
87
+void spiSend(uint32_t chan, byte b);
88
+
89
+// Write buffer to specified SPI channel
90
+void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
91
+
92
+// Read single byte from specified SPI channel
93
+uint8_t spiRec(uint32_t chan);

Завантаження…
Відмінити
Зберегти