Bläddra i källkod

Inline small Fifo methods

Thomas Buck 8 år sedan
förälder
incheckning
b43e853fd0
2 ändrade filer med 10 tillägg och 13 borttagningar
  1. 10
    3
      include/cc2500.h
  2. 0
    10
      src/cc2500.c

+ 10
- 3
include/cc2500.h Visa fil

@@ -126,9 +126,6 @@ enum {
126 126
 #define CC2500_LQI_CRC_OK_BM                   0x80
127 127
 #define CC2500_LQI_EST_BM                      0x7F
128 128
 
129
-void cc2500ReadFifo(uint8_t *dpbuffer, int len);
130
-void cc2500WriteFifo(uint8_t *dpbuffer, uint8_t len);
131
-
132 129
 void cc2500ReadRegisterMulti(uint8_t address, uint8_t data[], uint8_t length);
133 130
 void cc2500WriteRegisterMulti(uint8_t address, const uint8_t data[], uint8_t length);
134 131
 
@@ -138,5 +135,15 @@ void cc2500WriteReg(uint8_t address, uint8_t data);
138 135
 void cc2500Strobe(uint8_t address);
139 136
 void cc2500ResetChip(void);
140 137
 
138
+inline void cc2500ReadFifo(uint8_t *dpbuffer, int len) {
139
+    cc2500ReadRegisterMulti(CC2500_3F_RXFIFO | CC2500_READ_BURST, dpbuffer, len);
140
+}
141
+
142
+inline void cc2500WriteFifo(uint8_t *dpbuffer, uint8_t len) {
143
+    cc2500Strobe(CC2500_SFTX); // 0x3B
144
+    cc2500WriteRegisterMulti(CC2500_3F_TXFIFO, dpbuffer, len);
145
+    cc2500Strobe(CC2500_STX); // 0x35
146
+}
147
+
141 148
 #endif
142 149
 

+ 0
- 10
src/cc2500.c Visa fil

@@ -7,10 +7,6 @@
7 7
 #include "spi.h"
8 8
 #include "cc2500.h"
9 9
 
10
-void cc2500ReadFifo(uint8_t *dpbuffer, int len) {
11
-    cc2500ReadRegisterMulti(CC2500_3F_RXFIFO | CC2500_READ_BURST, dpbuffer, len);
12
-}
13
-
14 10
 void cc2500ReadRegisterMulti(uint8_t address, uint8_t data[], uint8_t length) {
15 11
     CS_off;
16 12
     spiWrite(address);
@@ -29,12 +25,6 @@ void cc2500WriteRegisterMulti(uint8_t address, const uint8_t data[], uint8_t len
29 25
     CS_on;
30 26
 }
31 27
 
32
-void cc2500WriteFifo(uint8_t *dpbuffer, uint8_t len) {
33
-    cc2500Strobe(CC2500_SFTX); // 0x3B
34
-    cc2500WriteRegisterMulti(CC2500_3F_TXFIFO, dpbuffer, len);
35
-    cc2500Strobe(CC2500_STX); // 0x35
36
-}
37
-
38 28
 void cc2500WriteReg(uint8_t address, uint8_t data) {
39 29
     CS_off;
40 30
     spiWrite(address);

Laddar…
Avbryt
Spara