Clark Scheff / HubsanTX

Dependencies:   A7105TxRx

Embed: (wiki syntax)

« Back to documentation index

HubsanTx Class Reference

HubsanTx Class Reference

Class for communicating with a Hubsan X4 using the A7105TxRx library. More...

#include <HubsanTx.h>

Public Member Functions

 HubsanTx (PinName mosi, PinName miso, PinName clk, PinName cs, uint32_t freqHz)
int8_t init ()
 Initialize the A7105 to communicate with a Hubsan X4.

Detailed Description

Class for communicating with a Hubsan X4 using the A7105TxRx library.

Example:

 #include "mbed.h"
 #include "HubsanTx.h"

 #define A7105_SPI_FREQUENCY  10000000 // 10MHz
 
 HubsanTx hubsan(D4, D5, D3, D6, A7105_SPI_FREQUENCY);
 
 int main() {
     // init
     hubsan.init();
 }

Definition at line 34 of file HubsanTx.h.


Constructor & Destructor Documentation

HubsanTx ( PinName  mosi,
PinName  miso,
PinName  clk,
PinName  cs,
uint32_t  freqHz 
)
Parameters:
mosiPin used to transmit data to the slave
misoPin used to receive data from the slave
clkPin used for the clock
csPin used for the chip select
freqHzFrequency used to clock data in and out

Definition at line 4 of file HubsanTx.cpp.


Member Function Documentation

int8_t init (  )

Initialize the A7105 to communicate with a Hubsan X4.

Definition at line 8 of file HubsanTx.cpp.