Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

142 wiersze
4.2 KiB

  1. /**
  2. *
  3. * \file
  4. *
  5. * \brief This module contains WINC3400 ASIC specific internal APIs.
  6. *
  7. * Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
  8. *
  9. * \asf_license_start
  10. *
  11. * \page License
  12. *
  13. * Subject to your compliance with these terms, you may use Microchip
  14. * software and any derivatives exclusively with Microchip products.
  15. * It is your responsibility to comply with third party license terms applicable
  16. * to your use of third party software (including open source software) that
  17. * may accompany Microchip software.
  18. *
  19. * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
  20. * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
  21. * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
  22. * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
  23. * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
  24. * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
  25. * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
  26. * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
  27. * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
  28. * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
  29. * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
  30. *
  31. * \asf_license_stop
  32. *
  33. */
  34. #ifndef _NMASIC_H_
  35. #define _NMASIC_H_
  36. #include "common/include/nm_common.h"
  37. #define NMI_PERIPH_REG_BASE 0x1000
  38. #define NMI_CHIPID (NMI_PERIPH_REG_BASE)
  39. #define rNMI_GP_REG_0 (0x149c)
  40. #define rNMI_GP_REG_1 (0x14A0)
  41. #define rNMI_GLB_RESET (0x1400)
  42. #define rNMI_BOOT_RESET_MUX (0x1118)
  43. #define NMI_STATE_REG (0x108c)
  44. #define BOOTROM_REG (0xc000c)
  45. #define NMI_REV_REG (0x207ac) /*Also, Used to load ATE firmware from SPI Flash and to ensure that it is running too*/
  46. #define M2M_WAIT_FOR_HOST_REG (0x207bc)
  47. #define M2M_FINISH_INIT_STATE 0x02532636UL
  48. #define M2M_FINISH_BOOT_ROM 0x10add09eUL
  49. #define M2M_START_FIRMWARE 0xef522f61UL
  50. #define M2M_START_PS_FIRMWARE 0x94992610UL
  51. #define M2M_ATE_FW_START_VALUE (0x3C1CD57D) /*Also, Change this value in boot_firmware if it will be changed here*/
  52. #define M2M_ATE_FW_IS_UP_VALUE (0xD75DC1C3) /*Also, Change this value in ATE (Burst) firmware if it will be changed here*/
  53. #define REV_2B0 (0x2B0)
  54. #define REV_B0 (0x2B0)
  55. #define REV_3A0 (0x3A0)
  56. #define CHIP_ID_3000D (0x3000D0)
  57. #define GET_CHIPID() nmi_get_chipid()
  58. #define ISNMC1000(id) (((id & 0xfffff000) == 0x100000) ? 1 : 0)
  59. #define ISNMC1500(id) (((id & 0xfffff000) == 0x150000) ? 1 : 0)
  60. #define ISNMC3400(id) (((id & 0xfff0f000) == 0x300000) ? 1 : 0)
  61. #define REV(id) ( ((id) & 0x00000fff ) )
  62. #define EFUSED_MAC(value) (value & 0xffff0000)
  63. #define rHAVE_SDIO_IRQ_GPIO_BIT (NBIT0)
  64. #define rHAVE_USE_PMU_BIT (NBIT1)
  65. #define rHAVE_SLEEP_CLK_SRC_RTC_BIT (NBIT2)
  66. #define rHAVE_SLEEP_CLK_SRC_XO_BIT (NBIT3)
  67. #define rHAVE_EXT_PA_INV_TX_RX (NBIT4)
  68. #define rHAVE_LEGACY_RF_SETTINGS (NBIT5)
  69. #define rHAVE_LOGS_DISABLED_BIT (NBIT6)
  70. typedef struct{
  71. uint32 u32Mac_efuse_mib;
  72. uint32 u32Firmware_Ota_rev;
  73. }tstrGpRegs;
  74. #ifdef __cplusplus
  75. extern "C" {
  76. #endif
  77. /**
  78. * @fn nm_clkless_wake
  79. * @brief Wakeup the chip using clockless registers
  80. * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure
  81. * @author Samer Sarhan
  82. */
  83. sint8 nm_clkless_wake(void);
  84. sint8 chip_wake(void);
  85. void chip_idle(void);
  86. void enable_rf_blocks(void);
  87. sint8 enable_interrupts(void);
  88. sint8 cpu_start(void);
  89. uint32 nmi_get_chipid(void);
  90. uint32 nmi_get_rfrevid(void);
  91. void restore_pmu_settings_after_global_reset(void);
  92. void nmi_update_pll(void);
  93. void nmi_set_sys_clk_src_to_xo(void);
  94. sint8 chip_reset(void);
  95. sint8 wait_for_bootrom(uint8);
  96. sint8 wait_for_firmware_start(uint8);
  97. sint8 chip_deinit(void);
  98. sint8 chip_reset_and_cpu_halt(void);
  99. sint8 set_gpio_dir(uint8 gpio, uint8 dir);
  100. sint8 set_gpio_val(uint8 gpio, uint8 val);
  101. sint8 get_gpio_val(uint8 gpio, uint8* val);
  102. sint8 pullup_ctrl(uint32 pinmask, uint8 enable);
  103. sint8 nmi_get_otp_mac_address(uint8 *pu8MacAddr, uint8 * pu8IsValid);
  104. sint8 nmi_get_mac_address(uint8 *pu8MacAddr);
  105. sint8 chip_apply_conf(uint32 u32conf);
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109. #endif /*_NMASIC_H_*/