X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fapps%2Fradios%2Fnrf.c;h=76c396c6c5a0cafe61b79d30daae3623b686fee2;hp=ca701130eee5a896609bd16181be5d98048a89b2;hb=6373a97ac3426c9d9966cf6a08286ecd13cc2ced;hpb=97143fece53250662a3ffd22f141619a4902eda7 diff --git a/firmware/apps/radios/nrf.c b/firmware/apps/radios/nrf.c index ca70113..76c396c 100644 --- a/firmware/apps/radios/nrf.c +++ b/firmware/apps/radios/nrf.c @@ -9,12 +9,33 @@ #include "command.h" #include -#include +#include #include #include "nrf.h" #include "spi.h" +//! Handles a Nordic RF command. +void nrf_handle_fn( uint8_t const app, + uint8_t const verb, + uint32_t const len); + +// define the nrf app's app_t +app_t const nrf_app = { + + /* app number */ + NRF, + + /* handle fn */ + nrf_handle_fn, + + /* name */ + "NRF", + + /* desc */ + "\tThe NRF app adds support for the NordicRF register\n" + "\tinterface.\n" +}; #define RADIOACTIVE SETCE #define RADIOPASSIVE CLRCE @@ -22,8 +43,8 @@ //! Set up the pins for NRF mode. void nrfsetup(){ SETSS; - P5DIR&=~MISO; - P5DIR|=MOSI+SCK; + SPIDIR&=~MISO; + SPIDIR|=MOSI+SCK; DIRSS; DIRCE; @@ -81,9 +102,10 @@ u8 nrf_regread(u8 reg, u8 *buf, int len){ } //! Handles a Nordic RF command. -void nrfhandle(unsigned char app, - unsigned char verb, - unsigned long len){ +void nrf_handle_fn( uint8_t const app, + uint8_t const verb, + uint32_t const len) +{ unsigned long i; //Drop CE to passify radio.