Skip to content

GNAT-Academic-Program/touch_generic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

touch_generic

Generic touch controller abstraction layer for bare-metal Ada applications.

Overview

touch_generic provides a hardware-independent touch controller interface for embedded systems. It abstracts capacitive touch controllers (like FT5336) through generic instantiation, supporting multi-touch with up to 10 simultaneous touch points.

Features

  • Hardware-agnostic touch controller abstraction
  • Multi-touch support (up to 10 simultaneous points)
  • Touch point coordinates and weight/pressure
  • Coordinate transformation (invert X/Y, swap XY)
  • Interrupt or polling modes
  • Zero runtime overhead through generic instantiation

API

Touch_Types

package Touch_Types is
   type Touch_State is record
      X      : Natural;
      Y      : Natural;
      Weight : Natural;
   end record;
   
   subtype Touch_Identifier is Natural range 0 .. 10;
   type Touch_Array is array (Touch_Identifier range <>) of Touch_State;
   
   type Swap_State is record
      Invert_X : Boolean := False;
      Invert_Y : Boolean := False;
      Swap_XY  : Boolean := False;
   end record;
end Touch_Types;

Touch_Interface

generic
   with procedure Driver_Set_Use_Interrupts (Enabled : Boolean);
   with function Driver_Active_Touch_Points return Touch_Identifier;
   with function Driver_Get_Touch_Point (Id : Touch_Identifier) return Touch_State;

package Touch_Interface is
   procedure Initialize (Enable_Interrupts : Boolean := False);
   function Active_Touch_Points return Touch_Identifier;
   function Get_Touch_Point (Id : Touch_Identifier) return Touch_State;
   function Get_All_Touch_Points return Touch_Array;
end Touch_Interface;

Integration

[[depends-on]]
touch_generic = "^0.1.0"

Used By

  • ft5336 - FT5336 capacitive touch controller driver
  • gesture - Touch gesture recognition

License

MIT OR Apache-2.0 WITH LLVM-exception

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages