コード例 #1
0
ファイル: DS2482.cpp プロジェクト: napanorton/paeae
uint8_t DS2482::wireSearch(uint8_t *newAddr)
{
	uint8_t i;
	uint8_t direction;
	uint8_t last_zero=0;
	
	if (searchExhausted) 
		return 0;
	
	if (!wireReset()) 
		return 0;

	busyWait(true);
	wireWriteByte(0xf0);
	
	for(i=1;i<65;i++) 
	{
		int romByte = (i-1)>>3;
		int romBit = 1<<((i-1)&7);
		
		if (i < searchLastDisrepancy)
			direction = searchAddress[romByte] & romBit;
		else
			direction = i == searchLastDisrepancy;
		
		busyWait();
		begin();
		Wire.send(0x78);
		Wire.send(direction ? 0x80 : 0);
		end();
		uint8_t status = busyWait();
		
		uint8_t id = status & DS2482_STATUS_SBR;
		uint8_t comp_id = status & DS2482_STATUS_TSB;
		direction = status & DS2482_STATUS_DIR;
		
		if (id && comp_id)
			return 0;
		else
		{ 
			if (!id && !comp_id && !direction)
				last_zero = i;
		}
		
		if (direction)
			searchAddress[romByte] |= romBit;
		else
			searchAddress[romByte] &= (uint8_t)~romBit;
	}

	searchLastDisrepancy = last_zero;

	if (last_zero == 0) 
		searchExhausted = 1;
	
	for (i=0;i<8;i++) 
		newAddr[i] = searchAddress[i];
	
	return 1;  
}
コード例 #2
0
ファイル: SimpleI2C.cpp プロジェクト: Yarr/Yarr
bool SimpleI2C::detectSlave(uint8_t dev)
{
	bool ret = false;

	// setup device address to communicate to
	m_spec->writeSingle(I2C_ADDR | I2C_TX, (dev << 1) | 0x1);
	m_spec->writeSingle(I2C_ADDR | I2C_CMD, I2C_CMD_WR | I2C_CMD_START);
	if(busyWait())
	{
		std::cerr << __PRETTY_FUNCTION__ << " : timeout when addressing slave!" << std::endl;
		return false;
	}

	// check for ack
	if((m_spec->readSingle(I2C_ADDR | I2C_STAT) & I2C_STAT_ACK) == 0)
	{
//		std::cout << __PRETTY_FUNCTION__ << " : no ack from slave!" << std::endl;
		ret = true;
	}

	// try to read one byte
	m_spec->writeSingle(I2C_ADDR | I2C_CMD, I2C_CMD_RD | I2C_CMD_ACK | I2C_CMD_STOP);
	if(busyWait())
	{
		std::cerr << __PRETTY_FUNCTION__ << " : timeout when reading from the slave!" << std::endl;
		return false;
	}

	return ret;
}
コード例 #3
0
ファイル: DS2482.cpp プロジェクト: napanorton/paeae
uint8_t DS2482::wireReadByte()
{
	busyWait(true);
	begin();
	Wire.send(0x96);
	end();
	busyWait();
	setReadPtr(PTR_READ);
	return readByte();
}
コード例 #4
0
ファイル: DS2482.cpp プロジェクト: napanorton/paeae
bool DS2482::wireReset()
{
	busyWait(true);
	begin();
	Wire.send(0xb4);
	end();
	
	uint8_t status = busyWait();
	
	return status & DS2482_STATUS_PPD ? true : false;
}
コード例 #5
0
ファイル: DS2482.cpp プロジェクト: napanorton/paeae
bool DS2482::selectChannel(uint8_t channel)
{	
	uint8_t ch, ch_read;

	switch (channel)
	{
		case 0:
		default:  
			ch = 0xf0; 
			ch_read = 0xb8; 
			break;
		case 1: 
			ch = 0xe1; 
			ch_read = 0xb1; 
			break;
		case 2: 
			ch = 0xd2; 
			ch_read = 0xaa; 
			break;
		case 3: 
			ch = 0xc3; 
			ch_read = 0xa3; 
			break;
		case 4: 
			ch = 0xb4; 
			ch_read = 0x9c; 
			break;
		case 5: 
			ch = 0xa5; 
			ch_read = 0x95; 
			break;
		case 6: 
			ch = 0x96; 
			ch_read = 0x8e; 
			break;
		case 7: 
			ch = 0x87; 
			ch_read = 0x87; 
			break;
	};

	busyWait(true);
	begin();
	Wire.send(0xc3);
	Wire.send(ch);
	end();
	busyWait();
	
	uint8_t check = readByte();
	
	return check == ch_read;
}
コード例 #6
0
int main(void)
{
  uint32_t sr;

  printf("Init syscall handler.\n\r");
  overwriteSYSCALL();

  // Configure the assertion fabric
  printf("Enabling the assertion fabric.\n\r");
  setAttackEnables(0);
  disableFabric();
  enableFabric();

  // Go to user mode
  printf("Going to user mode.\n\r");
  sr = getSPR(SPR_SR);
  sr = sr & 0xfffffffe;
  setSPR(SPR_SR, sr);

  // Do some stuff
  printf("Waiting.\n\r");
  busyWait();

  // Trigger attack
  printf("Triggering attack.\n\r");
  setAttackEnables(1 << 7);
  
  // Do some stuff
  printf("Waiting.\n\r");
  busyWait();

  printf("Syscall enter.\n\r");
  asm volatile(
      "l.sys 1234"
  );
  printf("Syscall exit.\n\r");

  // Do some stuff
  printf("Waiting.\n\r");
  busyWait();

  // Test
  printf("EEAR = %x.\n\r", getSPR(SPR_EEAR_BASE));
  if(getSPR(SPR_EEAR_BASE) != 0xdeadbeef)
    printf("DEFENSE SUCCESS\n\r");
  else
    printf("DEFENSE FAILURE\n\r");

  // Exit
  printf("Exit.\n\r");
  return 0;
}
コード例 #7
0
void resetCAN(){
	uint8_t resetCmd = CMD_RESET;
	wiringPiSPIDataRW (0, &resetCmd, 1);

	//needs calibration
	busyWait(TJ_PI_TWO_SEC_WAIT/2); //wait for device clock to stabilize
}
コード例 #8
0
ファイル: main.c プロジェクト: atiselsts/osw
void appMain(void)
{
    static uint8_t buffer[100];

    radioSetTxPower(TX_POWER);
    radioSetReceiveHandle(rcvRadio);
    radioOn();

    uint32_t lastTime = getTimeMs();

    for (;;) {
        int8_t rssi = radioGetLastRSSI();

        if ((int32_t) getTimeMs() - (int32_t) lastTime > 1000) {
            radioSend(buffer, sizeof(buffer));

            PRINTF("rssi=%d\n", rssi);
            lastTime = getTimeMs();
            if (rxOk) --rxOk;

            if (!rxOk) redLedOn();
            else redLedOff();
        }

        greenLedToggle();
        busyWait(getWaitInterval(rssi));
    }
}
コード例 #9
0
ファイル: DS2482.cpp プロジェクト: krysiu/brewtrolleralpha
void DS2482::write(uint8_t b, uint8_t power)
{
	busyWait(true);
	begin();
	Wire.send(0xa5);
	Wire.send(b);
	end();
}
コード例 #10
0
ファイル: DS2482.cpp プロジェクト: napanorton/paeae
void DS2482::wireWriteBit(uint8_t bit)
{
	busyWait(true);
	begin();
	Wire.send(0x87);
	Wire.send(bit ? 0x80 : 0);
	end();
}
コード例 #11
0
ファイル: DS2482.cpp プロジェクト: napanorton/paeae
void DS2482::wireWriteByte(uint8_t b)
{
	busyWait(true);
	begin();
	Wire.send(0xa5);
	Wire.send(b);
	end();
}
コード例 #12
0
ファイル: SimpleI2C.cpp プロジェクト: Yarr/Yarr
ssize_t SimpleI2C::write(uint8_t dev, uint8_t *buf, size_t len)
{
	// setup device address to communicate to
	m_spec->writeSingle(I2C_ADDR | I2C_TX, (dev << 1) | 0x0);
	m_spec->writeSingle(I2C_ADDR | I2C_CMD, I2C_CMD_WR | I2C_CMD_START);
	if(busyWait())
	{
		std::cerr << __PRETTY_FUNCTION__ << " : timeout when addressing slave!" << std::endl;
		return -1;
	}

        // check for ack
        if(m_spec->readSingle(I2C_ADDR | I2C_STAT) & I2C_STAT_ACK)
        {
//                std::cout << __PRETTY_FUNCTION__ << " :	no ack from slave!" << std::endl;
                return -1;
        }

	// write to the I2C device
	for(size_t i = 0; i < len; i++)
	{
		// prepare data
		m_spec->writeSingle(I2C_ADDR | I2C_TX, buf[i]);

		if(i == (len-1))
		{
			// stop
			m_spec->writeSingle(I2C_ADDR | I2C_CMD, I2C_CMD_WR | I2C_CMD_STOP);
		}
		else
		{
			m_spec->writeSingle(I2C_ADDR | I2C_CMD, I2C_CMD_WR);
		}

		// wait
		if(busyWait())
		{
			std::cerr << __PRETTY_FUNCTION__ << " : timeout when writing to the slave!" << std::endl;
			return -1;
		}
	}

	return len;
}
コード例 #13
0
ファイル: SimpleI2C.cpp プロジェクト: Yarr/Yarr
ssize_t SimpleI2C::read(uint8_t dev, uint8_t *buf, size_t len)
{
	// setup device address to communicate to
	m_spec->writeSingle(I2C_ADDR | I2C_TX, (dev << 1) | 0x1);
	m_spec->writeSingle(I2C_ADDR | I2C_CMD, I2C_CMD_WR | I2C_CMD_START);
	if(busyWait())
	{
		std::cerr << __PRETTY_FUNCTION__ << " : timeout when addressing slave!" << std::endl;
		return -1;
	}

	// check for ack
	if(m_spec->readSingle(I2C_ADDR | I2C_STAT) & I2C_STAT_ACK)
	{
//		std::cout << __PRETTY_FUNCTION__ << " : no ack from slave!" << std::endl;
		return -1;
	}

	// read data from I2C interface
	for(size_t i = 0; i < len; i++)
	{
		if(i == (len-1))
		{
			// nak + stop
			m_spec->writeSingle(I2C_ADDR | I2C_CMD, I2C_CMD_RD | I2C_CMD_ACK | I2C_CMD_STOP);
		}
		else
		{
			m_spec->writeSingle(I2C_ADDR | I2C_CMD, I2C_CMD_RD);
		}

		// wait
		if(busyWait())
		{
			std::cerr << __PRETTY_FUNCTION__ << " : timeout when reading from the slave!" << std::endl;
			return -1;
		}

		// get the data
		buf[i] = m_spec->readSingle(I2C_ADDR | I2C_RX);
	}

	return len;
}
コード例 #14
0
ファイル: DS2482.cpp プロジェクト: napanorton/paeae
bool DS2482::configure(uint8_t config)
{
	busyWait(true);
	begin();
	Wire.send(0xd2);
	Wire.send(config | (~config)<<4);
	end();

	return readByte() == config;
}
コード例 #15
0
ファイル: BrainBoard.cpp プロジェクト: b-radford/BrainBoard
// Do a quick hardware test to show that I'm alive.
uint16_t BrainBoard::quickSelfTest() 
{
  digitalWrite(FRONT_LEDS, HIGH);
  digitalWrite(LEFT_LEDS, HIGH);
  digitalWrite(RIGHT_LEDS, HIGH);
	busyWait(50);
  digitalWrite(FRONT_LEDS, LOW);
  digitalWrite(LEFT_LEDS, LOW);
  digitalWrite(RIGHT_LEDS, LOW);
}
コード例 #16
0
ファイル: main.cpp プロジェクト: oxullo/weatherpod
void setup()
{
    SPI.begin();
    Serial.begin(115200);
    pinMode(TC_ENABLE_PIN, OUTPUT);

    Serial.println("Waking up TCM");
    digitalWrite(TC_ENABLE_PIN, LOW);
    delay(10);
    busyWait();
}
コード例 #17
0
ファイル: main.cpp プロジェクト: oxullo/weatherpod
uint16_t sendCommand(uint8_t ins, uint8_t p1, uint8_t p2, uint8_t len, uint8_t *data)
{
    startTransmission();
    SPI.transfer(ins);
    SPI.transfer(p1);
    SPI.transfer(p2);

    if (len) {
        SPI.transfer(len);
        SPI.transfer(data, len);
    }
    endTransmission();
    busyWait();

    startTransmission();
    uint16_t rc = (SPI.transfer(0x00) << 8) | SPI.transfer(0x00);
    endTransmission();
    busyWait();

    return rc;
}
コード例 #18
0
ファイル: privEscTest.c プロジェクト: hoangt/SPECS
int main(void)
{
  unsigned int sr;

  // Configure the assertion fabric
  printf("Configuring assertion fabric.\n\r");
  disableFabric();
  configureFabric();
  enableFabric();

  // Go to user mode
  printf("Going to user mode.\n\r");
  sr = getSPR(SPR_SR);
  sr = sr & 0xfffffffe;
  setSPR(SPR_SR, sr);

  // Do some stuff
  printf("Waiting.\n\r");
  busyWait();

  // Trigger attack
  printf("Triggering attack.\n\r");
  setSPR(SPR_PCCR(3), 0x80000000);
  setSPR(SPR_PCCR(3), 0x00000000);

  // Do some stuff
  printf("Waiting.\n\r");
  busyWait();

  // Test
  if((getSPR(SPR_SR) & 0x1) == 0)
    printf("DEFENSE SUCCESS\n\r");
  else
    printf("DEFENSE FAILURE\n\r");

  // Exit
  printf("Exit.\n\r");
  return 0;
}
コード例 #19
0
//*****************************************************************************
//
//! pio_init
//!
//! \param  none
//!
//! \return none
//!
//! \brief  Initialize the board's I/O
//
//*****************************************************************************    
void pio_init()
{
    initClk();
    // Enable switches
    // P4.0 and P4.1 are configured as switches
    // Port 4 has only two pins    
    P4OUT |= BIT0;                     // Configure pullup resistor
    P4DIR &= ~(BIT0);                  // Direction = input
    P4REN |= BIT0;                     // Enable pullup resistor
    P4IES |= (BIT0);                   // P4.0 Hi/Lo edge interrupt  
    P4IFG = 0;                         // P4 IFG cleared
    P4IE = BIT0;                       // P4.0 interrupt enabled
    
    // Enable Smart Config Prefix changing jumper
    // To detect if pulled high by VCC
    
    // P3.3 is our High signal
    P3DIR |= BIT3;
    P3OUT |= BIT3;
        
    // P3.2 Configure pulled low and will detect a hi/low transition
    P3DIR &= ~(BIT2);             // P3.2 As Input
    P3OUT &= ~(BIT2);             // P3.2 With Pulldown
    P3REN |= BIT2;                // P3.2 Enable Pulldown
    P3IES &= ~(BIT2);             // P3.2 Lo/Hi edge interrupt
    P3IFG &= ~(BIT2);             // P3.2 IFG cleared
    P3IE |= BIT2;                 // P3.2 interrupt enabled

    
    // P4.1 - WLAN enable full DS
    P4OUT &= ~BIT1;
    P4DIR |= BIT1;
    P4SEL1 &= ~BIT1; 
    P4SEL0 &= ~BIT1;
    
    // Configure SPI IRQ line on P2.3
    P2DIR  &= (~BIT3);	
    P2SEL1 &= ~BIT3; 
    P2SEL0 &= ~BIT3;
    
    // Configure the SPI CS to be on P1.3
    P1OUT |= BIT3;
    P1DIR |= BIT3;
    P1SEL1 &= ~BIT3; 
    P1SEL0 &= ~BIT3;
    
	busyWait(50);
    
    // Initialize LEDs
    initLEDs();
}
コード例 #20
0
ファイル: DS18B20.cpp プロジェクト: ahessling/ActiveLoad
/** Starts a temperature conversion.
 *
 * @param wait True if function should block until temperature is converted
 * @return 0 if temperature has been converted; -1 if otherwise
 */
