jep106.h 1.1 KB

1234567891011121314151617181920212223242526
  1. /* https://github.com/openocd-org/openocd/blob/master/src/helper/ */
  2. /* SPDX-License-Identifier: GPL-2.0-or-later */
  3. /***************************************************************************
  4. * Copyright (C) 2015 Andreas Fritiofson *
  5. * andreas.fritiofson@gmail.com *
  6. ***************************************************************************/
  7. #ifndef OPENOCD_HELPER_JEP106_H
  8. #define OPENOCD_HELPER_JEP106_H
  9. /**
  10. * Get the manufacturer name associated with a JEP106 ID.
  11. * @param bank The bank (number of continuation codes) of the manufacturer ID.
  12. * @param id The 7-bit manufacturer ID (i.e. with parity stripped).
  13. * @return A pointer to static const storage containing the name of the
  14. * manufacturer associated with bank and id, or one of the strings
  15. * "<invalid>" and "<unknown>".
  16. */
  17. const char* jep106_table_manufacturer(unsigned int bank, unsigned int id);
  18. static inline const char* jep106_manufacturer(unsigned int manufacturer) {
  19. return jep106_table_manufacturer(manufacturer >> 7, manufacturer & 0x7f);
  20. }
  21. #endif /* OPENOCD_HELPER_JEP106_H */