HMTRP Class
- ID: hmtrp
- Name: Serial RF Pro Module
- Other Names: HMTRP-433 HMTRP-470 HMTRP-868 HMTRP-915
- Category: wifi
- Manufacturer: seeed
- Connection: uart
- Link: http://wiki.seeed.cc/Grove-Serial_RF_Pro/
UPM support for the HM-TRP Serial RF Pro transceiver. This was tested specifically with the Grove Serial RF Pro transceiver. In theory, this class should work with the following devices:
HM-TRP-433: 414000000-454000000Hz HM-TRP-470: 450000000-490000000Hz HM-TRP-868: 849000000-889000000Hz HM-TRP-915: 895000000-935000000Hz
The only difference is the transmit and receive frequencies supported.
By default, the device simply sends and receives any data presented on its UART interface. It can be put into a configuration mode by grounding the CONFIG pin on the transceiver.
Item Index
Methods
Methods
HMTRP
-
uart
HMTRP Serial RF Pro transceiver constructor
Parameters:
-
uart
NumberDefault UART to use (0 or 1)
Returns:
dataAvailable
-
millis
Checks to see if there is data available for reading
Parameters:
-
millis
NumberNumber of milliseconds to wait; 0 means no waiting (default).
Returns:
True if there is data available for reading
readData
-
buffer
-
len
-
millis
Reads any available data in a user-supplied buffer
Parameters:
-
buffer
StringBuffer to hold the data read
-
len
NumberLength of the buffer
-
millis
NumberMaximum time in milliseconds to wait for input. -1 means waiting forever (default).
Returns:
Number of bytes read; 0 if timed out and millis is >= 0
writeData
-
buffer
-
len
Writes the data in the buffer to the device
Parameters:
-
buffer
StringBuffer to hold the data read
-
len
NumberLength of the buffer
Returns:
Number of bytes written
setupTty
-
baud
Sets up proper tty I/O modes and the baud rate. The default baud rate is 9,600 (B9600).
Parameters:
-
baud
Speed_tDesired baud rate.
Returns:
True if successful
checkOK
()
Boolean
Looks for and verifies an OK response. This looks like "OK\r\n"
Returns:
True if OK received
reset
()
Boolean
Resets the device to default parameters, except for the UART baud rate
Returns:
True if successful
getConfig
-
freq
-
dataRate
-
rxBandwidth
-
modulation
-
txPower
-
uartBaud
Queries the radio to determine its configuration
Parameters:
-
freq
Uint32_t *Operating frequency
-
dataRate
Uint32_t *TX/RX bit rate
-
rxBandwidth
Uint16_t *Receiving bandwidth in Khz
-
modulation
Uint8_t *Modulation frequency in Khz
-
txPower
Uint8_t *Transmission power (1-7)
-
uartBaud
Uint32_t *UART baud rate
Returns:
True if successful
setFrequency
-
freq
Sets the frequency. Note: this is limited depending on which HM-TRP device you are using. Consult the datasheet.
Parameters:
-
freq
NumberOperating frequency
Returns:
True if successful
setRFDataRate
-
rate
Sets the RF data transmission rate. Valid values are between 1,200 and 115,200.
Parameters:
-
rate
NumberRadio transmission rate in baud (1,200-115,200)
Returns:
True if successful
setRXBandwidth
-
rxBand
Sets the RX bandwidth. Valid values are between 30 and 620 (in Khz)
Parameters:
-
rxBand
NumberRX bandwidth in Khz (30-620)
Returns:
True if successful
setFrequencyModulation
-
modulation
Sets the frequency modulation. Valid values are between 10 and 160 (in Khz)
Parameters:
-
modulation
NumberFrequency modulation to use, in Khz (10-160)
Returns:
True if successful
setTransmitPower
-
power
Sets the transmit power level. Valid values are between 0 and 7, 7 being the maximum power.
Parameters:
-
power
NumberPower level to use during transmission. Valid values are between 0 and 7.
Returns:
True if successful
setUARTSpeed
-
speed
Sets the configured baud rate of the UART. It is strongly recommended you do not change this, or you may lose the ability to communicate with the transceiver. Valid values are 1,200-115,200.
Parameters:
-
speed
NumberDesired baud rate to configure the device to use Valid values are between 1,200 and 115,200.
Returns:
True if successful
getRFSignalStrength
-
strength
Gets the RF signal strength
Parameters:
-
strength
Uint8_t *Returned strength
Returns:
True if successful
getRFSignalStrength
()
Number
Gets the RF signal strength
Returns:
Signal strength
getModSignalStrength
-
strength
Gets the modulation signal strength.
Parameters:
-
strength
Uint8_t *Returned strength
Returns:
True if successful
getModSignalStrength
()
Number
Gets the modulation signal strength.
Returns:
Signal strength