File: /home/oboss/Users/gec/sources/Demonstrator/Low_Level_Drivers/serial_interface-uart_interface.ads

1     --% Compilation Unit:	Serial_Interface.UART_Interface
2     --
3     --% Category: Package Declaration
4     --
5     --% Release:  $Name:  $
6     --
7     --% Version:  $Revision: 2.0 $
8     --
9     --% Author:   $Author: gec $
10     --
11     --% Revision Log:
12     --    $Log: serial_interface-uart_interface.ads,v $
13     --    Revision 2.0  2003/04/04 08:50:31  gec
14     --    Initial release of source files serving as baseline for OBOSS-III project.
15     --
16     --    Revision 1.1.1.1  2003/04/04 08:13:05  gec
17     --    Imported using TkCVS
18     --
19     --
20     --
21     --% Project: OBOSS
22     --
23     --% Copyright (C) 2003 by Terma A/S
24     --  Proprietary and intellectual rights of Terma A/S, Denmark,
25     --  are involved in the subject-matter of this material and
26     --  all manufacturing, reproduction, use, disclosure, and
27     --  sales rights pertaining to such subject-matter are
28     --  expressly reserved. This material is submitted for a
29     --  specific purpose as agreed, and the recipient by
30     --  accepting this material agrees that this material will
31     --  not be used, copied, or reproduced in whole or in part
32     --  nor its contents revealed in any manner or to any person,
33     --  except to meet the purpose for which it was submitted and
34     --  subject to the terms of the agreement.
35     --
36     --% Target Dependencies:
37     --    None
38     --% Compiler Dependencies:
39     --    None
40     
41     --~-----------------------------------------------------------------------------
42     
43     with Task_Priority_Control;
44     private generic
45     
46        -- UART channel to be interfaced by the instance
47        Channel : in     Kernel.Peripherals.UART_Channel;
48        -- Priority of critical region protecting  UART access
49        UART_Protection_Priority
50                                 : in     Task_Priority_Control.
51                                   Passive_Task_Priority;
52     
53     package Serial_Interface.UART_Interface is
54     
55        --% Library Package:
56        --    Interface to the UART identified by channel.
57        --    Protected by common critical region
58        --% Active Tasks:
59        -->   None
60        --% Passive Tasks:
61        -->   UART - Ensure atomic UART operations
62     
63        type Status is
64           record
65              Data_Ready             : Boolean; -- Data Ready
66              Send_Register_Empty    : Boolean; --Send register Empty (no data to
67                                                  --+    send)
68              Holding_Register_Empty : Boolean; --  Holding register Empty (ready to
69                                                  --+    load data)
70              Framing_Error          : Boolean; --  Framing Error
71              Parity_Error           : Boolean; --  Parity Error
72              Overrun_Error          : Boolean; --  Overrun Error
73           end record;
74     
75     
76        --% Subprogram:
77        --    To be called by the UART interrupt handler when UART status indicate
78        --+    that a new Put transaction may be initiated
79        --% Parameter Constraints:
80        -->   None
81        --% Exceptions Raised:
82        -->   None
83        procedure Signal_Transmission_Is_Ready;
84     
85        --% Subprogram:
86        --    Atomic access to Tx Register for UART identified by Channel
87        --% Parameter Constraints:
88        -->   None
89        --% Exceptions Raised:
90        -->   None
91        procedure Write_TX_Register
92              (Data : in     Basic_Types.Byte);
93     
94        --% Subprogram:
95        --    Atomic access to RX register for UART identified by Channel.
96        --% Parameter Constraints:
97        -->   None
98        --% Exceptions Raised:
99        -->   None
100        function Read_RX_Register
101              return Basic_Types.Byte;
102     
103        --% Subprogram:
104        --    Atomic access to status register for UART identified by Channel.
105        --% Parameter Constraints:
106        -->   None
107        --% Exceptions Raised:
108        -->   None
109        function Read_Status_Register
110              return Status;
111     
112     end Serial_Interface.uart_Interface;
113     
114     --~-----------------------------------------------------------------------------
115