Skip to content

SPI Packet

Johan Söderlind Åström edited this page Nov 20, 2017 · 1 revision

Lepton 3 packet memory layout

Name Size (bits) Description
First bit 1 Should be zero
TTT Segment number 3 Segment number when packet number is 20.
If packet number is not 20 then ignore it.
Packet Number 12 The packet number
Checksum 16 CRC16, CCITT, seed=0, final=0
Payload 8*160 Line of pixels values

Example of a C struct packet

#define Lepton_Height 60
#define Lepton_Width 80
#define Lepton_Packet_Payload_Size 160
struct __attribute__((__packed__)) Lepton_Packet
{
   //FTTT NNNN
   //NNNN can be ignored because those bits would make packet number too large
   uint8_t Reserved;
   //NNNN NNNN
   //Can be between 0 .. Lepton_Height
   uint8_t Number;
   //CRC16, CCITT, seed=0, final=0, FTTT = 0, Checksum = 0
   uint16_t Checksum;
   union
   {
      uint8_t Payload [Lepton_Packet_Payload_Size];
      uint16_t Line [Lepton_Width];
   };
};
Clone this wiki locally