You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

86 lines
2.9 KiB

  1. /*******************************************************************************
  2. File Name:
  3. nm_common.h
  4. Summary:
  5. This module contains WINC3400 BSP APIs declarations.
  6. Description:
  7. This module contains WINC3400 BSP APIs declarations.
  8. *******************************************************************************/
  9. //DOM-IGNORE-BEGIN
  10. /*******************************************************************************
  11. * Copyright (C) 2021 Microchip Technology Inc. and its subsidiaries.
  12. *
  13. * Subject to your compliance with these terms, you may use Microchip software
  14. * and any derivatives exclusively with Microchip products. It is your
  15. * responsibility to comply with third party license terms applicable to your
  16. * use of third party software (including open source software) that may
  17. * accompany Microchip software.
  18. *
  19. * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
  20. * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
  21. * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
  22. * PARTICULAR PURPOSE.
  23. *
  24. * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
  25. * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
  26. * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
  27. * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
  28. * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
  29. * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
  30. * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
  31. *******************************************************************************/
  32. //DOM-IGNORE-END
  33. /** @defgroup nm_bsp BSP
  34. @brief
  35. Description of the BSP (<strong>B</strong>oard <strong>S</strong>upport <strong>P</strong>ackage) module.
  36. @{
  37. @defgroup DataT Data Types
  38. @defgroup BSPDefine Defines
  39. @defgroup BSPAPI Functions
  40. @brief
  41. Lists the available BSP (<strong>B</strong>oard <strong>S</strong>upport <strong>P</strong>ackage) APIs.
  42. @}
  43. */
  44. /**@addtogroup BSPDefine
  45. @{
  46. */
  47. #ifndef _NM_BSP_H_
  48. #define _NM_BSP_H_
  49. #define BSP_MIN(x,y) ((x)>(y)?(y):(x))
  50. /*!<
  51. * Computes the minimum value between \b x and \b y.
  52. */
  53. /**@}*/ //BSPDefine
  54. /**
  55. * @addtogroup BSPDefine
  56. * @{
  57. */
  58. #ifdef _NM_BSP_BIG_END
  59. /*! Switch endianness of 32bit word (In the case that Host is BE) */
  60. #define NM_BSP_B_L_32(x) \
  61. ((((x) & 0x000000FF) << 24) + \
  62. (((x) & 0x0000FF00) << 8) + \
  63. (((x) & 0x00FF0000) >> 8) + \
  64. (((x) & 0xFF000000) >> 24))
  65. /*! Switch endianness of 16bit word (In the case that Host is BE) */
  66. #define NM_BSP_B_L_16(x) \
  67. ((((x) & 0x00FF) << 8) + \
  68. (((x) & 0xFF00) >> 8))
  69. #else
  70. /*! Retain endianness of 32bit word (In the case that Host is LE) */
  71. #define NM_BSP_B_L_32(x) (x)
  72. /*! Retain endianness of 16bit word (In the case that Host is LE) */
  73. #define NM_BSP_B_L_16(x) (x)
  74. #endif
  75. /**@}*/ //BSPDefine
  76. #endif /*_NM_BSP_H_*/