You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.4 KiB

  1. set RTTC_RTMR [expr $AT91C_BASE_RTTC + 0x00]
  2. set RTTC_RTAR [expr $AT91C_BASE_RTTC + 0x04]
  3. set RTTC_RTVR [expr $AT91C_BASE_RTTC + 0x08]
  4. set RTTC_RTSR [expr $AT91C_BASE_RTTC + 0x0c]
  5. global RTTC_RTMR
  6. global RTTC_RTAR
  7. global RTTC_RTVR
  8. global RTTC_RTSR
  9. proc show_RTTC_RTMR_helper { NAME ADDR VAL } {
  10. set rtpres [expr $VAL & 0x0ffff]
  11. global BIT16 BIT17
  12. if { $rtpres == 0 } {
  13. set rtpres 65536;
  14. }
  15. global AT91C_SLOWOSC_FREQ
  16. # Nasty hack, make this a float by tacking a .0 on the end
  17. # otherwise, jim makes the value an integer
  18. set f [expr $AT91C_SLOWOSC_FREQ.0 / $rtpres.0]
  19. echo [format "\tPrescale value: 0x%04x (%5d) => %f Hz" $rtpres $rtpres $f]
  20. if { $VAL & $BIT16 } {
  21. echo "\tBit16 -> Alarm IRQ Enabled"
  22. } else {
  23. echo "\tBit16 -> Alarm IRQ Disabled"
  24. }
  25. if { $VAL & $BIT17 } {
  26. echo "\tBit17 -> RTC Inc IRQ Enabled"
  27. } else {
  28. echo "\tBit17 -> RTC Inc IRQ Disabled"
  29. }
  30. # Bit 18 is write only.
  31. }
  32. proc show_RTTC_RTSR_helper { NAME ADDR VAL } {
  33. global BIT0 BIT1
  34. if { $VAL & $BIT0 } {
  35. echo "\tBit0 -> ALARM PENDING"
  36. } else {
  37. echo "\tBit0 -> alarm not pending"
  38. }
  39. if { $VAL & $BIT1 } {
  40. echo "\tBit0 -> RTINC PENDING"
  41. } else {
  42. echo "\tBit0 -> rtinc not pending"
  43. }
  44. }
  45. proc show_RTTC { } {
  46. show_mmr32_reg RTTC_RTMR
  47. show_mmr32_reg RTTC_RTAR
  48. show_mmr32_reg RTTC_RTVR
  49. show_mmr32_reg RTTC_RTSR
  50. }