Adafruit RGB матрица и bmp

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Добрый день. Имеется  Adafruit 32х32 RGB матрица.

Все примеры из библиотек  RGB Matrix Panel и Adafruit GFX Library прекрасно работают. Необходимо вывести bmp картинку.

Есть пример colorwheel_progmem_32x32 в котором изображение храниться в PROGMEM. Начинаю разбираться. Количество светодиодов в матрице 1024, а в image.h хранится 1528 значений. Каждый цвет может быть представлен 3мя или 4мя битами. В данном примере изображение выводится из буфера, я так понимаю, с помощью функции 











void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
			      const uint8_t *bitmap, int16_t w, int16_t h,
			      uint16_t color) {

  int16_t i, j, byteWidth = (w + 7) / 8;

  for(j=0; j<h; j++) {
    for(i=0; i<w; i++ ) {
      if(pgm_read_byte(bitmap + j * byteWidth + i / 8) & (128 >> (i & 7))) {
	drawPixel(x+i, y+j, color);
      }
    }
  }
}

но количество значений не совпадает. Начал уже разбираться с форматом bmp файла.

Помогите разобраться с выводом графики на матрицу, с преобразованием bmp изображения в PROGMEM или может стоит попробовать размещать изображение на sd карте а потом вытаскивать значения цвета из определённой области файла и с помощью matrix.drawPixel (matrix.Color333 или matrix.Color444) в цикле выводить это на матрицу?

Заранее спасибо за ответы!

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Ребят, очень сильно нужно решить вопрос. Готов подкинуть на пивко (сок) по результатам. Help!!!

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

а причем здесь BMP. у вас сконвертированное изображение в массив байтов. в нокиевских дисплеях например обычно люди используют 16 бит на цвет(да и я, так проще). нужно посмотреть вашу картинку, точнее код чтобы понять как там все устроено. и желательно оригинал картинки

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Картинку конвертировал через

http://www.henningkarlsen.com/electronics/t_imageconverter565.php

проблема в том, что изображение в примере кодировано в uint8_t и значений намного больше чем 32х32 пикселя, а по ссылке идёт кодировка в uint16_t. Картинка используется любая размером 32х32рх

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

если 8битный у вас пример. какая же там кодировка цвета. может там просто также 16 бит на цвет, но записывается 2 байта по отдельности

откройте в любом редакторе и посмотрете сколько у вас значений в массиве для 32х32 пикселей. не 2048 случаем. посчитайте сколько в строке и умножте на количество строк

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Конвертер делает 1024 16ти битных значений, а в примере с либой (image.h) 1528 8ми. 

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

получается 12бит на цвет. причет для одного пискселя берется 1байт и половина соседнего байта. мда не очень удобно

я такого конвертера даже не видел. лучше переходите на 16 бит на цвет

хотя уже у вас либа есть. нужен конвертер

только не понял изображение из примера не выводится нормлаьно?

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Изображение из примера выводится отлично! Нужен либо конвертер, либо подправить либу чтоб можно было выводить свои изображения

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

попробуйте вывести такое изображение

