1 2 3typedef struct xpgminfo_s { 4 /* 5 * Info about our FPGA 6 */ 7 uint64_t INITpin; 8 uint64_t DONEpin; 9 uint64_t PGMpin; 10 uint64_t DINpin; 11 uint64_t DOUTpin; 12 uint64_t CCLKpin; 13 14 /* 15 * Private state 16 */ 17 uint64_t olddir; /* old state of GPIO direction bits */ 18} xpgminfo_t; 19 20 21/* timeout after 10 ms */ 22#define XPGM_TIMEOUT 10000000 23 24/* Errors */ 25#define XPGM_ERR_INIT_NEVER_LOW -1 26#define XPGM_ERR_INIT_NEVER_HIGH -2 27#define XPGM_ERR_INIT_NOT_HIGH -3 28#define XPGM_ERR_DONE_NOT_HIGH -4 29#define XPGM_ERR_OPEN_FAILED -5 30#define XPGM_ERR_CLOSE_FAILED -6 31 32 33/* ********************************************************************* 34 * Prototypes 35 ********************************************************************* */ 36 37int xilinx_program(xpgminfo_t *xi,uint8_t *configBits, int nofBits); 38