2 \author Travis Goodspeed
3 \brief NordicRF Register Interface
6 //Higher level left to client application.
18 //This could be more accurate.
19 //Does it ever need to be?
25 //! Set up the pins for NRF mode.
31 //Begin a new transaction.
37 //! Read and write an NRF byte.
38 unsigned char nrftrans8(unsigned char byte){
39 register unsigned int bit;
40 //This function came from the NRF Wikipedia article.
43 for (bit = 0; bit < 8; bit++) {
44 /* write MOSI on trailing edge of previous clock */
53 /* read MISO on trailing edge */
64 //! Handles a Nordic RF command.
65 void nrfhandle(unsigned char app,
70 //Raise !SS to end transaction, just in case we forgot.
75 //PEEK and POKE might come later.
78 P5OUT&=~SS; //Drop !SS to begin transaction.
80 cmddata[i]=nrftrans8(cmddata[i]);
81 P5OUT|=SS; //Raise !SS to end transaction.
87 case PEEK://Grab NRF Register
91 case POKE://Poke NRF Register