Browse Source

Inline small Fifo methods

Thomas Buck 8 years ago
parent
commit
b43e853fd0
2 changed files with 10 additions and 13 deletions
  1. 10
    3
      include/cc2500.h
  2. 0
    10
      src/cc2500.c

+ 10
- 3
include/cc2500.h View File

126
 #define CC2500_LQI_CRC_OK_BM                   0x80
126
 #define CC2500_LQI_CRC_OK_BM                   0x80
127
 #define CC2500_LQI_EST_BM                      0x7F
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
 void cc2500ReadRegisterMulti(uint8_t address, uint8_t data[], uint8_t length);
129
 void cc2500ReadRegisterMulti(uint8_t address, uint8_t data[], uint8_t length);
133
 void cc2500WriteRegisterMulti(uint8_t address, const uint8_t data[], uint8_t length);
130
 void cc2500WriteRegisterMulti(uint8_t address, const uint8_t data[], uint8_t length);
134
 
131
 
138
 void cc2500Strobe(uint8_t address);
135
 void cc2500Strobe(uint8_t address);
139
 void cc2500ResetChip(void);
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
 #endif
148
 #endif
142
 
149
 

+ 0
- 10
src/cc2500.c View File

7
 #include "spi.h"
7
 #include "spi.h"
8
 #include "cc2500.h"
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
 void cc2500ReadRegisterMulti(uint8_t address, uint8_t data[], uint8_t length) {
10
 void cc2500ReadRegisterMulti(uint8_t address, uint8_t data[], uint8_t length) {
15
     CS_off;
11
     CS_off;
16
     spiWrite(address);
12
     spiWrite(address);
29
     CS_on;
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
 void cc2500WriteReg(uint8_t address, uint8_t data) {
28
 void cc2500WriteReg(uint8_t address, uint8_t data) {
39
     CS_off;
29
     CS_off;
40
     spiWrite(address);
30
     spiWrite(address);

Loading…
Cancel
Save