~ $ test ; exit;
dyld[17390]: Library not loaded: libftd2xx.dylib
Referenced from: <E59057E2-6B27-3B0F-9FD2-A568CC6B0F5D> test
Reason: tried: '/opt/homebrew/Cellar/exiv2/0.27.5_1/lib/libftd2xx.dylib' (no such file), '/libftd2xx.dylib' (no such file), 'libftd2xx.dylib' (no such file),
'/System/Volumes/Preboot/Cryptexes/OSlibftd2xx.dylib' (no such file),
'libftd2xx.dylib' (no such file), '/usr/local/lib/libftd2xx.dylib' (no such file),
'/usr/lib/libftd2xx.dylib' (no such file, not in dyld cache),
'/opt/homebrew/Cellar/exiv2/0.27.5_1/lib/libftd2xx.dylib' (no such file),
'/libftd2xx.dylib' (no such file), '/Users/xxx/libftd2xx.dylib' (no such file),
'/System/Volumes/Preboot/Cryptexes/OS/Users/xxx/libftd2xx.dylib' (no such file),
'/Users/xxx/libftd2xx.dylib' (no such file), '/usr/local/lib/libftd2xx.dylib' (no such file),
'/usr/lib/libftd2xx.dylib' (no such file, not in dyld cache)
Abort trap: 6
logout
// #include <Windows.h> 元はWindows用
#include <stdio.h>
#include <stdint.h>
#include "ftd2xx.h"
FT_STATUS ftStatus;
FT_HANDLE ftHandle;
DWORD w_data_len = 3; //write 3 bytes
DWORD data_written; // number of bytes written
UCHAR Mask = 0x0F; //00001111 Set D7-D4 input, D3-D0 output [input (0) and output (1)]
UCHAR Mode = 0x04; //0x04 = synchronous bit-bang
DWORD RxBytes; //number of bytes to be read from the device
DWORD BytesReceived; //number of bytes read from the device
uint8_t RxBuffer[8]; //buffer to receive data from FT-X device
uint8_t data_out[8]; //buffer for data to be sent to FT-X device
unsigned int i;
int main()
{
ftStatus = FT_Open(0, &ftHandle);
ftStatus |= FT_SetUSBParameters(ftHandle, 4096, 4096); // Set USB transfer sizes
ftStatus |= FT_SetChars(ftHandle, false, 0, false, 0); // Disable event characters
ftStatus |= FT_SetTimeouts(ftHandle, 5000, 5000); // Set read/write timeouts to 5 sec
ftStatus |= FT_SetLatencyTimer(ftHandle, 16); // Latency timer at default 16ms
ftStatus |= FT_SetFlowControl(ftHandle, FT_FLOW_NONE, 0x11, 0x13);
ftStatus |= FT_SetBaudRate(ftHandle, 62500); //bit rate is x16 this value = 1M
<以下略>