text
stringlengths 0
234
|
|---|
procedure Set_Underline_Height (This : in out TP_Device; Height : Underline_Height) is
|
begin
|
Write (This, ASCII.ESC & '-' & To_Char (Height));
|
end Set_Underline_Height;
|
-----------------------
|
-- Set_Character_Set --
|
-----------------------
|
procedure Set_Character_Set (This : in out TP_Device; Set : Character_Set) is
|
begin
|
Write (This, ASCII.ESC & 't' & To_Char (Character_Set'Pos (Set)));
|
end Set_Character_Set;
|
----------
|
-- Feed --
|
----------
|
procedure Feed (This : in out TP_Device; Rows : UInt8) is
|
begin
|
Write (This, ASCII.ESC & 'd' & To_Char (Rows));
|
end Feed;
|
------------------
|
-- Print_Bitmap --
|
------------------
|
procedure Print_Bitmap (This : in out TP_Device;
|
BM : Thermal_Printer_Bitmap)
|
is
|
Nbr_Of_Rows : constant Natural := BM'Length (2);
|
Nbr_Of_Columns : constant Natural := BM'Length (1);
|
Str : String (1 .. Nbr_Of_Columns / 8);
|
begin
|
Write (This, ASCII.DC2 & 'v' &
|
To_Char (UInt8 (Nbr_Of_Rows rem 256)) &
|
To_Char (UInt8 (Nbr_Of_Rows / 256)));
|
for Row in 0 .. Nbr_Of_Rows - 1 loop
|
for Colum in 0 .. (Nbr_Of_Columns / 8) - 1 loop
|
declare
|
BM_Index : constant Natural := BM'First (1) + Colum * 8;
|
Str_Index : constant Natural := Str'First + Colum;
|
B : UInt8 := 0;
|
begin
|
for X in 0 .. 7 loop
|
B := B or (if BM (BM_Index + X,
|
BM'First (2) + Row)
|
then 2**X else 0);
|
end loop;
|
Str (Str_Index) := To_Char (B);
|
Function Definition: function As_UInt8 is new Ada.Unchecked_Conversion
|
Function Body: (Source => High_Pass_Filter_Mode, Target => UInt8);
|
function As_UInt8 is new Ada.Unchecked_Conversion
|
(Source => High_Pass_Cutoff_Frequency, Target => UInt8);
|
function As_UInt8 is new Ada.Unchecked_Conversion
|
(Source => Power_Mode_Selection, Target => UInt8);
|
function As_UInt8 is new Ada.Unchecked_Conversion
|
(Source => Output_Data_Rate_Selection, Target => UInt8);
|
function As_UInt8 is new Ada.Unchecked_Conversion
|
(Source => Axes_Selection, Target => UInt8);
|
function As_UInt8 is new Ada.Unchecked_Conversion
|
(Source => Bandwidth_Selection, Target => UInt8);
|
function As_UInt8 is new Ada.Unchecked_Conversion
|
(Source => Block_Data_Update_Selection, Target => UInt8);
|
function As_UInt8 is new Ada.Unchecked_Conversion
|
(Source => Endian_Data_Selection, Target => UInt8);
|
function As_UInt8 is new Ada.Unchecked_Conversion
|
(Source => Full_Scale_Selection, Target => UInt8);
|
type Angle_Rate_Pointer is access all Angle_Rate with Storage_Size => 0;
|
function As_Angle_Rate_Pointer is new Ada.Unchecked_Conversion
|
(Source => System.Address, Target => Angle_Rate_Pointer);
|
-- So that we can treat the address of a UInt8 as a pointer to a two-UInt8
|
-- sequence representing a signed integer quantity.
|
procedure Swap2 (Location : System.Address) with Inline;
|
-- Swaps the two UInt8s at Location and Location+1
|
procedure SPI_Mode (This : Three_Axis_Gyroscope; Enabled : Boolean);
|
-- Enable or disable SPI mode communication with the device. This is named
|
-- "chip select" in other demos/examples.
|
----------------
|
-- Initialize --
|
----------------
|
procedure Initialize
|
(This : in out Three_Axis_Gyroscope;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.