IRPyro TO API demo
Specific demo for the IRPyro TO with IRPyro API
|
This section describes how to use the IRPyro API. It part one describe the use "as is" and part two describe the customization process of the GPIO, I2C and User modules for use with other micro controllers.
For information on the sensor itself see: "IRPyro Sensor Reference Manual.pdf" For information on the additional software required to compile this firmware refer to the IRPyro API documentation on the parent folder.
The example configure the sensor and collect data. A serial terminal like RealTerm or similar is useful to see the collected data.
A basic USART implementation allows the examples to send data to RealTerm using UART_stream_char_send() for plain text and UART_stream_binary_send()
The settings for serial communication are as follow:
Baud Rate: 921600 Parity: None Data Bits: 8 Stop Bits: 1 Hardware Flow Control: None Software Flow Control: None
Data collected can be seen as plain text of as a binary packet
Plain text:
FRAME #, 4750, CH, 0, 14252, 0, 0 SAT> 0
The packet starts with a consecutive frame number followed by the unsigned integer indicating the signal strength of the first active channel on the sensor. All the sensors are configured by the firmware with only channel 2 active, although there is space in the line for channels 1,3 and 4.
Binary packet:
AA 02 0E 00 23 31 00 38 64 AA 02 0E 00 22 73 00 38 3C 00 26 7B 00 22 88 09 D4 00 55
Byte Number Byte Type Byte Value Description 0 Packet Header 0xAA Marker for start of packet. 1 Data Type 0x02 Indicates that packet is of data type 2 Number of Bytes 0x0E Number of data bytes in packet. For this command, there are 14 bytes. 3-5 First channel 23 bit unsigned integer indicating signal strength enabled 6-8 Second channel 23 bit unsigned integer indicating signal strength enabled 9-11 Third channel 23 bit unsigned integer indicating signal strength enabled 12-14 Fourth channel 23 bit unsigned integer indicating signal strength enabled 15-16 Frame counter 16 bit unsigned integer 17 Encoded saturation 8 bit unsigned integer (See note) byte 20 Packet Footer 0x55 Marker for the end of the packet.
Encoded saturation byte (1 saturated / 0 not saturated) Bit 0 indicates first channel active saturation status Bit 1 indicates second channel active saturation status Bit 2 indicates third channel active saturation status Bit 3 indicates fourth channel active saturation status
The following examples are included: