Beispiel #1
0
int
main()
{
	setup_perfect();
//	setup_memory(1, 0xEA, 0x00, 0x00, 0, 0, 0, 0, 0);
//	setup_memory(2, 0xA9, 0x00, 0x00, 0, 0, 0, 0, 0);
//	setup_memory(2, 0xAD, 0x00, 0x10, 0, 0, 0, 0, 0);
//	setup_memory(3, 0xFE, 0x00, 0x10, 0, 0, 0, 0, 0);
//	setup_memory(3, 0x9D, 0xFF, 0x10, 0, 2, 0, 0, 0);
	setup_memory(1, 0x28, 0x00, 0x00, 0x55, 0, 0, 0x80, 0);
	resetChip();
	int instr_cycles = perfect_measure_instruction();

	for (int c = 0; c < instr_cycles; c++ ) {
		printf("T%d ", c+1);
		if (instr_rw[c])
			printf("R $%04X\n", instr_ab[c]);
		else
			printf("W $%04X = $%02X\n", instr_ab[c], instr_db[c]);
	}

	setup_emu();
	setup_memory(1, 0x48, 0x00, 0x00, 0x55, 0, 0, 0x80, 0);
	reset_emu();
	int instr_cycles2 = emu_measure_instruction();

}
Beispiel #2
0
void DWM1000_Anchor::init() {
	INFO("HSPI");
//_________________________________________________INIT SPI ESP8266

	resetChip();
	initSpi();
	enableIsr();

	uint64_t eui = 0xF1F2F3F4F5F6F7F;
	dwt_seteui((uint8_t*) &eui);
	dwt_geteui((uint8_t*) &eui);
	LOG<< HEX << "EUID : "<< eui <<FLUSH;
	dwt_seteui((uint8_t*) &eui);
	dwt_geteui((uint8_t*) &eui);
	LOG<< HEX << "EUID : "<< eui <<FLUSH;

//	dwt_softreset();
	deca_sleep(100);

	if (dwt_initialise(DWT_LOADUCODE)) {
		LOG<< " dwt_initialise failed " << FLUSH;
	} else
	LOG<< " dwt_initialise done." << FLUSH;
	if (dwt_configure(&config)) {
		LOG<< " dwt_configure failed " << FLUSH;
	} else
	LOG<< " dwt_configure done." << FLUSH;

	uint32_t device_id = dwt_readdevid();
	uint32_t part_id = dwt_getpartid();
	uint32_t lot_id = dwt_getlotid();

	LOG<< HEX << " device id : " << device_id << ", part id : " << part_id << ", lot_id :" << lot_id <<FLUSH;

	/* Apply default antenna delay value. See NOTE 1 below. */
	dwt_setrxantennadelay(RX_ANT_DLY);
	dwt_settxantennadelay(TX_ANT_DLY);

	/* Set expected response's delay and timeout. See NOTE 4 and 5 below.
	 * As this example only handles one incoming frame with always the same delay and timeout, those values can be set here once for all. */
	dwt_setrxaftertxdelay(POLL_TX_TO_RESP_RX_DLY_UUS);
	dwt_setrxtimeout(RESP_RX_TIMEOUT_UUS);

	dwt_initialise(DWT_LOADUCODE);
	// Configure the callbacks from the dwt library
	dwt_setcallbacks(txcallback, rxcallback);

	_count = 0;
}