+//! Writes bytes into the CC2420's RAM. Untested.
+void ccspi_pokeram(u8 addr, char *data, int len){
+ CLRSS;
+ //Begin with the start address.
+ ccspitrans8(0x80 | (addr & 0x7F));
+ ccspitrans8(((addr>>1)&0xC0) // MSBits are high bits of 9-bit address.
+ // Read/!Write bit should be clear to write.
+ );
+
+ //Data goes here.
+ while(len--)
+ ccspitrans8(*data++);
+
+ SETSS;
+}
+
+//! Read bytes from the CC2420's RAM. Untested.
+void ccspi_peekram(u16 addr, u8 *data, u16 len){
+ CLRSS;
+
+ //Begin with the start address.
+ ccspitrans8(0x80 | (addr & 0x7F));
+ ccspitrans8(((addr>>1)&0xC0) // MSBits are high bits of 9-bit address.
+ | BIT5 // Read/!Write bit should be set to read.
+ );
+
+ //Data goes here.
+ while(len--)
+ *data++=ccspitrans8(0);
+
+ SETSS;
+}