|
@@ -12,18 +12,18 @@ void cc2500ReadFifo(uint8_t *dpbuffer, int len) {
|
12
|
12
|
|
13
|
13
|
void cc2500ReadRegisterMulti(uint8_t address, uint8_t data[], uint8_t length) {
|
14
|
14
|
CS_off;
|
15
|
|
- spi_write(address);
|
|
15
|
+ spiWrite(address);
|
16
|
16
|
for (uint8_t i = 0; i < length; i++) {
|
17
|
|
- data[i] = spi_read();
|
|
17
|
+ data[i] = spiRead();
|
18
|
18
|
}
|
19
|
19
|
CS_on;
|
20
|
20
|
}
|
21
|
21
|
|
22
|
22
|
void cc2500WriteRegisterMulti(uint8_t address, const uint8_t data[], uint8_t length) {
|
23
|
23
|
CS_off;
|
24
|
|
- spi_write(CC2500_WRITE_BURST | address);
|
|
24
|
+ spiWrite(CC2500_WRITE_BURST | address);
|
25
|
25
|
for (uint8_t i = 0; i < length; i++) {
|
26
|
|
- spi_write(data[i]);
|
|
26
|
+ spiWrite(data[i]);
|
27
|
27
|
}
|
28
|
28
|
CS_on;
|
29
|
29
|
}
|
|
@@ -36,9 +36,9 @@ void cc2500WriteFifo(uint8_t *dpbuffer, uint8_t len) {
|
36
|
36
|
|
37
|
37
|
void cc2500WriteReg(uint8_t address, uint8_t data) {
|
38
|
38
|
CS_off;
|
39
|
|
- spi_write(address);
|
|
39
|
+ spiWrite(address);
|
40
|
40
|
NOP();
|
41
|
|
- spi_write(data);
|
|
41
|
+ spiWrite(data);
|
42
|
42
|
CS_on;
|
43
|
43
|
}
|
44
|
44
|
|
|
@@ -46,15 +46,15 @@ unsigned char cc2500ReadReg(unsigned char address) {
|
46
|
46
|
uint8_t result;
|
47
|
47
|
CS_off;
|
48
|
48
|
address |= 0x80; // bit 7 =1 for reading
|
49
|
|
- spi_write(address);
|
50
|
|
- result = spi_read();
|
|
49
|
+ spiWrite(address);
|
|
50
|
+ result = spiRead();
|
51
|
51
|
CS_on;
|
52
|
52
|
return result;
|
53
|
53
|
}
|
54
|
54
|
|
55
|
55
|
void cc2500Strobe(uint8_t address) {
|
56
|
56
|
CS_off;
|
57
|
|
- spi_write(address);
|
|
57
|
+ spiWrite(address);
|
58
|
58
|
CS_on;
|
59
|
59
|
}
|
60
|
60
|
|