⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 triton_rtc.c

📁 OMAP1030 处理器的ARM 侧硬件测试代码 OMAP1030 是TI的双核处理器
💻 C
📖 第 1 页 / 共 3 页
字号:
    {
      RES_Set(ERR_RTC_DAY);
      err = TEST_BAD;
    }

  if ( RTC_MONTHS_REG_RD != 0x01 )
    {
      RES_Set(ERR_RTC_MON);
      err = TEST_BAD;
    }

  if ( RTC_YEARS_REG_RD != 0X00 )
    {
      RES_Set(ERR_RTC_YEAR);
      err = TEST_BAD;
    }

  if ( RTC_WEEK_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_WDAY);
      err = TEST_BAD;
    }

  // TC Alarm registers 

  if ( RTC_ALARM_SECONDS_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_ALARM_SEC);
      err = TEST_BAD;
    }

  if ( RTC_ALARM_MINUTES_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_ALARM_MIN);
      err = TEST_BAD;
    }

  if ( RTC_ALARM_HOURS_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_ALARM_HRS);
      err = TEST_BAD;
    }

  if ( RTC_ALARM_DAYS_REG_RD != 0x01 )
    {
      RES_Set(ERR_RTC_ALARM_DAY);
      err = TEST_BAD;
    }
	
  if ( RTC_ALARM_MONTHS_REG_RD != 0x01 )
    {
      RES_Set(ERR_RTC_ALARM_MON);
      err = TEST_BAD;
    }
	
  if ( RTC_ALARM_YEARS_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_ALARM_YEAR);
      err = TEST_BAD;
    }
	
  // General registers 

  if ( RTC_CTRL_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_CTRL_REG);
      err = TEST_BAD;
    }
	
  if ( RTC_INTERRUPTS_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_INTERRUPTS_REG);
      err = TEST_BAD;
    }
	
  if ( RTC_STATUS_REG_RD != 0x80 )
    {
      RES_Set(ERR_RTC_STATUS_REG);
      err = TEST_BAD;
    }

  RTC_STATUS_REG_WR(0x80);

  if ( RTC_STATUS_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_STATUS_REG);
      err = TEST_BAD;
    }
	
  // Compensation registers  

  if ( RTC_COMP_MSB_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_COMP_MSB_REG);
      err = TEST_BAD;
    }
	
  if ( RTC_COMP_LSB_REG_RD != 0x00 )
    {
      RES_Set(ERR_RTC_COMP_LSB_REG);
      err = TEST_BAD;
    }
	
  return err;
}


//-----------------------------------------------------------
// NAME 	: RTC_SECONDS_REG_WR
// DESCRIPTION	: Write in the RTC_SECONDS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_SECONDS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_SECONDS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_MINUTES_REG_WR
// DESCRIPTION	: Write in the RTC_MINUTES register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_MINUTES_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_MINUTES_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_HOURS_REG_WR
// DESCRIPTION	: Write in the RTC_HOURS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_HOURS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_HOURS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_DAYS_REG_WR
// DESCRIPTION	: Write in the RTC_DAYS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_DAYS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_DAYS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_MONTHS_REG_WR
// DESCRIPTION	: Write in the RTC_MONTHS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_MONTHS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_MONTHS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_YEARS_REG_WR
// DESCRIPTION	: Write in the RTC_YEARS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_YEARS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_YEARS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_WEEK_REG_WR
// DESCRIPTION	: Write in the RTC_WEEK register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_WEEK_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_WEEK_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_ALARM_SECONDS_REG_WR
// DESCRIPTION	: Write in the RTC_ALARM_SECONDS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_ALARM_SECONDS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_ALARM_SECONDS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_ALARM_MINUTES_REG_WR
// DESCRIPTION	: Write in the RTC_ALARM_MINUTES register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_ALARM_MINUTES_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_ALARM_MINUTES_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_ALARM_HOURS_REG_WR
// DESCRIPTION	: Write in the RTC_ALARM_HOURS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_ALARM_HOURS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_ALARM_HOURS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_ALARM_DAYS_REG_WR
// DESCRIPTION	: Write in the RTC_ALARM_DAYS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_ALARM_DAYS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_ALARM_DAYS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_ALARM_MONTHS_REG_WR
// DESCRIPTION	: Write in the RTC_ALARM_MONTHS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_ALARM_MONTHS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_ALARM_MONTHS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_ALARM_YEARS_REG_WR
// DESCRIPTION	: Write in the RTC_ALARM_YEARS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_ALARM_YEARS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_ALARM_YEARS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_CTRL_REG_WR
// DESCRIPTION	: Write in the RTC_CTRL register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_CTRL_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_CTRL_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_STATUS_REG_WR
// DESCRIPTION	: Write in the RTC_STATUS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_STATUS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_STATUS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_INTERRUPTS_REG_WR
// DESCRIPTION	: Write in the RTC_INTERRUPTS register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_INTERRUPTS_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_INTERRUPTS_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_COMP_LSB_REG_WR
// DESCRIPTION	: Write in the RTC_COMP_LSB register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_COMP_LSB_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_COMP_LSB_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_COMP_MSB_REG_WR
// DESCRIPTION	: Write in the RTC_COMP_MSB register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_COMP_MSB_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_COMP_MSB_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_COMP_REG_WR
// DESCRIPTION	: Write 16 bits in the RTC_COMP_LSB and MSB register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_COMP_REG_WR(const UWORD16 value)
{
  MSI2C_MasterPollingSend_16bits_Abb(Abb_RTC_COMP_LSB_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_RES_PROG_REG_WR
// DESCRIPTION	: Write in the RTC_RES_PROG register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_RES_PROG_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_RES_PROG_REG, value);
}


//-----------------------------------------------------------
// NAME 	: RTC_POWER_ON_RESET_REG_WR
// DESCRIPTION	: Write in the RTC_POWER_ON_RESET register of the Abb through the I2c
// RETURN VALUE	: none
// PARAMETERS	: values used to store
//-----------------------------------------------------------
void RTC_POWER_ON_RESET_REG_WR(const UWORD8 value)
{
  MSI2C_MasterPollingSendAbb(Abb_RTC_POWER_ON_RESET_REG, value);
}









⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -