PD Buddy Sink Firmware
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

pdb.h 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * PD Buddy Firmware Library - USB Power Delivery for everyone
  3. * Copyright 2017-2018 Clayton G. Hobbs
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. #ifndef PDB_H
  18. #define PDB_H
  19. #include <pdb_fusb.h>
  20. #include <pdb_dpm.h>
  21. #include <pdb_pe.h>
  22. #include <pdb_prl.h>
  23. #include <pdb_int_n.h>
  24. #include <pdb_msg.h>
  25. /*
  26. * Structure for PD Buddy firmware library configuration
  27. *
  28. * Contains working areas for statically allocated threads, and therefore must
  29. * be statically allocated!
  30. */
  31. struct pdb_config {
  32. /* User-initialized fields */
  33. /* Configuration information for the FUSB302B* chip */
  34. struct pdb_fusb_config fusb;
  35. /* DPM callbacks */
  36. struct pdb_dpm_callbacks dpm;
  37. /* Pointer to port-specific DPM data */
  38. void *dpm_data;
  39. /* Automatically initialized fields */
  40. /* Policy Engine thread and related variables */
  41. struct pdb_pe pe;
  42. /* Protocol layer threads and related variables */
  43. struct pdb_prl prl;
  44. /* INT_N pin thread and related variables */
  45. struct pdb_int_n int_n;
  46. };
  47. /*
  48. * Initialize the PD Buddy firmware library, starting all its threads
  49. */
  50. void pdb_init(struct pdb_config *);
  51. #endif /* PDB_H */