---------------------------------------------------------------------------
--
--                              -*- Mode: Ada -*-
-- Filename        : gyro_driver.ads
-- Description     : low level routines, including interrupt handler
--
----------------------------------------------------------------------------

with Ada.Real_Time;       use Ada.Real_Time;
with Gyro;                use Gyro;

package Gyro_driver is

   IsReading : Boolean := False;

----------------------------------------------------------------------------
--
-- GyroDriverInterface
--
----------------------------------------------------------------------------

   protected GyroDriverInterface is

      entry InitGyroDriver;
      entry ShutdownGyroDriver;

      entry SuspendGyroDriver;
      entry ResumeGyroDriver;

      entry GetMostRecentGyroData       (GyroData  : out GyroReading);
      entry GetMostRecentGyroTimeStamp  (TimeStamp : out Time);
      entry GetAllGyroSince             (TimeStamp    :  in Time;
                                         Readings     : out GyroReadingArray;
                                         NoOfReadings : out Natural);

   end GyroDriverInterface;

----------------------------------------------------------------------------
--
-- Syncronization Monitor
--
----------------------------------------------------------------------------

   protected GyroMonitor is

      entry BlockTask;
      entry BlockedTasksQueue;
      procedure FreeTasks;

   private

      NewGyroDataArrived      : Boolean := False;
      TasksWaitingForData     : Natural := 0;

   end GyroMonitor;


end Gyro_driver;