---------------------------------------------------------------------------- -- Copyright (C) 2016, AdaCore -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are -- met: -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- 2. Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in -- the documentation and/or other materials provided with the -- distribution. -- 3. Neither the name of the copyright holder nor the names of its -- contributors may be used to endorse or promote products derived -- from this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- ----------------------------------------------------------------------------
type Any_RTC_Device is access all RTC_Device'Class;
procedure Get (This : in out RTC_Device;
Time : out RTC_Time;
Date : out RTC_Date)
This procedure ensures coherent time and date values
function Get_Date (This : RTC_Device)
return HAL.Real_Time_Clock.RTC_Date
function Get_Time (This : RTC_Device)
return HAL.Real_Time_Clock.RTC_Time
type RTC_Date is record
Day_Of_Week : RTC_Day_Of_Week;
Day : RTC_Day;
Month : RTC_Month;
Year : RTC_Year;
end record;
type RTC_Day is range 1 .. 31;
type RTC_Day_Of_Week is (Monday, Tuesday, Wednesday, Thursday, Friday,
Saturday, Sunday);
type RTC_Device is limited interface;
type RTC_Hour is mod 24;
type RTC_Minute is mod 60;
type RTC_Month is (January, February, March, April, May, June, July, August,
September, October, November, December);
type RTC_Second is mod 60;
type RTC_Time is record
Hour : RTC_Hour;
Min : RTC_Minute;
Sec : RTC_Second;
end record;
type RTC_Year is range 00 .. 99;
procedure Set (This : in out RTC_Device;
Time : RTC_Time;
Date : RTC_Date)