int DS18B20::startConversion(bool wait)
{
  int result = 0;

  if (TemperatureSensor::Unknown == _temperatureSensor)
  {
    // no conversion started before (first start)

    // identify chip (DS18B20 or DS18S20)
    result = readROM();

    if (0 != result)
    {
      // could not identify chip
      return result;
    }
    else
    {
      if (_romCode[0] == 0x28)
      {
        _temperatureSensor = TemperatureSensor::DS18B20Type;
      }
      else if (_romCode[0] == 0x10)
      {
        _temperatureSensor = TemperatureSensor::DS18S20Type;
      }
    }
  }

  result = reset();

  if (0 == result)
  {
    writeByte(0xCC); // Skip ROM
    writeByte(0x44); // Convert T

    if (true == wait)
    {
      // wait until conversion is completed
      result = busyWait();
    }

    _conversionStarted = true;
  }

  return result;
}
コード例 #21
0
ファイル: Timer.C プロジェクト: anshulgupta0803/ScalaTrace-TI
void Timer::simulateComputeTime(bool doComm, compute_t *_exec) {
  int sleep_duration = 0;

  comp_time = sleep_duration = getCompTime();

#ifdef SMPI_SIMULATION_ACTIVATED
  #ifdef SMPI_SIMULATION_TIME_INDEPENDENT
  long long flops = getNumInst();
  if (flops < 0) {
	cerr << "PAPI num instruction overflow!" << endl;
	exit(1);
  }
  //cout << "Simulating " << flops*1000.0 << " flops" << endl;
  smpi_execute_flops(flops*1000.0);	// Re-multiplying by 1000 (we had divided to avoid overflows)
  #else
  smpi_execute((double)comp_time / 1000000.0);
  #endif
  leftover = 0;
#else
  if(doComm)
    sleep_duration += getCommTime();
  sleep_duration -= getTime ();
  sleep_duration += leftover;
  /*if(my_rank == doTestFor){
		cout << comp_time << "   " << sleep_duration << endl;
	}*/

  if(sleep_duration > 0 && _exec){
    ( *(_exec->func) )( _exec->param );
    sleep_duration = getCompTime();
    if(doComm)
      sleep_duration += getCommTime();
    sleep_duration -= getTime();
    sleep_duration += leftover;
  }
  leftover = 0;

  if (sleep_duration > 0){
    leftover = busyWait(sleep_duration);
  } else {
    leftover = sleep_duration;
  }
#endif
}
コード例 #22
0
ファイル: init.c プロジェクト: johnhowe/SLMLCD
// Hardware initialisation function.
void InitController(void)
{
    // Set Flash Wait sate
    // Single Cycle Access at Up to 30 MHz, above (up to 55MHz):
    //   at least 1 flash wait state.
    // FMCN: flash microsecond cycle number: Number of MCLK cycles in one usec.
    //   For 20 MHz, this is 20. Value must be rounded up.
    AT91C_BASE_MC->MC_FMR = ((AT91C_MC_FMCN)&(22 <<16)) | AT91C_MC_FWS_0FWS;

    // Disable watchdog.
    AT91C_BASE_WDTC->WDTC_WDMR= AT91C_WDTC_WDDIS;

    AT91PS_PMC pPMC = AT91C_BASE_PMC;
    // After reset, CPU runs on slow clock (32kHz).
    // Enable main oscillator running on crystal by setting AT91C_CKGR_MOSCEN bit in PMC_MOR.
    // Furthermore, specify OSCOUNT in number of slow clock cycles divided by 8.
    // Hence, start up time = 8 * OSCOUNT / 32768 ; result in seconds.
    // OSCOUNT = 6 -> 1.46 ms.
    pPMC->PMC_MOR = (( AT91C_CKGR_OSCOUNT & (6U <<8)) | AT91C_CKGR_MOSCEN );
    // Wait the startup time...
    while(!(pPMC->PMC_SR & AT91C_PMC_MOSCS))
        continue;

    // Setting PLL and divider:
    // - div by 5 Fin = 3,6864 =(18,432 / 5)
    // - Mul 25+1: Fout =	95,8464 =(3,6864 *26)
    // for 96 MHz the erroe is 0.16%
    // Field out NOT USED = 0
    // PLLCOUNT pll startup time estimate at : 0.844 ms
    // PLLCOUNT 28 = 0.000844 /(1/32768)
    pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 0x05) |
            (AT91C_CKGR_PLLCOUNT & (28<<8)) |
            (AT91C_CKGR_MUL & (25<<16)));
    // Wait the startup time
    while(!(pPMC->PMC_SR & AT91C_PMC_LOCK));
    while(!(pPMC->PMC_SR & AT91C_PMC_MCKRDY));
    
    // Select master clock (MCK).
    // Bit 0,1: clock source (CSS):
    //    AT91C_PMC_CSS_SLOW_CLK (0) -> slow clock
    //    AT91C_PMC_CSS_MAIN_CLK (1) -> main clock
    //                            2  -> res
    //    AT91C_PMC_CSS_PLL_CLK  (3) -> PLL clock

    // Bit 2..4: Processor clock prescaler: Divide selected clock by 1,2,4,8,16,32,64:
    //    AT91C_PMC_PRES_CLK, AT91C_PMC_PRES_CLK_2, AT91C_PMC_PRES_CLK_4,...
    // We need to do this in 2 steps conforming to data sheet p.217.
    // STEP 1:
    pPMC->PMC_MCKR = AT91C_PMC_PRES_CLK_2 ; // PLL/2 ~= 22.2nS/tick
    // Wait for MCKRDY.
    while(!(pPMC->PMC_SR & AT91C_PMC_MCKRDY));
    // STEP 2:
    pPMC->PMC_MCKR |= AT91C_PMC_CSS_PLL_CLK  ;
    // Wait for MCKRDY.
    while(!(pPMC->PMC_SR & AT91C_PMC_MCKRDY));

    // Enable user reset, i.e. allow the controller to be reset by
    // pulling the NRST pin LOW. This aids in debugging.
    AT91C_BASE_RSTC->RSTC_RMR = 0xa5000400U | AT91C_RSTC_URSTEN;

    // Set up the default interrupt handlers for all interrupts.
    // 0 = FIQ, 1 = SYS.
    int i;
    for(i=0; i<31; i++)
    {
        AT91C_BASE_AIC->AIC_SVR[i] = (unsigned)&DefaultInterruptHandler;
    }
    // Set spurious interrupt handler. This does nothing and just returns
    // quickly.
    AT91C_BASE_AIC->AIC_SPU = (unsigned)&SpuriousInterruptHandler;

    // NOW, we can enable peripheral clocks if needed (PMC_PCER).
    // ...

    // TODO: Take this section elsewhere
    // Set up the IOs.
    volatile AT91PS_PIO	pPIO = AT91C_BASE_PIOA;
    /* LED_A == PD6 - NEED TO MODIFY PCB TO USE LED_A */