0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd9, 0xe3, 0xd2, 0xf2, 0xed, 0xed, 0xff, 0xfd, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa8, 0xba, 0xa6, 0x41, 0x6d, 0x39, 0x00, 0x32, 0x00, 0x00, 0xdf, 0x00, 0x00, 0xff, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x33, 0x00, 0x5c, 0xc0, 0x40, 0x6f, 0xc1, 0x58, 0xcf, 0xea, 0xc8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xae, 0xde, 0xa2, 0x55, 0xb2, 0x40, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xff, 0x00, 0x01, 0xf0, 0x03, 0x0f, 0x49, 0x12, 0x14, 0x24, 0x17, 0x0e, 0x31, 0x12, 0x1e, 0x54, 0x1a, 0x57, 0xc3, 0x38, 0x3d, 0xab, 0x22, 0x85, 0xca, 0x73, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0x6a, 0xc2, 0x57, 0x04, 0x5d, 0x00, 0x00, 0x07, 0x00, 0x00, 0x19, 0x00, 0x02, 0x2a, 0x01, 0x01, 0xa7, 0x01, 0x00, 0x72, 0x01, 0x08, 0x14, 0x09, 0x0e, 0x3b, 0x0f, 0x10, 0x49, 0x12, 0x13, 0x31, 0x15, 0x0b, 0x27, 0x12, 0x38, 0x7c, 0x2b, 0x5a, 0xbf, 0x3c, 0x4f, 0xb4, 0x36, 0x58, 0xb6, 0x3d, 0xdc, 0xef, 0xd6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0x15, 0x5e, 0x10, 0x00, 0x3a, 0x00, 0x00, 0x57, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x59, 0x00, 0x01, 0x4e, 0x00, 0x01, 0x3b, 0x02, 0x00, 0xc4, 0x01, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x02, 0x61, 0x02, 0x07, 0x5a, 0x08, 0x04, 0x38, 0x09, 0x4e, 0xa4, 0x39, 0x62, 0xbe, 0x48, 0x61, 0xb9, 0x48, 0x56, 0xb5, 0x39, 0xa4, 0xd8, 0x95, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0x86, 0xab, 0x88, 0x00, 0x49, 0x00, 0x00, 0x55, 0x00, 0x01, 0x54, 0x00, 0x00, 0x54, 0x00, 0x01, 0x44, 0x02, 0x01, 0x35, 0x01, 0x00, 0xff, 0x00, 0x00, 0xff, 0x01, 0x01, 0xc7, 0x01, 0x00, 0x62, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x6d, 0x00, 0x09, 0x8a, 0x07, 0x56, 0xb4, 0x41, 0x6d, 0xbf, 0x53, 0x6c, 0xbf, 0x53, 0x68, 0xbd, 0x4e, 0x8d, 0xcd, 0x78, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xb1, 0xc5, 0xb2, 0x42, 0x7d, 0x42, 0x00, 0x4c, 0x00, 0x00, 0x53, 0x00, 0x04, 0x62, 0x02, 0x00, 0x6a, 0x01, 0x01, 0x26, 0x01, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x82, 0x01, 0x01, 0x68, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x78, 0x00, 0x05, 0x89, 0x03, 0x1d, 0x90, 0x16, 0x50, 0xae, 0x3d, 0x7d, 0xc7, 0x62, 0x77, 0xc3, 0x5e, 0x77, 0xc1, 0x5c, 0x82, 0xc7, 0x6c, 0xfc, 0xfd, 0xfb, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xbc, 0xd9, 0xbc, 0x8b, 0xa7, 0x8e, 0x10, 0x5d, 0x10, 0x00, 0x4e, 0x00, 0x18, 0x84, 0x11, 0x00, 0x78, 0x00, 0x01, 0x1d, 0x01, 0x00, 0xff, 0x00, 0x01, 0xf9, 0x00, 0x00, 0x5a, 0x00, 0x01, 0x6c, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x87, 0x01, 0x00, 0x82, 0x00, 0x2c, 0x9a, 0x1e, 0x12, 0x89, 0x0e, 0x44, 0xa6, 0x39, 0x8a, 0xcc, 0x6c, 0x81, 0xc6, 0x68, 0x84, 0xc8, 0x6b, 0x82, 0xc8, 0x68, 0xea, 0xf5, 0xe5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xd0, 0xf4, 0xd1, 0x7c, 0xbe, 0x7c, 0x7f, 0xbb, 0x82, 0x21, 0x72, 0x1c, 0x17, 0x83, 0x10, 0x00, 0x79, 0x00, 0x01, 0x23, 0x01, 0x01, 0xff, 0x01, 0x01, 0xb6, 0x01, 0x00, 0x63, 0x00, 0x01, 0x6b, 0x00, 0x00, 0x79, 0x01, 0x00, 0x87, 0x01, 0x00, 0x83, 0x00, 0x21, 0x95, 0x15, 0x27, 0x96, 0x1d, 0x0c, 0x86, 0x0c, 0x33, 0x9c, 0x2f, 0x98, 0xd3, 0x7b, 0x8d, 0xcb, 0x76, 0x8f, 0xcc, 0x77, 0x89, 0xc9, 0x6e, 0xd8, 0xec, 0xce, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xe5, 0xf5, 0xe5, 0x77, 0xd3, 0x79, 0x8d, 0xda, 0x90, 0x3f, 0xa7, 0x3b, 0x12, 0x7c, 0x0b, 0x00, 0x77, 0x00, 0x01, 0x2e, 0x01, 0x00, 0xff, 0x01, 0x02, 0x72, 0x01, 0x00, 0x6a, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x86, 0x01, 0x00, 0x87, 0x00, 0x00, 0x86, 0x00, 0x17, 0x94, 0x0d, 0x34, 0xa1, 0x22, 0x22, 0x96, 0x1a, 0x0b, 0x88, 0x0e, 0x1a, 0x8d, 0x1d, 0x97, 0xd1, 0x7d, 0x9a, 0xd1, 0x82, 0x9b, 0xd1, 0x85, 0x90, 0xcc, 0x77, 0xbf, 0xe1, 0xb1, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xfa, 0xfd, 0xf9, 0x74, 0xd0, 0x77, 0x8a, 0xdb, 0x8e, 0x3f, 0xaa, 0x3c, 0x29, 0x9c, 0x26, 0x00, 0x73, 0x00, 0x00, 0x3b, 0x00, 0x01, 0xff, 0x01, 0x00, 0x5c, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x80, 0x00, 0x00, 0x75, 0x00, 0x00, 0x66, 0x00, 0x01, 0x67, 0x00, 0x05, 0x6d, 0x03, 0x06, 0x70, 0x05, 0x00, 0x6e, 0x02, 0x00, 0x68, 0x00, 0x90, 0xd2, 0x74, 0xa9, 0xd5, 0x91, 0x9c, 0xd2, 0x86, 0x94, 0xce, 0x7b, 0xaa, 0xd8, 0x96, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x76, 0xd0, 0x79, 0x89, 0xd9, 0x8c, 0x43, 0xac, 0x42, 0x2c, 0x9e, 0x29, 0x2e, 0xa1, 0x2b, 0x00, 0x50, 0x01, 0x00, 0xb1, 0x00, 0x00, 0x6b, 0x00, 0x08, 0x5e, 0x07, 0x00, 0x75, 0x01, 0x01, 0x66, 0x01, 0x01, 0x63, 0x01, 0x00, 0x65, 0x00, 0x00, 0x66, 0x00, 0x00, 0x66, 0x00, 0x00, 0x65, 0x00, 0x00, 0x65, 0x00, 0x00, 0x5b, 0x00, 0x53, 0xae, 0x27, 0x45, 0xb9, 0x1b, 0x4b, 0xc1, 0x44, 0xb1, 0xd6, 0x97, 0x9e, 0xd2, 0x87, 0x97, 0xcf, 0x80, 0x9a, 0xd2, 0x84, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x86, 0xd5, 0x88, 0x87, 0xd8, 0x8a, 0x49, 0xb1, 0x47, 0x2a, 0x9c, 0x26, 0x2f, 0xa1, 0x2c, 0x2e, 0xa3, 0x2b, 0x12, 0x54, 0x0f, 0x12, 0x2d, 0x17, 0x0e, 0x44, 0x10, 0x00, 0x69, 0x00, 0x00, 0x66, 0x00, 0x00, 0x66, 0x00, 0x01, 0x67, 0x01, 0x01, 0x67, 0x01, 0x01, 0x67, 0x00, 0x00, 0x66, 0x01, 0x00, 0x5e, 0x00, 0x3a, 0x9e, 0x1e, 0x57, 0xb7, 0x2c, 0x5a, 0xb4, 0x2e, 0x0f, 0xae, 0x02, 0x1a, 0xb2, 0x18, 0xa4, 0xd3, 0x8b, 0xa5, 0xd4, 0x8d, 0x97, 0xcf, 0x80, 0xa6, 0xd6, 0x90, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9c, 0xdf, 0x9e, 0x85, 0xd7, 0x88, 0x4e, 0xb3, 0x4e, 0x29, 0x9c, 0x27, 0x2d, 0x9e, 0x2a, 0x34, 0xa3, 0x2b, 0x5a, 0xba, 0x24, 0x19, 0x40, 0x17, 0x01, 0x58, 0x03, 0x00, 0x68, 0x00, 0x00, 0x67, 0x00, 0x01, 0x67, 0x01, 0x01, 0x67, 0x01, 0x01, 0x67, 0x00, 0x00, 0x66, 0x01, 0x00, 0x60, 0x00, 0x23, 0x8d, 0x14, 0x3e, 0xa8, 0x23, 0x39, 0xa3, 0x21, 0x3c, 0xa3, 0x22, 0x43, 0xa6, 0x25, 0x00, 0xac, 0x00, 0x00, 0x9d, 0x00, 0x70, 0xc4, 0x60, 0xb0, 0xd7, 0x97, 0x96, 0xce, 0x7d, 0xb8, 0xde, 0xa6, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb3, 0xe8, 0xb3, 0x82, 0xd6, 0x85, 0x54, 0xb7, 0x54, 0x29, 0x9c, 0x25, 0x2c, 0x9e, 0x2b, 0x3c, 0xa6, 0x28, 0x54, 0xb3, 0x22, 0x50, 0xb6, 0x26, 0x0c, 0x76, 0x07, 0x00, 0x61, 0x00, 0x01, 0x66, 0x01, 0x00, 0x66, 0x00, 0x01, 0x67, 0x00, 0x00, 0x66, 0x01, 0x00, 0x63, 0x00, 0x11, 0x7e, 0x0d, 0x27, 0x98, 0x1d, 0x23, 0x93, 0x19, 0x24, 0x94, 0x1a, 0x26, 0x95, 0x1a, 0x29, 0x94, 0x1e, 0x1e, 0x9e, 0x16, 0x00, 0xa3, 0x00, 0x00, 0x9d, 0x00, 0x29, 0xaf, 0x23, 0xa6, 0xd6, 0x8d, 0x8f, 0xcc, 0x74, 0xcd, 0xea, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0xee, 0xc9, 0x81, 0xd9, 0x81, 0x59, 0xbb, 0x5a, 0x28, 0x9b, 0x25, 0x2b, 0x9d, 0x2b, 0x48, 0xac, 0x26, 0x4c, 0xaf, 0x22, 0x43, 0xab, 0x22, 0x40, 0xb0, 0x27, 0x16, 0x83, 0x0f, 0x00, 0x62, 0x00, 0x00, 0x66, 0x00, 0x00, 0x67, 0x00, 0x00, 0x64, 0x00, 0x02, 0x72, 0x06, 0x0a, 0x88, 0x12, 0x0a, 0x83, 0x12, 0x0b, 0x82, 0x12, 0x0d, 0x80, 0x13, 0x0d, 0x81, 0x14, 0x0d, 0x90, 0x0f, 0x0c, 0x9e, 0x0b, 0x00, 0xa4, 0x00, 0x00, 0xa2, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x9a, 0x00, 0xd9, 0xe8, 0xd0, 0x97, 0xbe, 0x89, 0xf3, 0xf6, 0xf2, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xf5, 0xe0, 0x7d, 0xda, 0x7d, 0x61, 0xbf, 0x61, 0x28, 0x9a, 0x24, 0x2a, 0x9c, 0x2c, 0x4e, 0xb0, 0x22, 0x45, 0xac, 0x23, 0x3b, 0xa8, 0x23, 0x33, 0xa4, 0x22, 0x2f, 0xa9, 0x28, 0x00, 0x69, 0x01, 0x00, 0x63, 0x01, 0x00, 0x62, 0x00, 0x00, 0x68, 0x03, 0x00, 0x72, 0x0b, 0x00, 0x6f, 0x0b, 0x00, 0x7f, 0x09, 0x00, 0x93, 0x06, 0x00, 0xa5, 0x02, 0x00, 0xb3, 0x00, 0x00, 0xb3, 0x00, 0x00, 0xb0, 0x00, 0x02, 0xa3, 0x02, 0x00, 0xa4, 0x00, 0x15, 0x9f, 0x12, 0x4a, 0x8a, 0x3f, 0x78, 0xae, 0x73, 0xbe, 0xcf, 0xb7, 0xdd, 0xe7, 0xdb, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xfc, 0xf8, 0x79, 0xd8, 0x7c, 0x57, 0xc6, 0x58, 0x27, 0x9b, 0x24, 0x31, 0xa0, 0x2b, 0x4b, 0xae, 0x22, 0x3e, 0xa9, 0x22, 0x36, 0xa4, 0x22, 0x2c, 0xa1, 0x22, 0x23, 0xa1, 0x24, 0x09, 0x7a, 0x0f, 0x1d, 0x83, 0x00, 0x09, 0x7a, 0x02, 0x00, 0x8b, 0x06, 0x00, 0xa0, 0x03, 0x01, 0xb2, 0x00, 0x00, 0xb6, 0x00, 0x00, 0xb3, 0x00, 0x00, 0xb1, 0x00, 0x00, 0xb1, 0x00, 0x01, 0xa9, 0x01, 0x00, 0xbc, 0x01, 0x00, 0xeb, 0x00, 0x1e, 0x94, 0x1b, 0x47, 0x8a, 0x3c, 0x30, 0x88, 0x27, 0x0c, 0x79, 0x06, 0xa6, 0xc6, 0xa0, 0xd4, 0xe0, 0xcf, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7c, 0xd8, 0x7d, 0x5b, 0xca, 0x5b, 0x00, 0x99, 0x00, 0x3d, 0xa7, 0x2b, 0x43, 0xab, 0x22, 0x38, 0xa6, 0x22, 0x2f, 0xa2, 0x22, 0x24, 0x9e, 0x22, 0x1d, 0x9c, 0x22, 0x01, 0x83, 0x1e, 0x70, 0xd5, 0x00, 0x74, 0xe0, 0x01, 0x12, 0xb7, 0x00, 0x00, 0xb0, 0x00, 0x00, 0xb0, 0x00, 0x00, 0xaf, 0x00, 0x00, 0xb0, 0x00, 0x00, 0xaf, 0x00, 0x00, 0xa7, 0x00, 0x01, 0xc7, 0x01, 0x00, 0xff, 0x00, 0x0a, 0x8f, 0x08, 0x31, 0x83, 0x28, 0x1a, 0x83, 0x13, 0x0c, 0x7e, 0x06, 0x00, 0x76, 0x00, 0x16, 0x80, 0x14, 0xdb, 0xe2, 0xd5, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xdd, 0x8f, 0x60, 0xce, 0x60, 0x00, 0x81, 0x00, 0x24, 0x67, 0x1a, 0x40, 0xb3, 0x25, 0x32, 0xa3, 0x21, 0x27, 0xa0, 0x23, 0x20, 0x9b, 0x22, 0x12, 0x96, 0x24, 0x26, 0xa7, 0x1b, 0x88, 0xee, 0x00, 0x68, 0xd5, 0x00, 0x62, 0xca, 0x01, 0x21, 0xb2, 0x01, 0x00, 0xae, 0x00, 0x00, 0xb0, 0x00, 0x00, 0xb0, 0x00, 0x01, 0xa5, 0x01, 0x01, 0xd9, 0x01, 0x00, 0xff, 0x01, 0x01, 0x58, 0x01, 0x02, 0x31, 0x03, 0x07, 0x82, 0x02, 0x00, 0x77, 0x00, 0x00, 0x73, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x52, 0x00, 0x8d, 0xb1, 0x88, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa3, 0xe4, 0xa4, 0x66, 0xd3, 0x67, 0x01, 0x6f, 0x01, 0x12, 0x4a, 0x16, 0x25, 0x7d, 0x1a, 0x2e, 0xa9, 0x25, 0x24, 0xa2, 0x25, 0x18, 0x9a, 0x21, 0x00, 0x73, 0x16, 0x76, 0xdf, 0x02, 0x7d, 0xe6, 0x00, 0x67, 0xd4, 0x00, 0x58, 0xc8, 0x00, 0x4d, 0xba, 0x01, 0x28, 0xad, 0x00, 0x00, 0xb1, 0x00, 0x01, 0xa7, 0x01, 0x01, 0xee, 0x01, 0x00, 0xff, 0x01, 0x01, 0x39, 0x01, 0x00, 0x35, 0x01, 0x01, 0x38, 0x01, 0x00, 0x77, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x64, 0x00, 0x07, 0x6b, 0x05, 0x00, 0x4a, 0x00, 0x16, 0x63, 0x19, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xe4, 0xba, 0x6a, 0xdb, 0x6c, 0x06, 0x56, 0x08, 0x15, 0x54, 0x16, 0x13, 0x59, 0x15, 0x19, 0x87, 0x16, 0x02, 0x6d, 0x03, 0x00, 0x5c, 0x00, 0x17, 0x79, 0x00, 0x9c, 0xff, 0x00, 0x7a, 0xe3, 0x00, 0x68, 0xd5, 0x00, 0x5b, 0xcb, 0x00, 0x4b, 0xc0, 0x00, 0x3f, 0xb5, 0x02, 0x1c, 0x90, 0x01, 0x00, 0xef, 0x01, 0x00, 0xd7, 0x00, 0x01, 0x27, 0x01, 0x00, 0x38, 0x01, 0x01, 0x35, 0x01, 0x01, 0x47, 0x01, 0x01, 0x6b, 0x01, 0x00, 0x5c, 0x00, 0x10, 0x78, 0x0c, 0x34, 0xb0, 0x26, 0x13, 0x82, 0x10, 0x1a, 0x72, 0x00, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x51, 0xc1, 0x4c, 0x0d, 0x42, 0x0e, 0x16, 0x53, 0x17, 0x15, 0x69, 0x14, 0x14, 0x75, 0x14, 0x10, 0x71, 0x0e, 0x00, 0x58, 0x00, 0x7f, 0xe0, 0x01, 0x96, 0xfd, 0x01, 0x85, 0xee, 0x01, 0x70, 0xde, 0x00, 0x41, 0xaf, 0x01, 0x17, 0x84, 0x01, 0x00, 0x62, 0x01, 0x03, 0x64, 0x01, 0x20, 0x84, 0x03, 0x10, 0x45, 0x03, 0x00, 0x32, 0x01, 0x00, 0x2f, 0x01, 0x01, 0x50, 0x02, 0x00, 0xff, 0x01, 0x00, 0x5f, 0x00, 0x0a, 0x6f, 0x07, 0x30, 0xac, 0x23, 0x2c, 0xa2, 0x1f, 0x16, 0x89, 0x17, 0x5b, 0xb6, 0x00, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x72, 0xc3, 0x64, 0x00, 0x90, 0x00, 0x12, 0x58, 0x15, 0x15, 0x71, 0x14, 0x14, 0x75, 0x13, 0x15, 0x76, 0x15, 0x0b, 0x6d, 0x14, 0x92, 0xf3, 0x01, 0x55, 0xbb, 0x00, 0x1a, 0x82, 0x01, 0x00, 0x58, 0x02, 0x00, 0x5b, 0x00, 0x0d, 0x71, 0x02, 0x27, 0x87, 0x03, 0x30, 0x8f, 0x05, 0x2b, 0x8a, 0x05, 0x2f, 0x93, 0x04, 0x20, 0x6b, 0x04, 0x00, 0x76, 0x01, 0x00, 0xff, 0x01, 0x00, 0xff, 0x00, 0x08, 0x7c, 0x06, 0x2f, 0xa8, 0x23, 0x2c, 0x99, 0x20, 0x28, 0xb6, 0x1f, 0x00, 0x44, 0x01, 0x98, 0xfc, 0x00, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xe4, 0xc5, 0x34, 0xbe, 0x36, 0x00, 0xa1, 0x00, 0x16, 0x70, 0x17, 0x14, 0x74, 0x13, 0x13, 0x74, 0x13, 0x14, 0x75, 0x14, 0x07, 0x66, 0x16, 0x00, 0x5b, 0x07, 0x00, 0x62, 0x01, 0x1b, 0x7d, 0x03, 0x2e, 0x8e, 0x04, 0x2d, 0x8c, 0x05, 0x27, 0x86, 0x05, 0x22, 0x81, 0x04, 0x2f, 0x8f, 0x03, 0x2c, 0x97, 0x03, 0x2e, 0xa4, 0x01, 0x2e, 0xac, 0x01, 0x0c, 0xe5, 0x01, 0x00, 0xff, 0x00, 0x25, 0xb6, 0x1c, 0x2f, 0x9c, 0x20, 0x1e, 0xd9, 0x19, 0x11, 0xff, 0x17, 0x17, 0x94, 0x03, 0xa6, 0xff, 0x00, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0xe0, 0x8e, 0x1d, 0x91, 0x1e, 0x10, 0x6b, 0x10, 0x13, 0x74, 0x13, 0x11, 0x72, 0x15, 0x10, 0x6f, 0x17, 0x1d, 0x7f, 0x11, 0x38, 0xa1, 0x06, 0x3a, 0xa2, 0x01, 0x27, 0x87, 0x04, 0x20, 0x81, 0x04, 0x25, 0x85, 0x04, 0x4d, 0xb0, 0x02, 0x6c, 0xd3, 0x02, 0x70, 0xde, 0x00, 0x51, 0xc3, 0x01, 0x2a, 0xa0, 0x00, 0x28, 0x9c, 0x00, 0x2e, 0x91, 0x00, 0x1b, 0xb8, 0x00, 0x12, 0x9d, 0x0c, 0x00, 0x6a, 0x01, 0x18, 0xff, 0x1a, 0x0c, 0xf1, 0x15, 0x54, 0xea, 0x04, 0xa6, 0xff, 0x0a, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbb, 0xe7, 0xbc, 0x59, 0xfb, 0x5b, 0x1c, 0x91, 0x1e, 0x0f, 0x6a, 0x14, 0x20, 0x84, 0x0f, 0x36, 0xa1, 0x04, 0x3a, 0xa7, 0x00, 0x32, 0xa0, 0x00, 0x3a, 0xa7, 0x01, 0x57, 0xb6, 0x01, 0x7f, 0xd7, 0x03, 0x9e, 0xff, 0x00, 0x8d, 0xf2, 0x00, 0x7c, 0xe1, 0x00, 0x6d, 0xd3, 0x00, 0x60, 0xc6, 0x00, 0x50, 0xca, 0x08, 0x3b, 0xce, 0x22, 0x3a, 0xe2, 0x33, 0x45, 0xff, 0x4b, 0x4a, 0xff, 0x4e, 0x2d, 0xd3, 0x1f, 0x05, 0x71, 0x00, 0x00, 0x29, 0x00, 0x8b, 0xf5, 0x00, 0xa0, 0xea, 0x1c, 0xd4, 0xce, 0xb4, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4, 0xf7, 0xf4, 0x2f, 0xf6, 0x32, 0x32, 0xd1, 0x2c, 0x29, 0x93, 0x02, 0x3c, 0xa5, 0x00, 0x50, 0xb7, 0x00, 0x71, 0xd2, 0x00, 0x91, 0xe8, 0x00, 0xa4, 0xf0, 0x00, 0xa1, 0xe7, 0x00, 0x9e, 0xdb, 0x07, 0x97, 0xdd, 0x0e, 0x72, 0xf3, 0x05, 0x60, 0xf4, 0x25, 0x49, 0xfb, 0x37, 0x3c, 0xff, 0x4c, 0x48, 0xff, 0x45, 0x54, 0xff, 0x2c, 0x59, 0xea, 0x1b, 0x55, 0xc6, 0x0c, 0x4f, 0xa6, 0x08, 0x4f, 0x9a, 0x17, 0x57, 0x99, 0x27, 0x5e, 0x8b, 0x35, 0xa1, 0xb0, 0x47, 0xab, 0x9d, 0x6b, 0xc5, 0xbf, 0x83, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb1, 0xe0, 0x99, 0x5e, 0xc0, 0x2b, 0x5c, 0xcc, 0x43, 0x5b, 0xdf, 0x43, 0x77,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, 0xff, 0xf5, 0xfd, 0xed, 0xe3, 0xf7, 0xcd, 0xe6, 0xf8, 0xd2, 0xe9, 0xf8, 0xd6, 0xea, 0xfa, 0xd7, 0xec, 0xfc, 0xd9, 0xec, 0xfb, 0xd9, 0xed, 0xfd, 0xd7, 0xed, 0xfd, 0xd6, 0xef, 0xfd, 0xd6, 0xeb, 0xff, 0xce, 0xed, 0xfe, 0xce, 0xef, 0xff, 0xd1, 0xef, 0xff, 0xd2, 0xf0, 0xff, 0xd3, 0xf2, 0xff, 0xd5, 0xee, 0xff, 0xce, 0xf0, 0xff, 0xd6, 0xf1, 0xff, 0xdb, 0xf1, 0xff, 0xda, 0xf3, 0xfe, 0xe2, 0xf3, 0xfe, 0xe6, 0xf8, 0xfe, 0xf1

 

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

