chipcHw_str.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*****************************************************************************
  2. * Copyright 2008 Broadcom Corporation. All rights reserved.
  3. *
  4. * Unless you and Broadcom execute a separate written software license
  5. * agreement governing use of this software, this software is licensed to you
  6. * under the terms of the GNU General Public License version 2, available at
  7. * http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
  8. *
  9. * Notwithstanding the above, under no circumstances may you combine this
  10. * software in any way with any other Broadcom software provided under a
  11. * license other than the GPL, without Broadcom's express prior written
  12. * consent.
  13. *****************************************************************************/
  14. /****************************************************************************/
  15. /**
  16. * @file chipcHw_str.c
  17. *
  18. * @brief Contains strings which are useful to linux and csp
  19. *
  20. * @note
  21. */
  22. /****************************************************************************/
  23. /* ---- Include Files ---------------------------------------------------- */
  24. #include <mach/csp/chipcHw_inline.h>
  25. /* ---- Private Constants and Types --------------------------------------- */
  26. static const char *gMuxStr[] = {
  27. "GPIO", /* 0 */
  28. "KeyPad", /* 1 */
  29. "I2C-Host", /* 2 */
  30. "SPI", /* 3 */
  31. "Uart", /* 4 */
  32. "LED-Mtx-P", /* 5 */
  33. "LED-Mtx-S", /* 6 */
  34. "SDIO-0", /* 7 */
  35. "SDIO-1", /* 8 */
  36. "PCM", /* 9 */
  37. "I2S", /* 10 */
  38. "ETM", /* 11 */
  39. "Debug", /* 12 */
  40. "Misc", /* 13 */
  41. "0xE", /* 14 */
  42. "0xF", /* 15 */
  43. };
  44. /****************************************************************************/
  45. /**
  46. * @brief Retrieves a string representation of the mux setting for a pin.
  47. *
  48. * @return Pointer to a character string.
  49. */
  50. /****************************************************************************/
  51. const char *chipcHw_getGpioPinFunctionStr(int pin)
  52. {
  53. if ((pin < 0) || (pin >= chipcHw_GPIO_COUNT)) {
  54. return "";
  55. }
  56. return gMuxStr[chipcHw_getGpioPinFunction(pin)];
  57. }