Skip to content

“libtypec” is aimed to provide a generic interface abstracting all platform complexity for user space to develop tools for efficient USB-C port management. The library can also enable development of diagnostic and debug tools to debug system issues around USB-C/USB PD topology.

Notifications You must be signed in to change notification settings

jthiesatgoogle/libtypec-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT License

Copyright (c) 2022 Rajaram Regupathy <rajaram.regupathy@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

libtypec
++++++++

USB-Type C and USB Power Delivery systems are with multiple specification versions, platform designs and microcontroller vendors to manage data, power and display.

This library defines a generic way for userspace System Software on Linux, Android, Chrome OS or Other OSes to build developer tools or other management applications for USB-Type C and USB Power Delivery class devices.

Build Procedure
+++++++++++++++

This project was generated and developed using Microsoft Visual Studio Code (https://code.visualstudio.com/docs/cpp/cmake-linux). You could build using the steps given or follow the command line steps as below:

Step 1 - Generate build configuration for libtypec

../libtypec$ cmake CMakeLists.txt 
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xps/Documents/libtypec

Step 2 - Build libtypec which would be generated in the ../bin folder

../libtypec$ make
Scanning dependencies of target libtypec
[ 33%] Building C object CMakeFiles/libtypec.dir/libtypec.c.o
[ 66%] Building C object CMakeFiles/libtypec.dir/libtypec_sysfs_ops.c.o
[100%] Linking C static library bin/liblibtypec.a
[100%] Built target libtypec

Step 3 - Now generate build configuration for the ../utils directory

../libtypec/utils$ cmake CMakeLists.txt 
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xps/Documents/libtypec/utils

Step 4 - Build ../utils directory to generate utils based on libtypec library

../libtypec/utils$ make
Scanning dependencies of target lstypec
[ 50%] Building C object CMakeFiles/lstypec.dir/lstypec.c.o
[100%] Linking C executable lstypec
[100%] Built target lstypec

About

“libtypec” is aimed to provide a generic interface abstracting all platform complexity for user space to develop tools for efficient USB-C port management. The library can also enable development of diagnostic and debug tools to debug system issues around USB-C/USB PD topology.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 99.0%
  • CMake 1.0%