//    // Allow PIO to control LEDs.
//    pPIO->PIO_PER = LED_A;
//    // Enable outputs for LED pins.
//    pPIO->PIO_OER = LED_A;
//    // Set outputs HIGH to turn LEDs off.
//    pPIO->PIO_SODR = LED_A;

    // Enable PIO in output mode
    pPIO->PIO_PER = PA0 | PWR | PRD | PXCS | PRST | PD;
    pPIO->PIO_OER = PA0 | PWR | PRD | PXCS | PRST | PD;

    // Set all pins LOW
    pPIO->PIO_CODR = PA0 | PWR | PRD | PXCS | PRST | PD;

    busyWait (50000); // Waiting for power to stabalise
}
コード例 #23
0
ファイル: ex_sdram.c プロジェクト: bdunlay/RoboLock
/*****************************************************************************
** Function name:		SDRAMInit
**
** Descriptions:		Initialize external SDRAM memory Samsung 
**						K4S561632H, 256Mbit(4M x 16 bit). The same
**						code can be used for the Micron's MT48LC16M 
** 						For more info. regarding the details of the 
**						SDRAMs, go to their website for data sheet.  
**
** parameters:			None			 
** 						
** Returned value:		None
** 
*****************************************************************************/
void SDRAMInit( void )
{
  DWORD i, dummy = dummy;

  /*************************************************************************
  * Initialize EMC and SDRAM
  *************************************************************************/
//  SCS     |= 0x00000002;		/* Reset EMC */
//  SCS     |= 0x00000004;        /* Disable burst control */
  EMC_CTRL = 0x00000001;		/*Disable Address mirror*/
  PCONP   |= 0x00000800;		/* Turn On EMC PCLK */

  PINSEL5 &= 0xF0FCFCC0;        /* zero out the necessary bits */
  PINSEL5 |= 0x05010115;		/* set pins to CASn, RASn, CLKOUT0, DYCS0, CKEOUT0, DQMOUT[1:0] */
  PINSEL6  = 0x55555555;	    /* set pins to D[0:15] (data) */
  PINSEL8  = 0x15555555;		/* set pins to A[0:14] (address) */
  PINSEL9 &= 0xFFF0FFFF;        /* zero out the necessary bits */
  PINSEL9 |= 0x00050000;  		/* set pins to OEn, WEn */

  PINMODE5 &= 0xF0F0F000;       /* zero out the necessary bits */
  PINMODE5 |= 0x0A0A0AAA;       /* neither pullup nor pulldown resistors on CASn, RASn, CLKOUT[1:0], DYCS[1:0], CKEOUT[1:0], DQMOUT[1:0] */
  PINMODE6  = 0xAAAAAAAA;       /* neither PUP nor PDN rs on D[0:15] */
  PINMODE8 &= 0xC0000000;       /* zero out the necessary bits */
  PINMODE8 |= 0x2AAAAAAA;       /* neither PUP nor PDN rs on A[0:14] */
  PINMODE9 &= 0xFFF0FFFF;       /* zero out the necessary bits */
  PINMODE9 |= 0x000A0000;  		/* neither PUP nor PDN rs on OEn, WEn */
  
  EMC_DYN_RP     = 1;		/* command period: 2 clock cycles (1 clock cycle @ 72Mhz = 13.89ns) */
  EMC_DYN_RAS    = 3;		/* RAS command period: 4 clock cycles */
  EMC_DYN_SREX   = 5;		/* Self-refresh period: 6 clock cycles */
  EMC_DYN_APR    = 2;		/* Data out to active: 3 clock cycles */
  EMC_DYN_DAL    = 4;		/* Data in to active: 5 clock cycles */
  EMC_DYN_WR     = 1;		/* Write recovery: 2 clock cycles */
  EMC_DYN_RC     = 4;		/* Active to Active cmd: 5 clock cycles */
  EMC_DYN_RFC    = 4;		/* Auto-refresh: 5 clock cycles */
  EMC_DYN_XSR    = 5;		/* Exit self-refresh: 6 clock cycles */
  EMC_DYN_RRD    = 1;		/* Active bank A->B: 2 clock cycles */
  EMC_DYN_MRD    = 1;		/* Load Mode to Active cmd: 2 clock cycles */

  EMC_DYN_RD_CFG = 1;		/* Command delayed strategy */

  /* Default setting, RAS latency 3 CCLKs, CAS latenty 3 CCLKs. */
  EMC_DYN_RASCAS0 = 0x00000303;

  /* 128MB, 8Mx16, 4 banks, row=12, column=9 */
  EMC_DYN_CFG0 = 0x00080480;
  busyWait(100);			/* use timer 1, wait for 100ms */

  /* Mem clock enable, CLKOUT runs, send command: NOP */
  EMC_DYN_CTRL = 0x00000183;
  busyWait(200);			/* use timer 1, wait for 200ms */
    
  /* Send command: PRECHARGE-ALL, shortest possible refresh period */
  EMC_DYN_CTRL = 0x00000103;

  /* set 32 CCLKs between SDRAM refresh cycles */
  EMC_DYN_RFSH = 0x00000002;
  for(i = 0; i < 0x40; i++);	/* wait 128 AHB clock cycles */
    
  /* set 71 x 16CCLKs=1136CCLK=15.8us between SDRAM refresh cycles */
  EMC_DYN_RFSH = 71;
    
  /* To set mode register in SDRAM, enter mode by issue
  MODE command, after finishing, bailout and back to NORMAL mode. */    
  /* Mem clock enable, CLKOUT runs, send command: MODE */
  EMC_DYN_CTRL = 0x00000083;
  
  /* Set mode register in SDRAM */
  /* Mode regitster table for Micron's MT48LCxx */
  /* bit 9:   Programmed burst length(0)
     bit 8~7: Normal mode(0)
	 bit 6~4: CAS latency 3
	 bit 3:   Sequential(0)
	 bit 2~0: Burst length is 8
	 row position is 12 */
  dummy = *((volatile DWORD *)(SDRAM_BASE_ADDR | (0x33 << 12)));
  
  EMC_DYN_CTRL = 0x00000000;	  /* Send command: NORMAL */

  EMC_DYN_CFG0 = 0x00080480;	  /* Enable buffer */
  busyWait(1);				  /* Use timer 1 */
  return;

}
コード例 #24
0
ファイル: ex_sdram.c プロジェクト: bdunlay/RoboLock
void testSDRAM(void)
{
	  volatile DWORD *wr_ptr;
	  volatile BYTE *char_wr_ptr;
	  volatile WORD *short_wr_ptr;
	  DWORD  i;

//	  wr_ptr = (DWORD *)SDRAM_BASE_ADDR;
//	  while (1) {
//		  wr_ptr[0] = 0;
//		  wr_ptr[8193] = 0xff;
//	  }
	  printLED(0x01);

	  /* initialize memory */
	  //SDRAMInit();
	  printLED(0x02);

	  wr_ptr = (DWORD *)SDRAM_BASE_ADDR;
	  char_wr_ptr = (BYTE *)wr_ptr;
	  /* Clear content before 8 bit access test */
	  for ( i= 0; i < SDRAM_SIZE/4; i++ )
	  {
		*wr_ptr++ = 0;
	  }
	  printLED(0x04);

	  /* 8 bit write */
	  for (i=0; i<SDRAM_SIZE/4; i++)
	  {
		*char_wr_ptr++ = 0xAA;
		*char_wr_ptr++ = 0x55;
		*char_wr_ptr++ = 0x5A;
		*char_wr_ptr++ = 0xA5;
	  }
	  printLED(0x08);

	  /* verifying */
	  wr_ptr = (DWORD *)SDRAM_BASE_ADDR;
	  for ( i= 0; i < SDRAM_SIZE/4; i++ )
	  {
		//printLED(0xFF >> i/(SDRAM_SIZE/32));
		if ( *wr_ptr != 0xA55A55AA )	/* be aware of endianess */
		{
			printLED(0xAA);
			busyWait(50);
			printLED(0x55);
			busyWait(50);
			printLED(0xAA);
			busyWait(50);
			printLED(0x55);
			busyWait(300);
			printLED(*wr_ptr);
			busyWait(300);
			printLED(*wr_ptr >> 8);
			busyWait(300);
			printLED(*wr_ptr >> 16);
			busyWait(300);
			printLED(*wr_ptr >> 24);
			busyWait(300);
			break;
		}
		wr_ptr++;
	  }
コード例 #25
0
//*****************************************************************************
//
//!  main
//!
//!  \param  None
//!
//!  \return none
//!
//!  \brief   The main loop is executed here
//
//*****************************************************************************
void main(void)
{
  unsigned char loopCount = 0;
  int loop_time = 2000;

  ulCC3000Connected = 0;
  SendmDNSAdvertisment = 0;

  // Initialize hardware and interfaces
  board_init();
  initUart();
  sendString("System init : \r\n");

  // Must initialize one time for MAC address prepare..
  if (!Exosite_Init("exosite", "cc3000wifismartconfig", IF_WIFI, 0))
  {
    show_status();
    while(1);
  }

  // Main Loop
  while (1)
  {
    // Perform Smart Config if button pressed in current run or if flag set in FRAM
    // from previous MSP430 Run.
    if(runSmartConfig == 1 || *ptrFtcAtStartup == SMART_CONFIG_SET)
    {
      // Clear flag
      ClearFTCflag();
      unsetCC3000MachineState(CC3000_ASSOC);

      // Start the Smart Config Process
      StartSmartConfig();
      runSmartConfig = 0;
    }

    WDTCTL = WDTPW + WDTHOLD;
    // If connectivity is good, run the primary functionality
    if(checkWiFiConnected())
    {
      char * pbuf = exo_buffer;

      //unsolicicted_events_timer_disable();

      if (0 == cloud_status)
      { //check to see if we have a valid connection
        loop_time = 2000;

        loopCount = 1;

        while (loopCount++ <= (WRITE_INTERVAL+1))
        {
//          WDTCTL = WDT_ARST_1000;
          if (Exosite_Read("led7_ctrl", pbuf, EXO_BUFFER_SIZE))
          {
        	// Read success
        	turnLedOn(CC3000_CLIENT_CONNECTED_IND);

            if (!strncmp(pbuf, "0", 1))
              turnLedOff(LED7);
            else if (!strncmp(pbuf, "1", 1))
              turnLedOn(LED7);
          }
          else
          {
        	if (EXO_STATUS_NOAUTH == Exosite_StatusCode())
        	{
        		turnLedOff(CC3000_CLIENT_CONNECTED_IND);
        		// Activate device again
        		cloud_status = Exosite_Activate();
        	}
          }

          hci_unsolicited_event_handler();
          unsolicicted_events_timer_init();
          //sendString("== Exosite Read==\r\n");
          WDTCTL = WDTPW + WDTHOLD;
          busyWait(loop_time);        //delay before looping again
        }

        unsolicicted_events_timer_init();
    	if (EXO_STATUS_NOAUTH != Exosite_StatusCode())
    	{
          unsigned char sensorCount = 0;
          int value;
          char strRead[6]; //largest value of an int in ascii is 5 + null terminate
          WDTCTL = WDT_ARST_1000;
          for (sensorCount = 0; sensorCount < SENSOR_END; sensorCount++)
          {
            value = getSensorResult(sensorCount);                                       //get the sensor reading
            itoa(value, strRead, 10);                           //convert to a string
            unsolicicted_events_timer_init();
            //for each reading / data source (alias), we need to build the string "alias=value" (must be URL encoded)
            //this is all just an iteration of, for example, Exosite_Write("mydata=hello_world",18);
            memcpy(pbuf,&sensorNames[sensorCount][0],strlen(&sensorNames[sensorCount][0]));  //copy alias name into buffer
            pbuf += strlen(&sensorNames[sensorCount][0]);
            *pbuf++ = 0x3d;                                             //put an '=' into buffer
            memcpy(pbuf,strRead, strlen(strRead));                      //copy value into buffer
            pbuf += strlen(strRead);
            *pbuf++ = 0x26;                                             //put an '&' into buffer, the '&' ties successive alias=val pairs together
          }
          pbuf--;                                                                       //back out the last '&'
          WDTCTL = WDT_ARST_1000;
          Exosite_Write(exo_buffer,(pbuf - exo_buffer - 1));    //write all sensor values to the cloud

          if (EXO_STATUS_OK == Exosite_StatusCode())
          { // Write success
    	    turnLedOn(CC3000_CLIENT_CONNECTED_IND);
          }
    	}
      } else {
          //we don't have a good connection yet - we keep retrying to authenticate
    	  WDTCTL = WDTPW + WDTHOLD;
          //sendString("== Exosite Activate==\r\n");
          cloud_status = Exosite_Activate();
          if (0 != cloud_status) loop_time = 30000; //delay 30 seconds before retrying...
      }

        unsolicicted_events_timer_init();
      }
      WDTCTL = WDTPW + WDTHOLD;
      // TODO - make this a sleep instead of busy wait
      busyWait(loop_time);        //delay before looping again
    }
}
コード例 #26
0
ファイル: DS2482.cpp プロジェクト: krysiu/brewtrolleralpha
uint8_t DS2482::read_bit()
{
	write_bit(1);
	uint8_t status = busyWait(true);
	return status & DS2482_STATUS_SBR ? 1 : 0;
}
コード例 #27
0
ファイル: DS2482.cpp プロジェクト: napanorton/paeae
uint8_t DS2482::wireReadBit()
{
	wireWriteBit(1);
	uint8_t status = busyWait(true);
	return status & DS2482_STATUS_SBR ? 1 : 0;
}
コード例 #28
0
ファイル: test.c プロジェクト: BackupTheBerlios/tap-svn
int TAP_Main (void)
{
  AddTime(0, 0);
  BMP_WriteHeader(NULL, 0, 0);
  BootReason();
  BuildWindowBorder();
  BuildWindowInfo();
  BuildWindowLine();
  BuildWindowLineSelected();
  BuildWindowScrollBar();
  BuildWindowTitle();
  busyWait();
  CalcAbsSectorFromFAT(NULL, 0);
  CalcPrepare();
  CalcTopIndex(0, 0);
  Callback(0, NULL, 0, 0, 0, 0);
  CallbackHelper(NULL, NULL, 0, 0, 0, 0);
  CallBIOS(0, 0, 0, 0, 0);
  CallFirmware(0, 0, 0, 0, 0);
  CallTraceEnable(FALSE);
  CallTraceEnter(NULL);
  CallTraceExit(NULL);
  CallTraceInit();
  CaptureScreen(0, 0, 0, NULL, 0, 0);
  ChangeDirRoot();
  CheckSelectable(0, 0);
  combineVfdData(NULL, NULL);
  compact(NULL, 0);
  CompressBlock(NULL, 0, NULL);
  CompressedTFDSize(NULL, 0, NULL);
  CompressTFD(NULL, 0, NULL, 0, 0, NULL);
  CRC16(0, NULL, 0);
  CRC32 (0, NULL, 0);
  Delay(0);
  DialogEvent(NULL, NULL, NULL);
  DialogMsgBoxButtonAdd(NULL, FALSE);
  DialogMsgBoxExit();
  DialogMsgBoxInit(NULL, NULL, NULL, NULL);
  DialogMsgBoxShow();
  DialogMsgBoxShowInfo(0);
  DialogMsgBoxShowOK();
  DialogMsgBoxShowOKCancel(0);
  DialogMsgBoxShowYesNo(0);
  DialogMsgBoxShowYesNoCancel(0);
  DialogMsgBoxTitleSet(NULL, NULL);
  DialogProfileChange(NULL);
  DialogProfileCheck(NULL, NULL, FALSE);
  DialogProfileLoad(NULL);
  DialogProfileLoadDefault();
  DialogProfileLoadMy(NULL, FALSE);
  DialogProfileSave(NULL);
  DialogProfileSaveDefault();
  DialogProfileScrollBehaviourChange(FALSE, FALSE);
  DialogProgressBarExit();
  DialogProgressBarInit(NULL, NULL, 0, 0, NULL, 0, 0);
  DialogProgressBarSet(0, 0);
  DialogProgressBarShow();
  DialogProgressBarTitleSet(NULL);
  DialogWindowChange(NULL, FALSE);
  DialogWindowCursorChange(FALSE);
  DialogWindowCursorSet(0);
  DialogWindowExit();
  DialogWindowHide();
  DialogWindowInfoAddIcon(0, 0, NULL);
  DialogWindowInfoAddS(0, 0, 0, NULL, 0, 0, 0, 0, 0);
  DialogWindowInfoDeleteAll();
  DialogWindowInit(NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, 0, 0, 0);
  DialogWindowItemAdd(NULL, 0, NULL, 0, FALSE, FALSE, 0, NULL);
  DialogWindowItemAddSeparator();
  DialogWindowItemChangeFlags(0, FALSE, FALSE);
  DialogWindowItemChangeIcon(0, 0, NULL);
  DialogWindowItemChangeParameter(0, NULL, 0);
  DialogWindowItemChangeValue(0, NULL, 0);
  DialogWindowItemDelete(0);
  DialogWindowItemDeleteAll();
  DialogWindowRefresh();
  DialogWindowReInit(0, 0, 0, 0, 0, 0);
  DialogWindowScrollDown();
  DialogWindowScrollDownPage();
  DialogWindowScrollUp();
  DialogWindowScrollUpPage();
  DialogWindowShow();
  DialogWindowTabulatorSet(0, 0);
  DialogWindowTitleChange(NULL, NULL, NULL);
  DialogWindowTypeChange(0);
  DrawMsgBoxButtons();
  DrawMsgBoxTitle();
  DrawOSDLine(0, 0, 0, 0, 0, 0);
  DrawProgressBarBar(0, 0);
  DrawProgressBarTitle();
  DrawWindowBorder();
  DrawWindowInfo();
  DrawWindowLine(0);
  DrawWindowLines();
  DrawWindowScrollBar();
  DrawWindowTitle();
  EndMessageWin();
  exitHook();
  ExtractLine(NULL, NULL);
  FileSelector(NULL, NULL, NULL, 0);
  FileSelectorKey(0, 0);
  FindDBTrack();
  FindInstructionSequence(NULL, NULL, 0, 0, 0, 0);
  findSendToVfdDisplay(0, 0);
  FlashAddFavourite(NULL, 0, FALSE);
  FlashDeleteFavourites();
  FlashFindEndOfServiceNameTableAddress();
  FlashFindEndOfServiceTableAddress(0);
  FlashFindServiceAddress(0, 0, 0, 0);
  FlashFindTransponderIndex(0, 0, 0);
  FlashGetBlockStartAddress(0);
  FlashGetChannelNumber(0, 0, 0, 0);
  FlashGetSatelliteByIndex(0);
  FlashGetServiceByIndex(0, FALSE);
  FlashGetServiceByName (NULL, FALSE);
  FlashGetTransponderCByIndex(0);
  FlashGetTransponderSByIndex(0, 0);
  FlashGetTransponderTByIndex(0);
  FlashGetTrueLocalTime(0, 0);
  FlashGetType();
  FlashInitialize(0);
  FlashProgram();
  FlashReindexFavourites(0, 0, 0);
  FlashReindexTimers(0, 0, 0);
  FlashRemoveCASServices(FALSE);
  FlashRemoveServiceByIndex(0, FALSE);
  FlashRemoveServiceByIndexString(NULL, FALSE);
  FlashRemoveServiceByLCN(NULL, FALSE);
  FlashRemoveServiceByName(NULL, FALSE);
  FlashRemoveServiceByPartOfName(NULL, FALSE);
  FlashRemoveServiceByUHF(NULL, FALSE, FALSE);
  FlashServiceAddressToServiceIndex(NULL);
  FlashWrite(NULL, NULL, 0, NULL);
  FlushCache(NULL, 0);
  FreeOSDRegion(0);
  fwHook(0);
  GetAudioTrackPID(0, NULL);
  GetClusterPointer(0);
  GetCurrentEvent(NULL);
  GetEEPROMAddress();
  GetEEPROMPin();
  GetFrameBufferPixel(0, 0);
  GetFrameSize(0, 0);
  GetFWInfo(0, 0, 0, 0, 0, 0, 0, 0);
  GetHeapParameter(NULL, 0);
  GetLine(NULL, 0);
  GetOSDMapAddress();
  GetOSDRegionHeight(0);
  GetOSDRegionWidth(0);
  GetPinStatus();
  GetPIPPosition(NULL, NULL, NULL, NULL);
  getRECSlotAddress();
  GetSysOsdControl(0);
  GetToppyString(0);
  HasEnoughItemMemory();
  HDD_AAM_Disable();
  HDD_AAM_Enable(0);
  HDD_APM_Disable();
  HDD_APM_Enable(0);
  HDD_BigFile_Read(NULL, 0, 0, NULL);
  HDD_BigFile_Size(NULL);
  HDD_BigFile_Write(NULL, 0, 0, NULL);
  HDD_ChangeDir(NULL);
  HDD_DecodeRECHeader(NULL, NULL);
  HDD_EncodeRECHeader(NULL, NULL, 0);
  HDD_FappendOpen(NULL);
  HDD_FappendWrite(NULL, NULL);
  HDD_FindPCR(NULL, 0);
  HDD_FindPMT(NULL, 0, NULL);
  HDD_FreeSize();
  HDD_GetClusterSize();
  HDD_GetFileDir(NULL, 0, NULL);
  HDD_GetFirmwareDirCluster();
  HDD_GetHddID(NULL, NULL, NULL);
  HDD_IdentifyDevice(NULL);
  HDD_isAnyRecording();
  HDD_isCryptedStream(NULL, 0);
  HDD_isRecording(0);
  HDD_LiveFS_GetChainLength(0);
  HDD_LiveFS_GetFAT1Address();
  HDD_LiveFS_GetFAT2Address();
  HDD_LiveFS_GetFirstCluster(0);
  HDD_LiveFS_GetLastCluster(0);
  HDD_LiveFS_GetNextCluster(0);
  HDD_LiveFS_GetPreviousCluster(0);
  HDD_LiveFS_GetRootDirAddress();
  HDD_LiveFS_GetSuperBlockAddress();
  HDD_MakeNewRecName(NULL, 0);
  HDD_Move(NULL, NULL, NULL);
  HDD_ReadClusterDMA(0, NULL);
  HDD_ReadSector(0, 0);
  HDD_ReadSectorDMA(0, 0, NULL);
  HDD_RECSlotGetAddress(0);
  HDD_RECSlotIsPaused(0);
  HDD_RECSlotPause(0, FALSE);
  HDD_RECSlotSetDuration(0, 0);
  HDD_SetCryptFlag(NULL, 0);
  HDD_SetFileDateTime(NULL, 0, 0, 0);
  HDD_SetSkipFlag (NULL, FALSE);
  HDD_SetStandbyTimer(0);
  HDD_Smart_DisableAttributeAutoSave();
  HDD_Smart_DisableOperations();
  HDD_Smart_EnableAttributeAutoSave();
  HDD_Smart_EnableOperations();
  HDD_Smart_ExecuteOfflineImmediate(0);
  HDD_Smart_ReadData(0);
  HDD_Smart_ReadThresholdData(0);
  HDD_Smart_ReturnStatus();
  HDD_Stop();
  HDD_TAP_Callback(0, NULL, 0, 0, 0, 0);
  HDD_TAP_Disable(0, 0);
  HDD_TAP_DisableAll(0);
  HDD_TAP_DisabledEventHandler(0, 0, 0);
  HDD_TAP_GetCurrentDir(NULL);
  HDD_TAP_GetCurrentDirCluster();
  HDD_TAP_GetIDByFileName(NULL);
  HDD_TAP_GetIDByIndex(0);
  HDD_TAP_GetIndexByID(0);
  HDD_TAP_GetInfo(0, NULL);
  HDD_TAP_GetStartParameter();
  HDD_TAP_isAnyRunning();
  HDD_TAP_isBatchMode();
  HDD_TAP_isDisabled(0);
  HDD_TAP_isDisabledAll();
  HDD_TAP_isRunning(0);
  HDD_TAP_SendEvent(0, FALSE, 0, 0, 0);
  HDD_TAP_SetCurrentDirCluster(0);
  HDD_TAP_Start(NULL, FALSE, NULL, NULL);
  HDD_TAP_StartedByTAP();
  HDD_TAP_Terminate(0);
  HDD_TouchFile(NULL);
  HDD_TranslateDirCluster(0, NULL);
  HDD_TruncateFile(NULL, 0);
  HDD_Write(NULL, 0, NULL);
  HDD_WriteClusterDMA(0, NULL);
  HDD_WriteSectorDMA(0, 0, NULL);
  HookEnable(0, 0);
  HookExit();
  HookIsEnabled(0);
  HookMIPS_Clear(0, 0, 0);
  HookMIPS_Set(0, 0, 0);
  HookSet(0, 0);
  IMEM_Alloc(0);
  IMEM_Init(0);
  IMEM_isInitialized();
  IMEM_Compact();
  IMEM_Free(NULL);
  IMEM_GetInfo(NULL, NULL);
  IMEM_Kill();
  InfoTestGrid();
  INICloseFile();
  INIFindStartEnd(NULL, NULL, NULL, 0);
  INIGetARGB(NULL, NULL, NULL, NULL, NULL, 0);
  INIGetHexByte(NULL, 0, 0, 0);
  INIGetHexDWord(NULL, 0, 0, 0);
  INIGetHexWord(NULL, 0, 0, 0);
  INIGetInt(NULL, 0, 0, 0);
  INIGetString(NULL, NULL, NULL, 0);
  INIKillKey(NULL);
  INIOpenFile(NULL);
  INISaveFile(NULL);
  INISetARGB(NULL, 0, 0, 0, 0);
  INISetComment(NULL);
  INISetHexByte(NULL, 0);
  INISetHexDWord(NULL, 0);
  INISetHexWord(NULL, 0);
  INISetInt(NULL, 0);
  INISetString(NULL, NULL);
  initCodeWrapper(0);
  InitTAPAPIFix();
  InitTAPex();
  InteractiveGetStatus();
  InteractiveSetStatus(FALSE);
  intLock();
  intUnlock(0);
  isAnyOSDVisible(0, 0, 0, 0);
  isLegalChar(0, 0);
  isMasterpiece();
  isMPMenu();
  iso639_1(0);
  isOSDRegionAlive(0);
  isValidChannel(NULL);
  LangGetString(0);
  LangLoadStrings(NULL, 0, 0);
  LangUnloadStrings();
  Log(NULL, NULL, FALSE, 0, NULL);
  LowerCase(NULL);
  MakeValidFileName(NULL, 0);
  MHEG_Status();
  MPDisplayClearDisplay();
  MPDisplayClearSegments(0, 0);
  MPDisplayDisplayLongString(NULL);
  MPDisplayDisplayShortString(NULL);
  MPDisplayGetDisplayByte(0);
  MPDisplayGetDisplayMask(0);
  MPDisplayInstallMPDisplayFwHook();
  MPDisplaySetAmFlag(0);
  MPDisplaySetColonFlag(0);
  MPDisplaySetDisplayByte(0, 0);
  MPDisplaySetDisplayMask(0, 0);
  MPDisplaySetDisplayMemory(NULL);
  MPDisplaySetDisplayMode(0);
  MPDisplaySetPmFlag(0);
  MPDisplaySetSegments(0, 0);
  MPDisplayToggleSegments(0, 0);
  MPDisplayUninstallMPDisplayFwHook();
  MPDisplayUpdateDisplay();
  Now(NULL);
  OSDCopy(0, 0, 0, 0, 0, 0, 0);
  OSDLinesForeDirty(FALSE);
  ParseLine(NULL, NULL, 0);
  ProfileDirty();
  ProfileInit();
  ProfileLoad(NULL, FALSE);
  ProfileMayReload();
  ReadEEPROM(0, 0, NULL);
  ReadIICRegister(0, 0, 0, 0, NULL);
  Reboot(0);
  ReceiveSector(0);
  RTrim(NULL);
  SaveBitmap(NULL, 0, 0, NULL);
  SendEvent(0, 0, 0, 0);
  SendEventHelper(NULL, 0, 0, 0);
  SendHDDCommand(0, 0, 0, 0, 0, 0, 0);
  SendToFP(NULL);
  SeparatePathComponents(NULL, NULL, NULL, NULL);
  SetCrashBehaviour(0);
  setSymbol14(0, 0);
  setSymbol17(0, 0);
  ShowMessageWin(NULL, NULL, NULL, 0);
  ShowMessageWindow(NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  Shutdown(0);
  SoundSinus(0, 0, 0);
  StrEndsWith(NULL, NULL);
  stricstr(NULL, NULL);
  SubtitleGetStatus();
  SubtitleSetStatus(FALSE);
  SuppressedAutoStart();
  SwapDWords(0);
  SwapWords(0);
  TAP_Osd_PutFreeColorGd(0, 0, 0, NULL, FALSE, 0);
  TAPCOM_CloseChannel(NULL);
  TAPCOM_Finish(NULL, 0);
  TAPCOM_GetChannel(0, NULL, NULL, NULL, NULL);
  TAPCOM_GetReturnValue(NULL);
  TAPCOM_GetStatus(NULL);
  TAPCOM_LastAlive(NULL);
  TAPCOM_OpenChannel(0, 0, 0, NULL);
  TAPCOM_Reject(NULL);
  TAPCOM_StillAlive(NULL);
  TFDSize(NULL);
  TimeDiff(0, 0);
  TimeFormat(0, 0, 0);
  TunerGet(0);
  TunerSet(0);
  UncompressBlock(NULL, 0, NULL, 0);
  UncompressedFirmwareSize(NULL);
  UncompressedLoaderSize(NULL);
  UncompressedTFDSize(NULL);
  UncompressFirmware(NULL, NULL, NULL);
  UncompressLoader(NULL, NULL, NULL);
  UncompressTFD(NULL, NULL, NULL);
  UpperCase(NULL);
  ValidFileName(NULL, 0);
  WindowDirty();
  WriteIICRegister(0, 0, 0, 0, NULL);
  YUV2RGB(0, 0, 0, NULL, NULL, NULL);
  YUV2RGB2(0, 0, 0, NULL, NULL, NULL);

  return 0;
}
コード例 #29
0
//*****************************************************************************
//
//! exoHAL_MSDelay
//!
//!  \param  delay - milliseconds to delay
//!
//!  \return None
//!
//!  \brief  Delays for specified milliseconds
//
//*****************************************************************************
void
exoHAL_MSDelay(unsigned short delay)
{
  busyWait(delay);
  return;
}