ничего нет :(

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

вообще? как минимум мусор должен быть. пример загрузите и проверьте все работает или нет

как вставляли код?

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Всё перепроверил, демо работает. Код вставлял как обычно, скопировал из форума и вставил в h-ку

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

понятно. точнее непонятно почему даже мусора нет

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

во во

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

ну тогда только либу переписывать на 16бит

std
Offline
Зарегистрирован: 05.01.2012

И чего неудобно в 12-битной кодировке? этож то же самое что Quoted-printable, только вдвое длиннее (или короче?). Короче не важно, важно что примеры работают, формат известен, но левый конвертер обломал весь кайф из-за несоответствия кодировки.

Вывод очевиден.

Курочить библиотеку не надо. Мутить 16-битную кодировку в скетче тоже не надо, это потребует на треть бОльшего объёма оперативной памяти. Надо написать свой собственный конвертер, с дамами и картишками - имхо, это будет самое простое решение. Так как некогда я занимался баловством с LSB стеганографией для BMP файла, думаю не будет особенно сложно что-то подобное зафигачить. Тем более что запись будет не обратно в BMP, а в виде простого текста.

Пишу на FPC. Если собрать exe-шник, на него ругается Аваст; впрочем это болезнь многих консольных компиляторов типа gcc и т. п. Лечится исключениями.

Сразу предупреждаю что может возникнуть проблема с преобразованием цвета (имеется в виду из полноцветной картинки), но как я понимаю - 12 бит это три цвета, значит палитра 16 цветов. В фотошопе привести картинку к 16 цветам можно, так что это вроде бы тоже решаемо.

 

Итак, жду массива (который в image.h) который выводит рабочую картинку, плюс оригинал картинки. Это достаточно интересная задача, чтобы подумать.

Кстати, для антивирусов возможны костыли. Можно, к примеру, перевести программу на PHP и запустить на заранее установленном Denwer'е (такой домашний web-сервер, иначе выражаясь - маленький интернет на собственном компьютере). Но ессно это костыли, т. к. вывод будет дольше, плюс PHP имеет отграничение на время выполнения, ну и в общем - костыли. Но возможно.

Короче, одну задачу возможно решить множеством способов.

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

12 бит делается просто. берется 4 старших бита от каждого цвета. но это нужно уметь писать программы для windows или другой фигни

а насчет конвертета вы зря. очень удобная штука. поддерживает несколько самых распрастранненых кодировок и меня полностью устраивает

std
Offline
Зарегистрирован: 05.01.2012

jeka_tm

Ну я не говорю что конвертер совсем негодный, но я так понимаю что автору темы не подходит.

Просто можно запилить свой.

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

если вы можете написать программу и есть время помогите ТС, я уже написал как разбить цвета

__Alexander
Offline
Зарегистрирован: 24.10.2012

у одного меня если 1024 умножить на 12 бит получается 1536, что совсем не 1528?

 

не поверил и проверил. в h файле таки 1536 байт.

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

насчет количества я тоже заметил, но это неважно. принцип важнее. таких конвертеров я не встречал

__Alexander
Offline
Зарегистрирован: 24.10.2012

если посмотреть h файл, то сильно смутно там 12 бит закодировано. 

jeka_tm
jeka_tm аватар
Offline
Зарегистрирован: 19.05.2013

а что тогда? если 16 бить то зачем разбивать?

почитайте либу к модулю, там что нибудь должно быть написано про кодировку цвета

std
Offline
Зарегистрирован: 05.01.2012

Конец дампа изменяется, и плюс там не нули, хотя по логике кодировки, при заливке чёрным цветом, дожны быть нули. Кодировка 5,6,5, И есть лишние 16 байт (всего 194*8=1552, а картинка - 32*32*3*4/8=1536) и хз как они заполняются. В общем, создатели либы явно что-то умалчивают.

Зато у библиотеки есть функция преобразования цвета из нормальной кодировки (3,3,3 или 4,4,4) и вывод. Так что можно сделать "чёрный ящик"-преобразователь картинки, принимающий картинку по сериалу в удобоваримом формате, а назад отдающий дамп. Скармливать "ящику" исходную картинку будет программа, работающая с FTDI драйвером, чтобы не заниматься копипастой через Serial monitor.

Щас попробую запилить, и посмотрим как результат.

std
Offline
Зарегистрирован: 05.01.2012
  0xFB,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,
  0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0x7D,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xDF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,
  0xFB,0xFF,0xFF,0xFF,0xDD,0xFF,0xFF,0xFF,
  0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xDD,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,
  0xFA,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,
  0xFF,0xFA,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xDF,0xFF,0xFF,0xFF,0xFF,0xFA,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7D,0xFF,
  0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,0xFF,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xFB,0xFF,0xFF,
  0xFF,0xDD,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,
  0xFF,0xFF,0xDD,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFA,0xFF,0xFF,
  0xFF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFA,0xFF,
  0xFF,0x02,0x6F,0x0A,0x47,0x02,0x2B,0x02

показывает что-нибудь?

если не хочет, может быть в конце надо дописать:

  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,

или то же самое, но с нулями.

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Сорри за молчание, выходные....

Код показывает на белом фоне диагональные голубые линии, местами в этих линиях есть жёлтые и фиолетовые цвета

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Модераторы, перенесите тему в ветку "Ищу исполнителя"

std
Offline
Зарегистрирован: 05.01.2012

maloicds, должен быть такой вырвиглазный котэ:

хоть малость похожа картинка на него?

Желательно фотку сделать.

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Котэ зачётный, а вот картинка не похожа на то, что на матрице :(

std
Offline
Зарегистрирован: 05.01.2012

Поменял цикл, может быть так:

  0xDB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xDF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,
  0xF9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF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FF,
  0xFF,0xFF,0xFF,0xFF,0xFA,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFA,
  0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,
  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF5,0xFF,
  0xFF,0x02,0x6F,0x0A,0x47,0x02,0x2B,0x02

хотя по мне, много белого (0xFF), но хз может картинка такая, в 16 цветах непонятно.

ваще хз, что можно было упустить, ибо программа проста как свободный затвор. Вот сам исходник:

uses D2XXUnit,crt;

var bmp_in,h_out:file of char;    // files
    i,j:integer;                            // counter
    wid,hei:integer;                        // image size
    rs:integer;                             // row size
    c:char;                                 // read/write buffer
    
    Selected_Device_Serial_Number : String;
    Selected_Device_Description : String;
    s:string;
    founddevices: array[0..15] of array[0..1] of string;
    r : Integer; DeviceIndex : DWord;

procedure imgsend;
begin
  FT_Enable_Error_Report := true;
  i := Write_USB_Device_Buffer(3072);
  if i <> 3072 then writeln('Error: USB write timed out.');
end;

procedure imgrecv;
begin
  for i:=0 to 8521 do FT_In_Buffer[i]:=0;
  FT_Enable_Error_Report := true;
  i := Read_USB_Device_Buffer(8522);
  if i <> 8522 then writeln('Error: USB read timed out.') else begin
   for i:=5 to 8521 do write(h_out,chr(FT_In_Buffer[i]));
  end;
end;

procedure mainconv;
begin

 // setup FTDI
  
  if Open_USB_Device_By_Serial_Number(Selected_Device_Serial_Number) <> FT_OK
  then writeln('Error opening device.') else begin
    writeln('Device: '+Selected_Device_Description+', S/N: '+Selected_Device_Serial_Number+'.');
    Reset_USB_Device;
    Set_USB_Device_RTS;
    Set_USB_Device_DTR;
    FT_Current_Baud := FT_BAUD_9600;
    Set_USB_Device_BaudRate;
    FT_Current_DataBits := FT_DATA_BITS_8;
    FT_Current_StopBits := FT_STOP_BITS_1;
    FT_Current_Parity := FT_PARITY_NONE;
    Set_USB_Device_DataCharacteristics;
    FT_Current_FlowControl := FT_FLOW_NONE;
    Set_USB_Device_FlowControl;
    Set_USB_Device_TimeOuts(10000,4000);

 // process BMP

    for i:=1 to hei do begin
     for j:=1 to rs do begin
      read(bmp_in,c);
      if(j<=wid*3) then begin
        FT_Out_Buffer[((32-i)*32*3)+j]:=ord(c);
      end;
     end;
    end;
    imgsend;
    imgrecv;

 // close

    if Close_USB_Device=FT_OK then writeln('Device closed.');
  end;
end;

begin

 // check parameters

  if(paramcount<2) then begin
   writeln('CALL: ',paramstr(0),' <bmp_in_file> <h_out_file>');
   halt;
  end;

 // open files

  {$I-}
  assign(bmp_in,paramstr(1));       // BMP source
  reset(bmp_in);
  if(ioresult<>0) then begin
   writeln('Error opening source file.');
   halt;
  end;
  assign(h_out,paramstr(2));       // H destiniation
  reset(h_out);
  if(ioresult<>0) then begin
   writeln('Error opening destiniation file.');
   halt;
  end;
  {$I+}

 // parse header

  for i:=1 to 54 do begin
   read(bmp_in,c);
   if(i=19) then wid:=ord(c);
   if(i=20) then wid:=wid+ord(c)*256;
   if(i=23) then hei:=ord(c);
   if(i=24) then hei:=hei+ord(c)*256;
  end;

  if((wid<>32) or (hei<>32)) then begin
   writeln('Error: image dimensions differ from 32x32.');
   halt;
  end;

 // calc BMP padding

  i:=wid*3;
  rs:=4-(i mod 4);
  if(rs<4) then rs:=i+rs else rs:=i;

 // start FTDI

  FT_Enable_Error_Report := true;
  GetFTDeviceCount;
  if FT_Device_Count=0 then begin
    writeln('No FTDi USB devices found in system.');
    halt;
  end;
  DeviceIndex := 0;
  If FT_Device_Count=1 then begin
    GetFTDeviceSerialNo(DeviceIndex);
    Selected_Device_Serial_Number:=FT_Device_String;
    GetFTDeviceDescription (DeviceIndex);
    Selected_Device_Description:=FT_Device_String;
    mainconv;
  end else begin
    writeln('Multiple FTDi devices found. Select one to operate');
    for i := 1 to FT_Device_Count do Begin      
      GetFTDeviceSerialNo(DeviceIndex);
      Selected_Device_Serial_Number:=FT_Device_String;
      GetFTDeviceDescription (DeviceIndex);
      Selected_Device_Description:=FT_Device_String;
      writeln('Device ',DeviceIndex,': ',Selected_Device_Description,'; S/N: ',Selected_Device_Serial_Number);
      founddevices[DeviceIndex][0]:=Selected_Device_Description;
      founddevices[DeviceIndex][1]:=Selected_Device_Serial_Number;
      DeviceIndex := DeviceIndex + 1;
    end;
    readln(s);
    val(s,i,r);
    if(r<>0) then begin
      writeln('Invalid device number.');
      halt;
    end;
    writeln('Selected device: ',i);
    Selected_Device_Description:=founddevices[i][0];
    Selected_Device_Serial_Number:=founddevices[i][1];
    mainconv;
  end;

 // all done

  close(bmp_in);
  close(h_out);

end.

Для сборки необходим FPC и библиотека FTDI (назвать d2xxunit.pp, положить в том же каталоге где исходник):

{$ifdef FPC}
    {$mode delphi}
{$endif}
unit D2XXUnit;

interface
Uses Windows
    , SysUtils
    , Classes
    ;

Type FT_Result = Integer;


const
  FT_FLAGS_OPENED = 1;//FT_Device_Info_Node.Flags mask for IsOpen field

// Device Info Node structure for info list functions
type FT_Device_Info_Node = record
  Flags         : DWord;
  DeviceType    : Dword;
  ID            : DWord;
  LocID         : DWord;
  SerialNumber  : array [0..15] of Char;
  Description   : array [0..63] of Char;
  DeviceHandle  : DWord;
end;


type TDWordptr = ^DWord;

// Structure to hold EEPROM data for FT_EE_Program function
TFT_Program_Data = record
  Signature1        : DWord;
  Signature2        : DWord;
  Version           : DWord;
  VendorID          : Word;
  ProductID         : Word;
  Manufacturer      : PChar;
  ManufacturerID    : PChar;
  Description       : PChar;
  SerialNumber      : PChar;
  MaxPower          : Word;
  PnP               : Word;
  SelfPowered       : Word;
  RemoteWakeup      : Word;
// Rev4 extensions
  Rev4              : Byte;
  IsoIn             : Byte;
  IsoOut            : Byte;
  PullDownEnable    : Byte;
  SerNumEnable      : Byte;
  USBVersionEnable  : Byte;
  USBVersion        : Word;
// FT2232C extensions
  Rev5              : Byte;
  IsoInA            : Byte;
  IsoInB            : Byte;
  IsoOutA           : Byte;
  IsoOutB           : Byte;
  PullDownEnable5   : Byte;
  SerNumEnable5     : Byte;
  USBVersionEnable5 : Byte;
  USBVersion5       : Word;
  AIsHighCurrent    : Byte;
  BIsHighCurrent    : Byte;
  IFAIsFifo         : Byte;
  IFAIsFifoTar      : Byte;
  IFAIsFastSer      : Byte;
  AIsVCP            : Byte;
  IFBIsFifo         : Byte;
  IFBIsFifoTar      : Byte;
  IFBIsFastSer      : Byte;
  BIsVCP            : Byte;
// FT232R extensions
  UseExtOsc         : Byte;
  HighDriveIOs      : Byte;
  EndpointSize      : Byte;
  PullDownEnableR   : Byte;
  SerNumEnableR     : Byte;
  InvertTXD         : Byte;
  InvertRXD         : Byte;
  InvertRTS         : Byte;
  InvertCTS         : Byte;
  InvertDTR         : Byte;
  InvertDSR         : Byte;
  InvertDCD         : Byte;
  InvertRI          : Byte;
  Cbus0             : Byte;
  Cbus1             : Byte;
  Cbus2             : Byte;
  Cbus3             : Byte;
  Cbus4             : Byte;
  RIsVCP            : Byte;
end;


// Exported Functions
// Classic Functions
Function GetFTDeviceCount : FT_Result;
Function GetFTDeviceSerialNo(DeviceIndex:DWord) : FT_Result;
Function GetFTDeviceDescription(DeviceIndex:DWord) : FT_Result;
Function GetFTDeviceLocation(DeviceIndex:DWord) : FT_Result;
Function Open_USB_Device : FT_Result;
Function Open_USB_Device_By_Serial_Number(Serial_Number:string) : FT_Result;
Function Open_USB_Device_By_Device_Description(Device_Description:string) : FT_Result;
Function Open_USB_Device_By_Device_Location(Location:DWord) : FT_Result;
Function Close_USB_Device : FT_Result;
Function Read_USB_Device_Buffer(Read_Count:Integer) : Integer;
Function Write_USB_Device_Buffer(Write_Count:Integer) : Integer;
Function Reset_USB_Device : FT_Result;
Function Set_USB_Device_BaudRate : FT_Result;
Function Set_USB_Device_BaudRate_Divisor(Divisor:Dword) : FT_Result;
Function Set_USB_Device_DataCharacteristics : FT_Result;
Function Set_USB_Device_FlowControl : FT_Result;
Function Set_USB_Device_RTS : FT_Result;
Function Clr_USB_Device_RTS : FT_Result;
Function Set_USB_Device_DTR : FT_Result;
Function Clr_USB_Device_DTR : FT_Result;
Function Get_USB_Device_ModemStatus : FT_Result;
Function Set_USB_Device_Chars : FT_Result;
Function Purge_USB_Device_Out : FT_Result;
Function Purge_USB_Device_In : FT_Result;
Function Set_USB_Device_TimeOuts(ReadTimeOut,WriteTimeOut:DWord) : FT_Result;
Function Get_USB_Device_QueueStatus : FT_Result;
Function Set_USB_Device_Break_On : FT_Result;
Function Set_USB_Device_Break_Off : FT_Result;
Function Get_USB_Device_Status : FT_Result;
Function Set_USB_Device_Event_Notification(EventMask:DWord) : FT_Result;
Function USB_FT_GetDeviceInfo(DevType,ID:DWord; SerialNumber,Description:array of char) : FT_Result;
Function Set_USB_Device_Reset_Pipe_Retry_Count(RetryCount:DWord) : FT_Result;
Function Stop_USB_Device_InTask : FT_Result;
Function Restart_USB_Device_InTask : FT_Result;
Function Reset_USB_Port : FT_Result;
Function Cycle_USB_Port : FT_Result;
Function Create_USB_Device_List : FT_Result;
Function Get_USB_Device_List : FT_Result;
Function Get_USB_Device_List_Detail(Index:DWord) : FT_Result;
// EEPROM Functions
function USB_FT_EE_Read : FT_Result;
function USB_FT_C_EE_Read : FT_Result;
function USB_FT_R_EE_Read : FT_Result;
function USB_FT_EE_Program : FT_Result;
function USB_FT_ReadEE(WordAddr:Dword) : FT_Result;
function USB_FT_WriteEE(WordAddr:Dword;WordData:Word) : FT_Result;
function USB_FT_EraseEE : FT_Result;
function USB_FT_EE_UARead : FT_Result;
function USB_FT_EE_UAWrite : FT_Result;
function USB_FT_EE_UASize : FT_Result;
// FT2232C, FT232BM and FT245BM Extended API Functions
Function Get_USB_Device_LatencyTimer : FT_Result;
Function Set_USB_Device_LatencyTimer(Latency : Byte) : FT_Result;
Function Get_USB_Device_BitMode(var BitMode:Byte) : FT_Result;
Function Set_USB_Device_BitMode(Mask, Enable:Byte) : FT_Result;
Function Set_USB_Parameters(InSize, OutSize:Dword) : FT_Result;

Function Get_USB_Driver_Version(DrVersion :  TDWordptr): FT_Result;
Function Get_USB_Library_Version(LbVersion :  TDWordptr): FT_Result;

Var
// Port Handle Returned by the Open Function
// Used by the Subsequent Function Calls
    FT_HANDLE : DWord = 0;
// Used to handle multiple device instances in future
// versions. Must be set to 0 for now.
//    PV_Device : DWord = 0;

// Holding Variables for the current settings
// Can be configured visually using the CFGUnit Unit
// or manually before calling SetUp_USB_Device
    FT_Current_Baud : Dword;
    FT_Current_DataBits : Byte;
    FT_Current_StopBits : Byte;
    FT_Current_Parity : Byte;
    FT_Current_FlowControl : Word;
    FT_RTS_On : Boolean;
    FT_DTR_On : Boolean;
    FT_Event_On : Boolean;
    FT_Error_On : Boolean;
    FT_XON_Value : Byte = $11;
    FT_XOFF_Value : Byte = $13;
    FT_EVENT_Value : Byte = $0;
    FT_ERROR_Value : Byte = $0;
// Used by CFGUnit to flag a bad value
    FT_SetupError : Boolean;
// Used to Return the current Modem Status
    FT_Modem_Status : DWord;
//  Used to return the number of bytes pending
//  in the Rx Buffer Queue
    FT_Q_Bytes : DWord;
    FT_TxQ_Bytes : DWord;
    FT_Event_Status : DWord;
//  Used to Enable / Disable the Error Report Dialog
    FT_Enable_Error_Report : Boolean = True;
//  Deposit for Get latency timer
    FT_LatencyRd : Byte;

    FT_DeviceInfoList : array of FT_Device_Info_Node;

    Manufacturer: array [0..63] of char;
    ManufacturerID: array [0..15] of char;
    Description:  array [0..63] of char;
    SerialNumber:  array [0..15] of char;
    LocID : DWord;
    EEDataBuffer : TFT_Program_Data;
    UserData :  array [0..63] of byte;
    FT_UA_Size : integer;
    WordRead : Word;


Const
// FT_Result Values
    FT_OK = 0;
    FT_INVALID_HANDLE = 1;
    FT_DEVICE_NOT_FOUND = 2;
    FT_DEVICE_NOT_OPENED = 3;
    FT_IO_ERROR = 4;
    FT_INSUFFICIENT_RESOURCES = 5;
    FT_INVALID_PARAMETER = 6;
    FT_SUCCESS = FT_OK;
    FT_INVALID_BAUD_RATE = 7;
    FT_DEVICE_NOT_OPENED_FOR_ERASE = 8;
    FT_DEVICE_NOT_OPENED_FOR_WRITE = 9;
    FT_FAILED_TO_WRITE_DEVICE = 10;
    FT_EEPROM_READ_FAILED = 11;
    FT_EEPROM_WRITE_FAILED = 12;
    FT_EEPROM_ERASE_FAILED = 13;
    FT_EEPROM_NOT_PRESENT = 14;
    FT_EEPROM_NOT_PROGRAMMED = 15;
    FT_INVALID_ARGS = 16;
    FT_OTHER_ERROR = 17;
// FT_Open_Ex Flags
    FT_OPEN_BY_SERIAL_NUMBER = 1;
    FT_OPEN_BY_DESCRIPTION = 2;
    FT_OPEN_BY_LOCATION = 4;
// FT_List_Devices Flags
    FT_LIST_NUMBER_ONLY = $80000000;
    FT_LIST_BY_INDEX = $40000000;
    FT_LIST_ALL = $20000000;
// Baud Rate Selection
    FT_BAUD_300 = 300;
    FT_BAUD_600 = 600;
    FT_BAUD_1200 = 1200;
    FT_BAUD_2400 = 2400;
    FT_BAUD_4800 = 4800;
    FT_BAUD_9600 = 9600;
    FT_BAUD_14400 = 14400;
    FT_BAUD_19200 = 19200;
    FT_BAUD_38400 = 38400;
    FT_BAUD_57600 = 57600;
    FT_BAUD_115200 = 115200;
    FT_BAUD_230400 = 230400;
    FT_BAUD_460800 = 460800;
    FT_BAUD_921600 = 921600;
// Data Bits Selection
    FT_DATA_BITS_7 = 7;
    FT_DATA_BITS_8 = 8;
// Stop Bits Selection
    FT_STOP_BITS_1 = 0;
    FT_STOP_BITS_2 = 2;
// Parity Selection
    FT_PARITY_NONE = 0;
    FT_PARITY_ODD = 1;
    FT_PARITY_EVEN = 2;
    FT_PARITY_MARK = 3;
    FT_PARITY_SPACE = 4;
// Flow Control Selection
    FT_FLOW_NONE = $0000;
    FT_FLOW_RTS_CTS = $0100;
    FT_FLOW_DTR_DSR = $0200;
    FT_FLOW_XON_XOFF = $0400;
// Purge Commands
    FT_PURGE_RX = 1;
    FT_PURGE_TX = 2;
// Notification Events
    FT_EVENT_RXCHAR = 1;
    FT_EVENT_MODEM_STATUS = 2;
// Modem Status
    CTS = $10;
    DSR = $20;
    RI = $40;
    DCD = $80;


// IO Buffer Sizes
    FT_In_Buffer_Size = $10000;    // 64k
    FT_In_Buffer_Index = FT_In_Buffer_Size - 1;
    FT_Out_Buffer_Size = $10000;    // 64k
    FT_Out_Buffer_Index = FT_Out_Buffer_Size - 1;
// DLL Name
    FT_DLL_Name = 'FTD2XX.DLL';


var
// Declare Input and Output Buffers
   FT_In_Buffer : Array[0..FT_In_Buffer_Index] of Byte;
   FT_Out_Buffer : Array[0..FT_Out_Buffer_Index] of Byte;
// A variable used to detect time-outs
// Attach a timer to the main project form
// which decrements this every 10mS if
// FT_TimeOut_Count <> 0
   FT_TimeOut_Count : Integer = 0;
// Used to determine how many bytes were
// actually received by FT_Read_Device_All
// in the case of a time-out
   FT_All_Bytes_Received : Integer = 0;
   FT_IO_Status : Ft_Result = FT_OK;
// Used By FT_ListDevices
   FT_Device_Count : DWord;
   FT_Device_String_Buffer : array [1..50] of Char;
   FT_Device_String : String;
   FT_Device_Location : DWord;
   USB_Device_Info_Node : FT_Device_Info_Node;
   FT_Event_Handle : DWord;


function FT_GetComPortNumber(ftHandle:Dword; var Value : Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetComPortNumber';

type
    FT_Error_Reporter = Procedure(ErrStr: String; PortStatus : Integer);
    EFT_Error = class(exception);

procedure FT_Error_DefaultReport(ErrStr: String; PortStatus : Integer);

var
    FT_Error_Report : FT_Error_Reporter = FT_Error_DefaultReport;

implementation
//Classic functions
function FT_GetNumDevices(pvArg1:Pointer; pvArg2:Pointer; dwFlags:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_ListDevices';
function FT_ListDevices(pvArg1:Dword; pvArg2:Pointer; dwFlags:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_ListDevices';
function FT_Open(Index:Integer; ftHandle:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_Open';
function FT_OpenEx(pvArg1:Pointer; dwFlags:Dword; ftHandle:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_OpenEx';
function FT_OpenByLocation(pvArg1:DWord; dwFlags:Dword; ftHandle:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_OpenEx';
function FT_Close(ftHandle:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_Close';
function FT_Read(ftHandle:Dword; FTInBuf:Pointer; BufferSize:LongInt; ResultPtr:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_Read';
function FT_Write(ftHandle:Dword; FTOutBuf:Pointer; BufferSize:LongInt; ResultPtr:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_Write';
function FT_ResetDevice(ftHandle:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_ResetDevice';
function FT_SetBaudRate(ftHandle:Dword; BaudRate:DWord):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetBaudRate';
function FT_SetDivisor(ftHandle:Dword; Divisor:DWord):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetDivisor';
function FT_SetDataCharacteristics(ftHandle:Dword; WordLength,StopBits,Parity:Byte):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetDataCharacteristics';
function FT_SetFlowControl(ftHandle:Dword; FlowControl:Word; XonChar,XoffChar:Byte):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetFlowControl';
function FT_SetDtr(ftHandle:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetDtr';
function FT_ClrDtr(ftHandle:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_ClrDtr';
function FT_SetRts(ftHandle:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetRts';
function FT_ClrRts(ftHandle:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_ClrRts';
function FT_GetModemStatus(ftHandle:Dword; ModemStatus:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetModemStatus';
function FT_SetChars(ftHandle:Dword; EventChar,EventCharEnabled,ErrorChar,ErrorCharEnabled:Byte):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetChars';
function FT_Purge(ftHandle:Dword; Mask:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_Purge';
function FT_SetTimeouts(ftHandle:Dword; ReadTimeout,WriteTimeout:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetTimeouts';
function FT_GetQueueStatus(ftHandle:Dword; RxBytes:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetQueueStatus';
function FT_SetBreakOn(ftHandle:Dword) : FT_Result; stdcall; External FT_DLL_Name name 'FT_SetBreakOn';
function FT_SetBreakOff(ftHandle:Dword) : FT_Result; stdcall; External FT_DLL_Name name 'FT_SetBreakOff';
function FT_GetStatus(ftHandle:DWord; RxBytes,TxBytes,EventStatus:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetStatus';
function FT_SetEventNotification(ftHandle:DWord; EventMask:DWord; pvArgs:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetEventNotification';
function FT_GetDeviceInfo(ftHandle:DWord; DevType,ID,SerNum,Desc,pvDummy:Pointer) : FT_Result; stdcall; External FT_DLL_Name name 'FT_GetDeviceInfo';
function FT_SetResetPipeRetryCount(ftHandle:Dword; RetryCount:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetResetPipeRetryCount';
function FT_StopInTask(ftHandle:Dword) : FT_Result; stdcall; External FT_DLL_Name name 'FT_StopInTask';
function FT_RestartInTask(ftHandle:Dword) : FT_Result; stdcall; External FT_DLL_Name name 'FT_RestartInTask';
function FT_ResetPort(ftHandle:Dword) : FT_Result; stdcall; External FT_DLL_Name name 'FT_ResetPort';
function FT_CyclePort(ftHandle:Dword) : FT_Result; stdcall; External 'FTD2XX.DLL' name 'FT_CyclePort';
function FT_CreateDeviceInfoList(NumDevs:Pointer):FT_Result; stdcall;overload;External FT_DLL_Name name 'FT_CreateDeviceInfoList';
function FT_CreateDeviceInfoList(var NumDevs: cardinal):FT_Result; stdcall;overload; External FT_DLL_Name name 'FT_CreateDeviceInfoList';
function FT_GetDeviceInfoList(pFT_Device_Info_List:Pointer; NumDevs:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetDeviceInfoList';
function FT_GetDeviceInfoDetail(Index:DWord; Flags,DevType,ID,LocID,SerialNumber,Description,DevHandle:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetDeviceInfoDetail';
function FT_GetDriverVersion(ftHandle:Dword; DrVersion:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetDriverVersion';
function FT_GetLibraryVersion(LbVersion:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetLibraryVersion';

// EEPROM functions
function FT_EE_Read(ftHandle:DWord; pEEData:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_EE_Read';
function FT_EE_Program(ftHandle:DWord; pEEData:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_EE_Program';
// EEPROM primitives - you need an NDA for EEPROM checksum
function FT_ReadEE(ftHandle:DWord; WordAddr:DWord; WordRead:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_ReadEE';
function FT_WriteEE(ftHandle:DWord; WordAddr:DWord; WordData:word):FT_Result; stdcall; External FT_DLL_Name name 'FT_WriteEE';
function FT_EraseEE(ftHandle:DWord):FT_Result; stdcall; External FT_DLL_Name name 'FT_EraseEE';
function FT_EE_UARead(ftHandle:DWord; Data:Pointer; DataLen:DWord; BytesRead:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_EE_UARead';
function FT_EE_UAWrite(ftHandle:DWord; Data:Pointer; DataLen:DWord):FT_Result; stdcall; External FT_DLL_Name name 'FT_EE_UAWrite';
function FT_EE_UASize(ftHandle:DWord; UASize:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_EE_UASize';

// FT2232C, FT232BM and FT245BM Extended API Functions
function FT_GetLatencyTimer(ftHandle:Dword; Latency:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetLatencyTimer';
function FT_SetLatencyTimer(ftHandle:Dword; Latency:Byte):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetLatencyTimer';
function FT_GetBitMode(ftHandle:Dword; BitMode:Pointer):FT_Result; stdcall; External FT_DLL_Name name 'FT_GetBitMode';
function FT_SetBitMode(ftHandle:Dword; Mask,Enable:Byte):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetBitMode';
function FT_SetUSBParameters(ftHandle:Dword; InSize,OutSize:Dword):FT_Result; stdcall; External FT_DLL_Name name 'FT_SetUSBParameters';

procedure FT_Error_DefaultReport(ErrStr: String; PortStatus : Integer);
var
    str : string;
begin
    If Not FT_Enable_Error_Report then Exit;
    If PortStatus = FT_OK then Exit;
    Case PortStatus of
        FT_INVALID_HANDLE : Str := ErrStr+' - Invalid handle...';
        FT_DEVICE_NOT_FOUND : Str := ErrStr+' - Device not found...';
        FT_DEVICE_NOT_OPENED : Str := ErrStr+' - Device not opened...';
        FT_IO_ERROR : Str := ErrStr+' - General IO error...';
        FT_INSUFFICIENT_RESOURCES : Str := ErrStr+' - Insufficient resources...';
        FT_INVALID_PARAMETER : Str := ErrStr+' - Invalid parameter...';
        FT_INVALID_BAUD_RATE : Str := ErrStr+' - Invalid baud rate...';
        FT_DEVICE_NOT_OPENED_FOR_ERASE : Str := ErrStr+' Device not opened for erase...';
        FT_DEVICE_NOT_OPENED_FOR_WRITE : Str := ErrStr+' Device not opened for write...';
        FT_FAILED_TO_WRITE_DEVICE : Str := ErrStr+' - Failed to write...';
        FT_EEPROM_READ_FAILED : Str := ErrStr+' - EEPROM read failed...';
        FT_EEPROM_WRITE_FAILED : Str := ErrStr+' - EEPROM write failed...';
        FT_EEPROM_ERASE_FAILED : Str := ErrStr+' - EEPROM erase failed...';
        FT_EEPROM_NOT_PRESENT : Str := ErrStr+' - EEPROM not present...';
        FT_EEPROM_NOT_PROGRAMMED : Str := ErrStr+' - EEPROM not programmed...';
        FT_INVALID_ARGS : Str := ErrStr+' - Invalid arguments...';
        FT_OTHER_ERROR : Str := ErrStr+' - Other error ...';
    End;
    raise EFT_Error.Create(Str);
end;

Function GetDeviceString : String;
Var I : Integer;
Begin
Result := ''; I := 1;
FT_Device_String_Buffer[50] := Chr(0); // Just in case !
While FT_Device_String_Buffer[I] <> Chr(0) do
  Begin
  Result := Result + FT_Device_String_Buffer[I];
  Inc(I);
  End;
End;


Procedure SetDeviceString ( S : String );
Var I,L : Integer;
Begin
FT_Device_String_Buffer[1] := Chr(0);
L := Length(S);  If L > 49 then L := 49;
If L = 0 then Exit;
For I := 1 to L do FT_Device_String_Buffer[I] := S[I];
FT_Device_String_Buffer[L+1] := Chr(0);
End;


// FTD2XX functions from here
Function GetFTDeviceCount : FT_Result;
Begin
Result := FT_GetNumDevices(@FT_Device_Count,Nil,FT_LIST_NUMBER_ONLY);
If Result <> FT_OK then FT_Error_Report('GetFTDeviceCount',Result);
End;

Function GetFTDeviceSerialNo(DeviceIndex:DWord) : FT_Result;
Begin
Result := FT_ListDevices(DeviceIndex,@SerialNumber,(FT_OPEN_BY_SERIAL_NUMBER or FT_LIST_BY_INDEX));
If Result = FT_OK then FT_Device_String := SerialNumber;
If Result <> FT_OK then FT_Error_Report('GetFTDeviceSerialNo',Result);
End;


Function GetFTDeviceDescription(DeviceIndex:DWord) : FT_Result;
Begin
Result := FT_ListDevices(DeviceIndex,@Description,(FT_OPEN_BY_DESCRIPTION or FT_LIST_BY_INDEX));
If Result = FT_OK then FT_Device_String := Description;
If Result <> FT_OK then FT_Error_Report('GetFTDeviceDescription',Result);
End;


Function GetFTDeviceLocation(DeviceIndex:DWord) : FT_Result;
Begin
Result := FT_ListDevices(DeviceIndex,@LocID,(FT_OPEN_BY_LOCATION or FT_LIST_BY_INDEX));
If Result = FT_OK then FT_Device_Location := LocID;
If Result <> FT_OK then FT_Error_Report('GetFTDeviceLocation',Result);
End;


Function Open_USB_Device : FT_Result;
Var
  DevIndex : DWord;
Begin
DevIndex := 0;
Result := FT_Open(DevIndex,@FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_Open',Result);
End;


Function Open_USB_Device_By_Serial_Number(Serial_Number:string) : FT_Result;
Begin
SetDeviceString(Serial_Number);
Result := FT_OpenEx(@FT_Device_String_Buffer,FT_OPEN_BY_SERIAL_NUMBER,@FT_Handle);
If Result <> FT_OK then FT_Error_Report('Open_USB_Device_By_Serial_Number',Result);
End;


Function Open_USB_Device_By_Device_Description(Device_Description:string) : FT_Result;
Begin
SetDeviceString(Device_Description);
Result := FT_OpenEx(@FT_Device_String_Buffer,FT_OPEN_BY_DESCRIPTION,@FT_Handle);
If Result <> FT_OK then FT_Error_Report('Open_USB_Device_By_Device_Description',Result);
End;


Function Open_USB_Device_By_Device_Location(Location:DWord) : FT_Result;
Begin
Result := FT_OpenByLocation(Location,FT_OPEN_BY_LOCATION,@FT_Handle);
If Result <> FT_OK then FT_Error_Report('Open_USB_Device_By_Device_Location',Result);
End;


Function Close_USB_Device : FT_Result;
Begin
Result :=  FT_Close(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_Close',Result);
End;


function Read_USB_Device_Buffer( Read_Count : Integer ) : Integer;
// Reads Read_Count Bytes (or less) from the USB device to the FT_In_Buffer
// Function returns the number of bytes actually received  which may range from zero
// to the actual number of bytes requested, depending on how many have been received
// at the time of the request + the read timeout value.
Var Read_Result : Integer;
Begin

if (read_count = 1) then
  begin
  read_result := read_count;
  end;
FT_IO_Status := FT_Read(FT_Handle,@FT_In_Buffer,Read_Count,@Read_Result);
If FT_IO_Status <> FT_OK then FT_Error_Report('FT_Read',FT_IO_Status);
Result := Read_Result;
End;


function Write_USB_Device_Buffer( Write_Count : Integer ) : Integer;
// Writes Write_Count Bytes from FT_Out_Buffer to the USB device
// Function returns the number of bytes actually sent
// In this example, Write_Count should be 32k bytes max
Var Write_Result : Integer;
Begin
FT_IO_Status := FT_Write(FT_Handle,@FT_Out_Buffer,Write_Count,@Write_Result);
If FT_IO_Status <> FT_OK then FT_Error_Report('FT_Write',FT_IO_Status);
Result := Write_Result;
End;


Function Reset_USB_Device : FT_Result;
Begin
Result :=  FT_ResetDevice(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_ResetDevice',Result);
End;


Function Set_USB_Device_BaudRate : FT_Result;
Begin
Result :=  FT_SetBaudRate(FT_Handle,FT_Current_Baud);
If Result <> FT_OK then FT_Error_Report('FT_SetBaudRate',Result);
End;


Function Set_USB_Device_BaudRate_Divisor(Divisor:Dword) : FT_Result;
Begin
Result :=  FT_SetDivisor(FT_Handle,Divisor);
If Result <> FT_OK then FT_Error_Report('FT_SetDivisor',Result);
End;


Function Set_USB_Device_DataCharacteristics : FT_Result;
Begin
Result :=  FT_SetDataCharacteristics(FT_Handle,FT_Current_DataBits,FT_Current_StopBits,FT_Current_Parity);
If Result <> FT_OK then FT_Error_Report('FT_SetDataCharacteristics',Result);
End;


Function Set_USB_Device_FlowControl : FT_Result;
Begin
Result :=  FT_SetFlowControl(FT_Handle,FT_Current_FlowControl,FT_XON_Value,FT_XOFF_Value);
If Result <> FT_OK then FT_Error_Report('FT_SetFlowControl',Result);
End;


Function Set_USB_Device_RTS : FT_Result;
Begin
Result :=  FT_SetRTS(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_SetRTS',Result);
End;


Function Clr_USB_Device_RTS : FT_Result;
Begin
Result :=  FT_ClrRTS(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_ClrRTS',Result);
End;


Function Set_USB_Device_DTR : FT_Result;
Begin
Result :=  FT_SetDTR(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_SetDTR',Result);
End;


Function Clr_USB_Device_DTR : FT_Result;
Begin
Result :=  FT_ClrDTR(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_ClrDTR',Result);
End;


Function Get_USB_Device_ModemStatus : FT_Result;
Begin
Result :=  FT_GetModemStatus(FT_Handle,@FT_Modem_Status);
If Result <> FT_OK then FT_Error_Report('FT_GetModemStatus',Result);
End;


Function Set_USB_Device_Chars : FT_Result;
Var Events_On,Errors_On : Byte;
Begin
If FT_Event_On then Events_On := 1 else Events_On := 0;
If FT_Error_On then Errors_On := 1 else Errors_On := 0;
Result :=  FT_SetChars(FT_Handle,FT_EVENT_Value,Events_On,FT_ERROR_Value,Errors_On);
If Result <> FT_OK then FT_Error_Report('FT_SetChars',Result);
End;


Function Purge_USB_Device_Out : FT_Result;
Begin
Result :=  FT_Purge(FT_Handle,FT_PURGE_RX);
If Result <> FT_OK then FT_Error_Report('FT_Purge RX',Result);
End;

Function Purge_USB_Device_In : FT_Result;
Begin
Result :=  FT_Purge(FT_Handle,FT_PURGE_TX);
If Result <> FT_OK then FT_Error_Report('FT_Purge TX',Result);
End;


Function Set_USB_Device_TimeOuts(ReadTimeOut,WriteTimeOut:DWord) : FT_Result;
Begin
Result :=  FT_SetTimeouts(FT_Handle,ReadTimeout,WriteTimeout);
If Result <> FT_OK then FT_Error_Report('FT_SetTimeouts',Result);
End;


Function Get_USB_Device_QueueStatus : FT_Result;
Begin
Result :=  FT_GetQueueStatus(FT_Handle,@FT_Q_Bytes);
If Result <> FT_OK then FT_Error_Report('FT_GetQueueStatus',Result);
End;


Function Set_USB_Device_Break_On : FT_Result;
Begin
Result :=  FT_SetBreakOn(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_SetBreakOn',Result);
End;


Function Set_USB_Device_Break_Off : FT_Result;
Begin
Result :=  FT_SetBreakOff(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_SetBreakOff',Result);
End;


Function Get_USB_Device_Status : FT_Result;
Begin
Result :=  FT_GetStatus(FT_Handle, @FT_Q_Bytes, @FT_TxQ_Bytes, @FT_Event_Status);
If Result <> FT_OK then FT_Error_Report('FT_GetStatus',Result);
End;


Function Set_USB_Device_Event_Notification(EventMask:DWord) : FT_Result;
Begin
Result := FT_SetEventNotification(FT_Handle,EventMask,FT_Event_Handle);
If Result <> FT_OK then FT_Error_Report('FT_SetEventNotification ',Result);
End;


Function USB_FT_GetDeviceInfo(DevType,ID:DWord; SerialNumber,Description:array of char) : FT_Result;
begin
Result := FT_GetDeviceInfo(FT_Handle,@DevType,@ID,@SerialNumber,@Description,Nil);
If Result <> FT_OK then FT_Error_Report('FT_GetDeviceInfo ',Result);
end;


Function Set_USB_Device_Reset_Pipe_Retry_Count(RetryCount:DWord) : FT_Result;
Begin
Result :=  FT_SetResetPiperetryCount(FT_Handle, RetryCount);
If Result <> FT_OK then FT_Error_Report('FT_SetResetPipeRetryCount',Result);
End;


Function Stop_USB_Device_InTask : FT_Result;
Begin
Result :=  FT_StopInTask(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_StopInTask',Result);
End;


Function Restart_USB_Device_InTask : FT_Result;
Begin
Result :=  FT_RestartInTask(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_RestartInTask',Result);
End;


Function Reset_USB_Port : FT_Result;
Begin
Result :=  FT_ResetPort(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_ResetPort',Result);
End;


Function Cycle_USB_Port : FT_Result;
Begin
Result :=  FT_CyclePort(FT_Handle);
If Result <> FT_OK then FT_Error_Report('FT_CyclePort',Result);
End;


Function Create_USB_Device_List : FT_Result;
Begin
Result :=  FT_CreateDeviceInfoList(@FT_Device_Count);
If Result <> FT_OK then FT_Error_Report('FT_CreateDeviceInfoList',Result);
End;


Function Get_USB_Device_List : FT_Result;
Begin
SetLength(FT_DeviceInfoList,FT_Device_Count);
Result :=  FT_GetDeviceInfoList(FT_DeviceInfoList, @FT_Device_Count);
If Result <> FT_OK then FT_Error_Report('FT_GetDeviceInfoList',Result);
End;

Function Get_USB_Driver_Version(DrVersion : TDWordPtr) : FT_Result;
Begin
   Result :=  FT_GetDriverVersion(FT_Handle, DrVersion);
   If Result <> FT_OK then FT_Error_Report('FT_GetDriverVersion',Result);
End;

Function Get_USB_Library_Version(LbVersion : TDWordPtr) : FT_Result;
Begin
   Result :=  FT_GetLibraryVersion(LbVersion);
   If Result <> FT_OK then FT_Error_Report('FT_GetLibraryVersion',Result);
End;


Function Get_USB_Device_List_Detail(Index:DWord) : FT_Result;
Begin
// Initialise structure
USB_Device_Info_Node.Flags := 0;
USB_Device_Info_Node.DeviceType := 0;
USB_Device_Info_Node.ID := 0;
USB_Device_Info_Node.LocID := 0;
USB_Device_Info_Node.SerialNumber := '';
USB_Device_Info_Node.Description := '';
USB_Device_Info_Node.DeviceHandle := 0;
Result := FT_GetDeviceInfoDetail(Index,@USB_Device_Info_Node.Flags,@USB_Device_Info_Node.DeviceType,
    @USB_Device_Info_Node.ID,@USB_Device_Info_Node.LocID,@USB_Device_Info_Node.SerialNumber,
    @USB_Device_Info_Node.Description,@USB_Device_Info_Node.DeviceHandle);
If Result <> FT_OK then FT_Error_Report('FT_GetDeviceInfoListDetail',Result);
End;


function USB_FT_EE_Read : FT_Result;
// Read BM/AM device EEPROM
begin
EEDataBuffer.Signature1 := 0;
EEDataBuffer.Signature2 := $FFFFFFFF;
EEDataBuffer.Version := 0;  // 0 for AM/BM, 1 for C, 2 for R
EEDataBuffer.VendorId :=0;
EEDataBuffer.ProductId := 0;
EEDataBuffer.Manufacturer := @Manufacturer;
EEDataBuffer.ManufacturerId := @ManufacturerId;
EEDataBuffer.Description := @Description;
EEDataBuffer.SerialNumber := @SerialNumber;
EEDataBuffer.MaxPower := 0;
EEDataBuffer.PnP := 0;
EEDataBuffer.SelfPowered := 0;
EEDataBuffer.RemoteWakeup := 0;
EEDataBuffer.Rev4 := 0;
EEDataBuffer.IsoIn := 0;
EEDataBuffer.IsoOut := 0;
EEDataBuffer.PullDownEnable := 0;
EEDataBuffer.SerNumEnable := 0;
EEDataBuffer.USBVersionEnable := 0;
EEDataBuffer.USBVersion := 0;
// FT2232C Extensions
EEDataBuffer.Rev5 := 0;
EEDataBuffer.IsoInA := 0;
EEDataBuffer.IsoInB := 0;
EEDataBuffer.IsoOutA := 0;
EEDataBuffer.IsoOutB := 0;
EEDataBuffer.PullDownEnable5 := 0;
EEDataBuffer.SerNumEnable5 := 0;
EEDataBuffer.USBVersionEnable5 := 0;
EEDataBuffer.USBVersion5 := 0;
EEDataBuffer.AIsHighCurrent := 0;
EEDataBuffer.BIsHighCurrent := 0;
EEDataBuffer.IFAIsFifo := 0;
EEDataBuffer.IFAIsFifoTar := 0;
EEDataBuffer.IFAIsFastSer := 0;
EEDataBuffer.AIsVCP := 0;
EEDataBuffer.IFBIsFifo := 0;
EEDataBuffer.IFBIsFifoTar := 0;
EEDataBuffer.IFBIsFastSer := 0;
EEDataBuffer.BIsVCP := 0;
// FT232R extensions
EEDataBuffer.UseExtOsc := 0;
EEDataBuffer.HighDriveIOs := 0;
EEDataBuffer.EndpointSize := 0;
EEDataBuffer.PullDownEnableR := 0;
EEDataBuffer.SerNumEnableR := 0;
EEDataBuffer.InvertTXD := 0;
EEDataBuffer.InvertRXD := 0;
EEDataBuffer.InvertRTS := 0;
EEDataBuffer.InvertCTS := 0;
EEDataBuffer.InvertDTR := 0;
EEDataBuffer.InvertDSR := 0;
EEDataBuffer.InvertDCD := 0;
EEDataBuffer.InvertRI := 0;
EEDataBuffer.Cbus0 := 0;
EEDataBuffer.Cbus1 := 0;
EEDataBuffer.Cbus2 := 0;
EEDataBuffer.Cbus3 := 0;
EEDataBuffer.Cbus4 := 0;
EEDataBuffer.RIsVCP := 0;
Result :=  FT_EE_Read(FT_Handle,@EEDataBuffer);
If Result <> FT_OK then FT_Error_Report('FT_EE_Read ',Result);
end;


function USB_FT_C_EE_Read : FT_Result;
// Read FT2232C device EEPROM
begin
EEDataBuffer.Signature1 := 0;
EEDataBuffer.Signature2 := $FFFFFFFF;
EEDataBuffer.Version := 1;  // 0 for AM/BM, 1 for C, 2 for R
EEDataBuffer.VendorId :=0;
EEDataBuffer.ProductId := 0;
EEDataBuffer.Manufacturer := @Manufacturer;
EEDataBuffer.ManufacturerId := @ManufacturerId;
EEDataBuffer.Description := @Description;
EEDataBuffer.SerialNumber := @SerialNumber;
EEDataBuffer.MaxPower := 0;
EEDataBuffer.PnP := 0;
EEDataBuffer.SelfPowered := 0;
EEDataBuffer.RemoteWakeup := 0;
EEDataBuffer.Rev4 := 0;
EEDataBuffer.IsoIn := 0;
EEDataBuffer.IsoOut := 0;
EEDataBuffer.PullDownEnable := 0;
EEDataBuffer.SerNumEnable := 0;
EEDataBuffer.USBVersionEnable := 0;
EEDataBuffer.USBVersion := 0;
// FT2232C Extensions
EEDataBuffer.Rev5 := 0;
EEDataBuffer.IsoInA := 0;
EEDataBuffer.IsoInB := 0;
EEDataBuffer.IsoOutA := 0;
EEDataBuffer.IsoOutB := 0;
EEDataBuffer.PullDownEnable5 := 0;
EEDataBuffer.SerNumEnable5 := 0;
EEDataBuffer.USBVersionEnable5 := 0;
EEDataBuffer.USBVersion5 := 0;
EEDataBuffer.AIsHighCurrent := 0;
EEDataBuffer.BIsHighCurrent := 0;
EEDataBuffer.IFAIsFifo := 0;
EEDataBuffer.IFAIsFifoTar := 0;
EEDataBuffer.IFAIsFastSer := 0;
EEDataBuffer.AIsVCP := 0;
EEDataBuffer.IFBIsFifo := 0;
EEDataBuffer.IFBIsFifoTar := 0;
EEDataBuffer.IFBIsFastSer := 0;
EEDataBuffer.BIsVCP := 0;
// FT232R extensions
EEDataBuffer.UseExtOsc := 0;
EEDataBuffer.HighDriveIOs := 0;
EEDataBuffer.EndpointSize := 0;
EEDataBuffer.PullDownEnableR := 0;
EEDataBuffer.SerNumEnableR := 0;
EEDataBuffer.InvertTXD := 0;
EEDataBuffer.InvertRXD := 0;
EEDataBuffer.InvertRTS := 0;
EEDataBuffer.InvertCTS := 0;
EEDataBuffer.InvertDTR := 0;
EEDataBuffer.InvertDSR := 0;
EEDataBuffer.InvertDCD := 0;
EEDataBuffer.InvertRI := 0;
EEDataBuffer.Cbus0 := 0;
EEDataBuffer.Cbus1 := 0;
EEDataBuffer.Cbus2 := 0;
EEDataBuffer.Cbus3 := 0;
EEDataBuffer.Cbus4 := 0;
EEDataBuffer.RIsVCP := 0;
Result :=  FT_EE_Read(FT_Handle,@EEDataBuffer);
If Result <> FT_OK then FT_Error_Report('FT_EE_Read ',Result);
end;


function USB_FT_R_EE_Read : FT_Result;
// Read FT232R device EEPROM
begin
EEDataBuffer.Signature1 := 0;
EEDataBuffer.Signature2 := $FFFFFFFF;
EEDataBuffer.Version := 2;  // 0 for AM/BM, 1 for C, 2 for R
EEDataBuffer.VendorId :=0;
EEDataBuffer.ProductId := 0;
EEDataBuffer.Manufacturer := @Manufacturer;
EEDataBuffer.ManufacturerId := @ManufacturerId;
EEDataBuffer.Description := @Description;
EEDataBuffer.SerialNumber := @SerialNumber;
EEDataBuffer.MaxPower := 0;
EEDataBuffer.PnP := 0;
EEDataBuffer.SelfPowered := 0;
EEDataBuffer.RemoteWakeup := 0;
EEDataBuffer.Rev4 := 0;
EEDataBuffer.IsoIn := 0;
EEDataBuffer.IsoOut := 0;
EEDataBuffer.PullDownEnable := 0;
EEDataBuffer.SerNumEnable := 0;
EEDataBuffer.USBVersionEnable := 0;
EEDataBuffer.USBVersion := 0;
// FT2232C Extensions
EEDataBuffer.Rev5 := 0;
EEDataBuffer.IsoInA := 0;
EEDataBuffer.IsoInB := 0;
EEDataBuffer.IsoOutA := 0;
EEDataBuffer.IsoOutB := 0;
EEDataBuffer.PullDownEnable5 := 0;
EEDataBuffer.SerNumEnable5 := 0;
EEDataBuffer.USBVersionEnable5 := 0;
EEDataBuffer.USBVersion5 := 0;
EEDataBuffer.AIsHighCurrent := 0;
EEDataBuffer.BIsHighCurrent := 0;
EEDataBuffer.IFAIsFifo := 0;
EEDataBuffer.IFAIsFifoTar := 0;
EEDataBuffer.IFAIsFastSer := 0;
EEDataBuffer.AIsVCP := 0;
EEDataBuffer.IFBIsFifo := 0;
EEDataBuffer.IFBIsFifoTar := 0;
EEDataBuffer.IFBIsFastSer := 0;
EEDataBuffer.BIsVCP := 0;
// FT232R extensions
EEDataBuffer.UseExtOsc := 0;
EEDataBuffer.HighDriveIOs := 0;
EEDataBuffer.EndpointSize := 0;
EEDataBuffer.PullDownEnableR := 0;
EEDataBuffer.SerNumEnableR := 0;
EEDataBuffer.InvertTXD := 0;
EEDataBuffer.InvertRXD := 0;
EEDataBuffer.InvertRTS := 0;
EEDataBuffer.InvertCTS := 0;
EEDataBuffer.InvertDTR := 0;
EEDataBuffer.InvertDSR := 0;
EEDataBuffer.InvertDCD := 0;
EEDataBuffer.InvertRI := 0;
EEDataBuffer.Cbus0 := 0;
EEDataBuffer.Cbus1 := 0;
EEDataBuffer.Cbus2 := 0;
EEDataBuffer.Cbus3 := 0;
EEDataBuffer.Cbus4 := 0;
EEDataBuffer.RIsVCP := 0;
Result :=  FT_EE_Read(FT_Handle,@EEDataBuffer);
If Result <> FT_OK then FT_Error_Report('FT_EE_Read ',Result);
end;


function USB_FT_EE_Program : FT_Result;
begin
Result := FT_EE_Program(FT_Handle, @EEDataBuffer);
If Result <> FT_OK then FT_Error_Report('FT_EE_Read ',Result);
end;


function USB_FT_WriteEE(WordAddr:Dword; WordData:Word) : FT_Result;
begin
Result := FT_WriteEE(FT_Handle,WordAddr,WordData);
end;


function USB_FT_ReadEE(WordAddr:Dword) : FT_Result;
begin
Result := FT_ReadEE(FT_Handle,WordAddr,@WordRead);
end;


function USB_FT_EraseEE : FT_Result;
begin
Result := FT_EraseEE(FT_Handle);
end;


function USB_FT_EE_UARead : FT_Result;
begin
Result :=  FT_EE_UARead(FT_Handle,@UserData,64,@FT_UA_Size);
If Result <> FT_OK then FT_Error_Report('FT_EE_UARead ',Result);
end;


function USB_FT_EE_UAWrite : FT_Result;
begin
Result :=  FT_EE_UAWrite(FT_Handle,@UserData,FT_UA_Size);
If Result <> FT_OK then FT_Error_Report('FT_EE_UAWrite ',Result);
end;


function USB_FT_EE_UASize : FT_Result;
begin
Result :=  FT_EE_UASize(FT_Handle,@FT_UA_Size);
If Result <> FT_OK then FT_Error_Report('FT_EE_UASize ',Result);
end;


Function Get_USB_Device_LatencyTimer : FT_Result;
Begin
Result := FT_GetLatencyTimer(FT_Handle,@FT_LatencyRd);
If Result <> FT_OK then FT_Error_Report('FT_GetLatencyTimer ',Result);
End;


Function Set_USB_Device_LatencyTimer(Latency:Byte) : FT_Result;
Begin
Result :=  FT_SetLatencyTimer(FT_Handle, Latency);
If Result <> FT_OK then FT_Error_Report('FT_SetLatencyTimer ',Result);
End;


Function Get_USB_Device_BitMode(var BitMode:Byte) : FT_Result;
Begin
Result := FT_GetBitMode(FT_Handle,@BitMode);
If Result <> FT_OK then FT_Error_Report('FT_GetBitMode ',Result);
End;


Function Set_USB_Device_BitMode(Mask,Enable:Byte) : FT_Result ;
Begin
Result := FT_SetBitMode(FT_Handle,Mask,Enable);
If Result <> FT_OK then FT_Error_Report('FT_SetBitMode ',Result);
End;


Function Set_USB_Parameters(InSize,OutSize:Dword) : FT_Result ;
Begin
Result :=  FT_SetUSBParameters(FT_Handle,InSize,OutSize);
If Result <> FT_OK then FT_Error_Report('FT_SetUSBParameters ',Result);
End;


End.

Принцип действия:

1. проверяем командную строку, открываем файлы (оба файла должны существовать, т. е. второй .h файл нужно создать). Создать можно командой type nul>image.h

2. читаем первые 54 байта из BMP, берём оттуда высоту и ширину, считаем padding.

3. открываем FTDI USB утсройство. Если нету, выходим. Если много (больше одного), показываем список, спрашиваем выбор.

4. делаем установку (чётность, скорость и т. п.)

5. читаем картинку построчно, пишем в буфер построчно наоборот (31-ю полосу в самый верх и т. д. до 0-й полосы, т. к. в BMP строки записаны снизу вверх, т. е. наоборот).

6. посылаем в сериал по FTDI, весь буфер (32*32 пикс * 3 цвета = 3072 байта)

7. приняв картинку, цикл в ответчике на Arduino сделает команду снять дамп, послав по сериалу. Читаем дамп, целиком. Его размер 8522 байта.

8. пишем в выходной файл с 5-го байта (пропускаем первые два перевода строки).

9. закрываем FTDI устройство

10. закрываем файлы.

Код ответчика (скетч, делающий matrix.drawPixel() каждые 3 байта из сериала, затем дамп):

#include <Adafruit_GFX.h>
#include <RGBmatrixPanel.h>

#define CLK 8
#define OE  9
#define LAT 10
#define A   A0
#define B   A1
#define C   A2
#define D   A3

RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false);

byte i,j,k;
byte pixdata[3];
char c;

void setup() {
  matrix.begin();
  matrix.fillScreen(matrix.Color444(0,0,0)); 
  Serial.begin(9600);
}

void loop() {
  if(Serial.available()){
    for(i=0;i<32;i++){
      for(j=0;j<32;j++){
        for(k=0;k<3;k++){
            pixdata[k]=(byte) Serial.read();
            pixdata[k]>>=4;
        }
        matrix.drawPixel(i,j,matrix.Color444(pixdata[0],pixdata[1],pixdata[2]));
      }
    }
    matrix.dumpMatrix(); 
  }
}

Если есть картинка из примера colorwheel_progmem, она была бы кстати. Не фотка матрицы, показывающей картинку, а сама картинка 32x32, в BMP.

maloicds
maloicds аватар
Offline
Зарегистрирован: 21.03.2013

Опять кроме белого фона и пару засвеченных пикселей ничего нет. Может стоит попробовать с 2мя цветами и простенькой картинкой (например квадрат пополам)?

std
Offline
Зарегистрирован: 05.01.2012

Нужно найти оригинал этой картинки. Необходимо.

С простыми картинками тоже куча FF в дампе.