This is an experimental driver for the XBee 900 HP pro module's SPI connection. This driver is unfinished and stability is not guaranteed. Use with caution.
Dependents: Sentinel_BASE Sentinel_NODE
Diff: xbee900hp.h
- Revision:
- 7:3cb67634fa4e
- Parent:
- 6:3873db4a0164
- Child:
- 9:d4542525b218
diff -r 3873db4a0164 -r 3cb67634fa4e xbee900hp.h --- a/xbee900hp.h Thu Apr 30 17:01:46 2015 +0000 +++ b/xbee900hp.h Thu Apr 07 18:09:59 2016 +0000 @@ -10,64 +10,75 @@ { public: - /** + /** * Initialize the xBee Module - */ - xbee900hp(PinName pin_mosi,PinName pin_miso,PinName pin_sck,PinName pin_attn, PinName pin_rst); - + */ + xbee900hp(PinName pin_mosi,PinName pin_miso,PinName pin_sck,PinName pin_attn, PinName pin_rst, unsigned int freq); + /** * Destructor */ ~xbee900hp(); - - /** + + /** * Subroutine to reset the xBee Module - */ + */ void reset(); - /** + /** * Send packet over spi to xBee for TX - */ - void sendPacket(char* data, unsigned int length); - + */ + int sendPacket(char* data, unsigned int length, bool enMesh); + /** - * Write a setting value to the module + * Get signal strength of last recieved packet */ - void writeSetting(char command[2], unsigned int value); - + unsigned int getRSSI(); + + /** + * Set the transmission power level + */ + int setPower(int value); + /** * Get serial number of xbee module */ - int getSerial(char* serialnumber); - + unsigned long long getSerial(); + /** * Wait for and read incoming data packet + * Returns the source address if successful, or 0 if it failed. */ - int readPacket(char* data); - + unsigned long long readPacket(char* data); + /** * Clear output buffer */ void clearBuff(); - + /** * Check ATTN signal */ int attn(); - -private: + + /** + * Read raw data in from module + */ + char debug(); + +private: // Setup pin input types. - + // Reset DigitalOut _pin_rst; // Asert Pin Use Interrupts for Super Speed DigitalIn _pin_attn; - + void readDataISR(); - + // SPI SPI _xbeespi; }; -#endif \ No newline at end of file +#endif