Exemple #1
0
static int __init ali14xx_probe(void)
{
	ide_hwif_t *hwif, *mate;

	printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n",
			  basePort, regOn);

	/* initialize controller registers */
	if (!initRegisters()) {
		printk(KERN_ERR "ali14xx: Chip initialization failed.\n");
		return 1;
	}

	hwif = &ide_hwifs[0];
	mate = &ide_hwifs[1];

	hwif->chipset = ide_ali14xx;
	hwif->tuneproc = &ali14xx_tune_drive;
	hwif->mate = mate;

	mate->chipset = ide_ali14xx;
	mate->tuneproc = &ali14xx_tune_drive;
	mate->mate = hwif;
	mate->channel = 1;

	probe_hwif_init(hwif);
	probe_hwif_init(mate);

	return 0;
}
void RFM70::begin() {

    initHardware();

    rfm70_SPI.begin();
    rfm70_SPI.setDataMode(SPI_MODE0);
    rfm70_SPI.setBitOrder(MSBFIRST);

    // Set the SPI frequency to be one sixteenth of the frequency of the system clock
    rfm70_SPI.setClockDivider(RFM77_DEFAULT_SPI_CLOCK_DIV);
    digitalWrite(_cs, LOW);
    delay(100);

    delayMs(RFM70_BEGIN_INIT_WAIT_MS);
    initRegisters();

    confAddrWidth(3);
    //max power
    configRfPower(3);
    //gain
    configLnaGain(1);
    //default mode is rx mode
    setMode(MODE_PRX);

}
Exemple #3
0
/*
 * Init instruction generation.
 */
jboolean
initInsnSequence(int localsz, int stacksz, errorInfo* einfo)
{
	/* Clear various counters */
	tmpslot = 0;
	maxTemp = 0;
	maxPush = 0;
	stackno = localsz + stacksz;
	npc = 0;

	initSeq();
	initRegisters();
	initSlots(stackno);

	/* Before generating code, try to guess how much space we'll need. */
	codeblock_size = ALLOCCODEBLOCKSZ;
	codeblock = gc_malloc(codeblock_size + CODEBLOCKREDZONE,
			      KGC_ALLOC_JIT_CODEBLOCK);
	if (codeblock == 0) {
		postOutOfMemory(einfo);
		return (false);
	}
	CODEPC = 0;
	
	return (true);
}
Exemple #4
0
static int __init ali14xx_probe(void)
{
    printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n",
           basePort, regOn);

    /* initialize controller registers */
    if (!initRegisters()) {
        printk(KERN_ERR "ali14xx: Chip initialization failed.\n");
        return 1;
    }

    return ide_legacy_device_add(&ali14xx_port_info, 0);
}
Exemple #5
0
void generateASM(ANTLR3_BASE_TREE *node) {
  debug(DEBUG_GENERATION, "\033[22;93mGenerate ASM\033[0m");
  initRegisters();

  program = initChunk();

  addInstruction(program, "SP EQU R15");
  addInstruction(program, "FP EQU R14");
  addInstruction(program, "DISPLAY EQU R13");
  // TODO - dynamise load adr
  addInstruction(program, "ORG 0xE000");
  addInstruction(program, "START MAIN");


  chunk *stack = stackEnvironement();
  chunk *instructionASM = computeInstruction(node);
  chunk *unstack = unstackEnvironement();


  addInstruction(program, "\n\n\n// PRGM");
  addEtiquette(program, "MAIN");
  addInstruction(program, "STACKBASE 0x1000");
  addInstruction(program, "LDW FP, SP");
  addInstruction(program, "LDW DISPLAY, #0x2000");
  addInstruction(program, "// STACK FACK RETURN");
  addInstruction(program, "ADQ -2, SP");
  appendChunks(program, stack);
  appendChunks(program, instructionASM);
  appendChunks(program, unstack);
  addInstruction(program, "// UNSTACK FACK RETURN");
  addInstruction(program, "ADQ 2, SP");


  FILE *file = fopen("a.asm", "w");
  fprintf(file, program->string);
  fclose(file);

  // printChunk(program);

  freeChunk(instructionASM);
  freeChunk(stack);
  freeChunk(unstack);
  freeChunk(program);
}
Exemple #6
0
void init_ali14xx (void)
{
	/* auto-detect IDE controller port */
	if (!findPort()) {
		printk("ali14xx: not found\n");
		return;
	}

	printk("ali14xx: base= 0x%03x, regOn = 0x%02x\n", basePort, regOn);
	ide_hwifs[0].chipset = ide_ali14xx;
	ide_hwifs[1].chipset = ide_ali14xx;
	ide_hwifs[0].tuneproc = &ali14xx_tune_drive;
	ide_hwifs[1].tuneproc = &ali14xx_tune_drive;

	/* initialize controller registers */
	if (!initRegisters()) {
		printk("ali14xx: Chip initialization failed\n");
		return;
	}
}
Exemple #7
0
void RFM70::begin() {

	initHardware();

	initSPI();

	delayMs(RFM70_BEGIN_INIT_WAIT_MS);
	initRegisters();
#if 0
	confAddrWidth(3);


	//max power
	configRfPower(3);
	//gain
	configLnaGain(1);
	//default mode is rx mode
	setMode(MODE_PRX);
#endif
}