Lepton sensor on the DISCO-F746NG board. Based on the rapberry_pi example code at https://github.com/groupgets/LeptonModule

Dependencies:   mbed-src BSP_DISCO_F746NG LCD_DISCO_F746NG

Committer:
Patrik Ryd
Date:
Wed Dec 09 11:09:08 2015 +0100
Revision:
2:a0eb7bff9571
Parent:
1:fcfdd41f22a7
Child:
3:3b3517e9fa11
Added palettes.cpp "stolen" from the lepton example code.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pryd 0:291e05a4e8e9 1 #include "mbed.h"
pryd 0:291e05a4e8e9 2
pryd 0:291e05a4e8e9 3 #define LEPTON_FRAME_SIZE (164)
pryd 0:291e05a4e8e9 4
pryd 0:291e05a4e8e9 5 Serial pc(USBTX, USBRX);
pryd 0:291e05a4e8e9 6 SPI lepton_spi(SPI_MOSI, SPI_MISO, SPI_SCK);
pryd 0:291e05a4e8e9 7 DigitalOut spi_cs(SPI_CS);
pryd 0:291e05a4e8e9 8
Patrik Ryd 2:a0eb7bff9571 9 static uint8_t lepton_frame[LEPTON_FRAME_SIZE];
Patrik Ryd 1:fcfdd41f22a7 10 static uint16_t lepton_image[80][80];
pryd 0:291e05a4e8e9 11
Patrik Ryd 2:a0eb7bff9571 12 void setup(void)
Patrik Ryd 2:a0eb7bff9571 13 {
Patrik Ryd 2:a0eb7bff9571 14 lepton_spi.format(8,3);
Patrik Ryd 2:a0eb7bff9571 15 lepton_spi.frequency(20000000);
Patrik Ryd 2:a0eb7bff9571 16 spi_cs = 1;
Patrik Ryd 2:a0eb7bff9571 17 spi_cs = 0;
Patrik Ryd 2:a0eb7bff9571 18 spi_cs = 1;
Patrik Ryd 2:a0eb7bff9571 19 wait_ms(185);
Patrik Ryd 2:a0eb7bff9571 20 }
Patrik Ryd 2:a0eb7bff9571 21
Patrik Ryd 2:a0eb7bff9571 22 void get_frame(void)
Patrik Ryd 2:a0eb7bff9571 23 {
Patrik Ryd 2:a0eb7bff9571 24 int i;
Patrik Ryd 2:a0eb7bff9571 25
Patrik Ryd 2:a0eb7bff9571 26 spi_cs = 0;
Patrik Ryd 2:a0eb7bff9571 27 for(i=0;i<LEPTON_FRAME_SIZE;i++) {
Patrik Ryd 2:a0eb7bff9571 28 lepton_frame[i] = leptonspi.write(0x00);
Patrik Ryd 2:a0eb7bff9571 29 }
Patrik Ryd 2:a0eb7bff9571 30 spi_cs = 1;
Patrik Ryd 2:a0eb7bff9571 31 }
Patrik Ryd 2:a0eb7bff9571 32
pryd 0:291e05a4e8e9 33 int main()
pryd 0:291e05a4e8e9 34 {
pryd 0:291e05a4e8e9 35 pc.printf("Alive\n");
pryd 0:291e05a4e8e9 36
pryd 0:291e05a4e8e9 37 }