Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Communication_Robot by
communication.h
- Committer:
- soulx
- Date:
- 2015-03-01
- Revision:
- 1:1f6864549b92
- Parent:
- 0:0c88691e3904
- Child:
- 2:56c1de1612dd
File content as of revision 1:1f6864549b92:
#ifndef ANDANTE_COMMUNICATION_H
#define ANDANTE_COMMUNICATION_H
#include "mbed.h"
#include "iSerial.h"
#include "protocol.h"
#include "Utilities.h"
#define ANDANTE_DEBUG
class COMMUNICATION
{
private:
iSerial *serialCom;
public:
/** Send the MX28 packet over the serial half duplex connection.
*
* @param packet The MX28 packet.
* @return MX28_ERRBIT_NONE if succeeded, error code otherwise.
*/
uint8_t sendCommunicatePacket(ANDANTE_PROTOCOL_PACKET *packet);
uint8_t receiveCommunicatePacket(ANDANTE_PROTOCOL_PACKET *packet);
/** Create an MX28 servo object connected to the specified serial half duplex pins,
* with the specified baudrate.
*
* @param tx Send pin.
* @param rx Receive pin.
* @param baudrate The bus speed.
*/
COMMUNICATION(PinName tx, PinName rx, uint32_t baudRate, uint16_t tx_buff=1000, uint16_t rx_buff=1000 );
/** Destroy an MX28 servo object
*/
~COMMUNICATION();
};
#endif // MX28_H
