nmasic.c
Go to the documentation of this file.
1 
36 #include "driver/source/nmbus.h"
37 #include "bsp/include/nm_bsp.h"
38 #include "driver/source/nmasic.h"
39 
40 #define NMI_GLB_RESET_0 (NMI_PERIPH_REG_BASE + 0x400)
41 #define NMI_INTR_REG_BASE (NMI_PERIPH_REG_BASE + 0xa00)
42 #define NMI_PIN_MUX_0 (NMI_PERIPH_REG_BASE + 0x408)
43 #define NMI_INTR_ENABLE (NMI_INTR_REG_BASE)
44 #define GET_UINT32(X,Y) (X[0+Y] + ((uint32)X[1+Y]<<8) + ((uint32)X[2+Y]<<16) +((uint32)X[3+Y]<<24))
45 
46 
47 
48 
49 #define TIMEOUT (2000)
50 #define M2M_DISABLE_PS 0xD0UL
51 
52 /* Assume initially we're dealing with D0 - we will try other addresses if this
53  * fails - the addresses are as follows:
54  * 0x13 - for D0
55  * 0x0F - for B0
56  * 0x0E - for A0
57  */
58 static uint32 clk_status_reg_adr = 0x13;
59 
61 {
62  sint8 ret = M2M_SUCCESS;
63  uint32 val32 = u32Conf;
64 
65 #ifdef __ENABLE_PMU__
66  val32 |= rHAVE_USE_PMU_BIT;
67 #endif
68 #ifdef __ENABLE_SLEEP_CLK_SRC_RTC__
70 #elif defined __ENABLE_SLEEP_CLK_SRC_XO__
72 #endif
73 #ifdef __ENABLE_EXT_PA_INV_TX_RX__
74  val32 |= rHAVE_EXT_PA_INV_TX_RX;
75 #endif
76 #ifdef __ENABLE_LEGACY_RF_SETTINGS__
77  val32 |= rHAVE_LEGACY_RF_SETTINGS;
78 #endif
79 #ifdef __DISABLE_FIRMWARE_LOGS__
80  val32 |= rHAVE_LOGS_DISABLED_BIT;
81 #endif
82  do {
84  if(val32 != 0) {
85  uint32 reg = 0;
87  if(ret == M2M_SUCCESS) {
88  if(reg == val32)
89  break;
90  }
91  } else {
92  break;
93  }
94  } while(1);
95 
96  return M2M_SUCCESS;
97 }
107 {
108  sint8 ret = M2M_SUCCESS;
109  uint32 reg, clk_status_reg,trials = 0;
110  uint32 keeptrying = 200;
111  /* wait 1ms, spi data read */
112  nm_bsp_sleep(1);
113  ret = nm_read_reg_with_ret(0x1, &reg);
114  if(ret != M2M_SUCCESS) {
115  M2M_ERR("Bus error (1). Wake up failed\n");
116  return ret;
117  }
118 
119  /*
120  * At this point, I am not sure whether it is B0 or A0
121  * If B0, then clks_enabled bit exists in register 0xf
122  * If A0, then clks_enabled bit exists in register 0xe
123  */
124  do
125  {
126  /* Set bit 1 */
127  nm_write_reg(0x1, reg | (1 << 1));
128 
129  // Search for the correct (clock status) register address
130  do
131  {
132  if (keeptrying) --keeptrying;
133 
134  /* wait 1ms, spi data read */
135  nm_bsp_sleep(1);
136  ret = nm_read_reg_with_ret(clk_status_reg_adr, &clk_status_reg);
137  if (ret != M2M_SUCCESS || (ret == M2M_SUCCESS && clk_status_reg == 0)) {
138  switch (clk_status_reg_adr) {
139  case 0x13: clk_status_reg_adr = 0x0F; break;
140  case 0x0F: clk_status_reg_adr = 0x0E; break;
141  default: clk_status_reg_adr = 0x00; break;
142  }
143  }
144  else
145  break; // we have found the correct register, break out of the search
146  } while (clk_status_reg_adr && keeptrying);
147 
148  if (0 == clk_status_reg_adr) {
149  M2M_ERR("Bus error (2). Wake up failed\n");
150  return ret;
151  }
152 
153  // in case of clocks off, wait 2ms, and check it again.
154  // if still off, wait for another 2ms, for a total wait of 6ms.
155  // If still off, redo the wake up sequence
156  trials = 0;
157  while( ((clk_status_reg & 0x4) == 0) && (((++trials) %3) == 0) && keeptrying)
158  {
159  --keeptrying;
160 
161  /* Wait for the chip to stabilize*/
162  nm_bsp_sleep(2);
163 
164  // Make sure chip is awake. This is an extra step that can be removed
165  // later to avoid the bus access overhead
166  nm_read_reg_with_ret(clk_status_reg_adr, &clk_status_reg);
167 
168  if ((clk_status_reg & 0x4) == 0)
169  {
170  M2M_ERR("clocks still OFF. Wake up failed\n");
171  }
172  }
173  // in case of failure, Reset the wakeup bit to introduce a new edge on the next loop
174  if((clk_status_reg & 0x4) == 0)
175  {
176  // Reset bit 0
177  nm_write_reg(0x1, reg | (1 << 1));
178  }
179  } while((clk_status_reg & 0x4) == 0 && keeptrying);
180 
181  if (!keeptrying)
182  {
183  M2M_ERR("Wake up failed - out of retries\n");
184  ret = M2M_ERR_INIT;
185  }
186 
187  return ret;
188 }
189 void chip_idle(void)
190 {
191  uint32 reg =0;
192  nm_read_reg_with_ret(0x1, &reg);
193  if(reg&0x2)
194  {
195  reg &=~(1 << 1);
196  nm_write_reg(0x1, reg);
197  }
198 }
199 
201 {
202  nm_write_reg(0x6, 0xdb);
203  nm_write_reg(0x7, 0x6);
204  nm_bsp_sleep(10);
205  nm_write_reg(0x1480, 0);
206  nm_write_reg(0x1484, 0);
207  nm_bsp_sleep(10);
208 
209  nm_write_reg(0x6, 0x0);
210  nm_write_reg(0x7, 0x0);
211 }
212 
214 {
215  uint32 reg;
216  sint8 ret;
220  ret = nm_read_reg_with_ret(NMI_PIN_MUX_0, &reg);
221  if (M2M_SUCCESS != ret) {
222  return M2M_ERR_BUS_FAIL;
223  }
224  reg |= ((uint32) 1 << 8);
225  ret = nm_write_reg(NMI_PIN_MUX_0, reg);
226  if (M2M_SUCCESS != ret) {
227  return M2M_ERR_BUS_FAIL;
228  }
233  if (M2M_SUCCESS != ret) {
234  return M2M_ERR_BUS_FAIL;
235  }
236  reg |= ((uint32) 1 << 16);
237  ret = nm_write_reg(NMI_INTR_ENABLE, reg);
238  if (M2M_SUCCESS != ret) {
239  return M2M_ERR_BUS_FAIL;
240  }
241  return M2M_SUCCESS;
242 }
243 
245  uint32 reg;
246  sint8 ret;
247 
254 
258  ret = nm_read_reg_with_ret(0x1118, &reg);
259  if (M2M_SUCCESS != ret) {
260  ret = M2M_ERR_BUS_FAIL;
261  M2M_ERR("[nmi start]: fail read reg 0x1118 ...\n");
262  }
263  reg |= (1 << 0);
264  ret = nm_write_reg(0x1118, reg);
265  ret = nm_write_reg(0x150014, 0x1);
267  if ((reg & (1ul << 10)) == (1ul << 10)) {
268  reg &= ~(1ul << 10);
269  ret += nm_write_reg(NMI_GLB_RESET_0, reg);
270  }
271 
272  reg |= (1ul << 10);
273  ret += nm_write_reg(NMI_GLB_RESET_0, reg);
274  nm_bsp_sleep(1); /* TODO: Why bus error if this delay is not here. */
275  return ret;
276 }
277 
279 {
280  static uint32 chipid = 0;
281 
282  if (chipid == 0) {
283  uint32 rfrevid;
284 
285  if((nm_read_reg_with_ret(0x1000, &chipid)) != M2M_SUCCESS) {
286  chipid = 0;
287  return 0;
288  }
289  if((nm_read_reg_with_ret(0x13f4, &rfrevid)) != M2M_SUCCESS) {
290  chipid = 0;
291  return 0;
292  }
293 
294  if(chipid == 0x1002a0) {
295  if (rfrevid == 0x1) { /* 1002A0 */
296  } else /* if (rfrevid == 0x2) */ { /* 1002A1 */
297  chipid = 0x1002a1;
298  }
299  } else if(chipid == 0x1002b0) {
300  if(rfrevid == 3) { /* 1002B0 */
301  } else if(rfrevid == 4) { /* 1002B1 */
302  chipid = 0x1002b1;
303  } else /* if(rfrevid == 5) */ { /* 1002B2 */
304  chipid = 0x1002b2;
305  }
306  } else if(chipid == 0x1000f0) {
307  /* For 3400, the WiFi chip ID register reads 0x1000f0.
308  * Therefore using BT chip ID register here which should read 0x3000D0
309  */
310 #define rBT_CHIP_ID_REG (0x3b0000)
312  chipid = 0;
313  return 0;
314  }
315  if(chipid == 0x3000d0) {
316  if(rfrevid == 6) {
317  chipid = 0x3000d1;
318  }
319  else if(rfrevid == 2) {
320  chipid = 0x3000d2;
321  }
322  }
323  }
324 //#define PROBE_FLASH
325 #ifdef PROBE_FLASH
326  if(chipid) {
327  UWORD32 flashid;
328 
329  flashid = probe_spi_flash();
330  if((chipid & 0xf00000) == 0x300000) {
331  if(flashid == 0x1440ef) {
332  chipid &= ~(0x0f0000);
333  chipid |= 0x040000;
334  }
335  } else {
336  if(flashid == 0x1230ef) {
337  chipid &= ~(0x0f0000);
338  chipid |= 0x050000;
339  }
340  if(flashid == 0xc21320c2) {
341  chipid &= ~(0x0f0000);
342  chipid |= 0x050000;
343  }
344  }
345  }
346 #else
347  /*M2M is by default have SPI flash*/
348  if((chipid & 0xf00000) == 0x300000) {
349  chipid &= ~(0x0f0000);
350  chipid |= 0x040000;
351  } else {
352  chipid &= ~(0x0f0000);
353  chipid |= 0x050000;
354  }
355 #endif /* PROBE_FLASH */
356  }
357  return chipid;
358 }
359 
361 {
362  uint32 rfrevid;
363  if((nm_read_reg_with_ret(0x13f4, &rfrevid)) != M2M_SUCCESS) {
364  rfrevid = 0;
365  return 0;
366  }
367  return rfrevid;
368 }
369 
371 {
372  /*
373  * Must restore PMU register value after
374  * global reset if PMU toggle is done at
375  * least once since the last hard reset.
376  */
377  if(REV(nmi_get_chipid()) >= REV_2B0) {
378  nm_write_reg(0x1e48, 0xb78469ce);
379  }
380 }
381 
382 void nmi_update_pll(void)
383 {
384  uint32 pll;
385 
386  pll = nm_read_reg(0x1428);
387  pll &= ~0x1ul;
388  nm_write_reg(0x1428, pll);
389  pll |= 0x1ul;
390  nm_write_reg(0x1428, pll);
391 
392 }
394 {
395  uint32 val32;
396 
397  /* Switch system clock source to XO. This will take effect after nmi_update_pll(). */
398  val32 = nm_read_reg(0x141c);
399  val32 |= (1 << 2);
400  nm_write_reg(0x141c, val32);
401 
402  /* Do PLL update */
403  nmi_update_pll();
404 }
406 {
407  sint8 ret = M2M_SUCCESS;
408 
409  ret = nm_clkless_wake();
410  if(ret != M2M_SUCCESS) return ret;
411 
412 // enable_rf_blocks(); MERGEBUG: TEMPORARILY DISABLING
413 
414  return ret;
415 }
417 {
418  sint8 ret = M2M_SUCCESS;
419  uint32 reg = 0;
420 
421  ret = chip_wake();
422  if(ret != M2M_SUCCESS) {
423  return ret;
424  }
425  chip_reset();
426  ret = nm_read_reg_with_ret(0x1118, &reg);
427  if (M2M_SUCCESS != ret) {
428  ret = M2M_ERR_BUS_FAIL;
429  M2M_ERR("[nmi start]: fail read reg 0x1118 ...\n");
430  }
431  reg |= (1 << 0);
432  ret = nm_write_reg(0x1118, reg);
434  if ((reg & (1ul << 10)) == (1ul << 10)) {
435  reg &= ~(1ul << 10);
436  ret += nm_write_reg(NMI_GLB_RESET_0, reg);
438  }
439 #if 0
440  reg |= (1ul << 10);
441  ret += nm_write_reg(NMI_GLB_RESET_0, reg);
443 #endif
447  nm_write_reg(NMI_PIN_MUX_0, 0x11111000);
448  return ret;
449 }
451 {
452  sint8 ret = M2M_SUCCESS;
453 
454 #if 0
455  // MERGEBUG: TODO: This causes serial trace from the chip to be garbled - investigate
456 #ifndef CONF_WINC_USE_UART
458 #endif
459 #endif
460 
461  ret += nm_write_reg(NMI_GLB_RESET_0, 0);
462  nm_bsp_sleep(50);
463 #ifndef CONF_WINC_USE_UART
465 #endif
466  return ret;
467 }
468 
470 {
471  sint8 ret = M2M_SUCCESS;
472  uint32 reg = 0, cnt = 0;
473 
474  reg = 0;
475  while(1) {
476  reg = nm_read_reg(0x1014); /* wait for efuse loading done */
477  if (reg & 0x80000000) {
478  break;
479  }
480  nm_bsp_sleep(1); /* TODO: Why bus error if this delay is not here. */
481  }
483  reg &= 0x1;
484 
485  /* check if waiting for the host will be skipped or not */
486  if(reg == 0)
487  {
488  reg = 0;
489  while(reg != M2M_FINISH_BOOT_ROM)
490  {
491  nm_bsp_sleep(1);
492  reg = nm_read_reg(BOOTROM_REG);
493 
494  if(++cnt > TIMEOUT)
495  {
496  M2M_DBG("failed to load firmware from flash.\n");
497  ret = M2M_ERR_INIT;
498  goto ERR2;
499  }
500  }
501  }
502 
503  if(2 == arg) {
505  } else {
506  /*bypass this step*/
507  }
508 
509  if(REV(nmi_get_chipid()) == REV_3A0)
510  {
512  }
513  else
514  {
515  chip_apply_conf(0);
516  }
517 
519 
520 #ifdef __ROM_TEST__
521  rom_test();
522 #endif /* __ROM_TEST__ */
523 
524 ERR2:
525  return ret;
526 }
527 
529 {
530  sint8 ret = M2M_SUCCESS;
531  uint32 reg = 0, cnt = 0;
532  volatile uint32 regAddress = NMI_STATE_REG;
533  volatile uint32 checkValue = M2M_FINISH_INIT_STATE;
534 
535  if(2 == arg) {
536  regAddress = NMI_REV_REG;
537  checkValue = M2M_ATE_FW_IS_UP_VALUE;
538  } else {
539  /*bypass this step*/
540  }
541 
542  while (checkValue != reg)
543  {
544  nm_bsp_sleep(2); /* TODO: Why bus error if this delay is not here. */
545  M2M_DBG("%x %x %x\n",(unsigned int)nm_read_reg(0x108c),(unsigned int)nm_read_reg(0x108c),(unsigned int)nm_read_reg(0x14A0));
546  if (nm_read_reg_with_ret(regAddress, &reg) != M2M_SUCCESS)
547  {
548  // ensure reg != checkValue
549  reg = !checkValue;
550  }
551  if(++cnt > TIMEOUT)
552  {
553  M2M_DBG("Time out for wait firmware Run\n");
554  ret = M2M_ERR_INIT;
555  goto ERR;
556  }
557  }
558  if(M2M_FINISH_INIT_STATE == checkValue)
559  {
561  }
562 ERR:
563  return ret;
564 }
565 
567 {
568  uint32 reg = 0;
569  sint8 ret;
570  uint8 timeout = 10;
571 
576  if (ret != M2M_SUCCESS) {
577  M2M_ERR("failed to de-initialize\n");
578  }
579  reg &= ~(1 << 10);
580  ret = nm_write_reg(NMI_GLB_RESET_0, reg);
581 
582  if (ret != M2M_SUCCESS) {
583  M2M_ERR("Error while writing reg\n");
584  return ret;
585  }
586 
587  do {
589  if (ret != M2M_SUCCESS) {
590  M2M_ERR("Error while reading reg\n");
591  return ret;
592  }
593  /*Workaround to ensure that the chip is actually reset*/
594  if ((reg & (1 << 10))) {
595  M2M_DBG("Bit 10 not reset retry %d\n", timeout);
596  reg &= ~(1 << 10);
597  ret = nm_write_reg(NMI_GLB_RESET_0, reg);
598  timeout--;
599  } else {
600  break;
601  }
602 
603  } while (timeout);
604 
605  return ret;
606 }
607 
608 #ifdef CONF_PERIPH
609 
610 sint8 set_gpio_dir(uint8 gpio, uint8 dir)
611 {
612  uint32 val32;
613  sint8 ret;
614 
615  ret = nm_read_reg_with_ret(0x20108, &val32);
616  if(ret != M2M_SUCCESS) goto _EXIT;
617 
618  if(dir) {
619  val32 |= (1ul << gpio);
620  } else {
621  val32 &= ~(1ul << gpio);
622  }
623 
624  ret = nm_write_reg(0x20108, val32);
625 
626 _EXIT:
627  return ret;
628 }
629 sint8 set_gpio_val(uint8 gpio, uint8 val)
630 {
631  uint32 val32;
632  sint8 ret;
633 
634  ret = nm_read_reg_with_ret(0x20100, &val32);
635  if(ret != M2M_SUCCESS) goto _EXIT;
636 
637  if(val) {
638  val32 |= (1ul << gpio);
639  } else {
640  val32 &= ~(1ul << gpio);
641  }
642 
643  ret = nm_write_reg(0x20100, val32);
644 
645 _EXIT:
646  return ret;
647 }
648 
649 sint8 get_gpio_val(uint8 gpio, uint8* val)
650 {
651  uint32 val32;
652  sint8 ret;
653 
654  ret = nm_read_reg_with_ret(0x20104, &val32);
655  if(ret != M2M_SUCCESS) goto _EXIT;
656 
657  *val = (uint8)((val32 >> gpio) & 0x01);
658 
659 _EXIT:
660  return ret;
661 }
662 
663 sint8 pullup_ctrl(uint32 pinmask, uint8 enable)
664 {
665  sint8 s8Ret;
666  uint32 val32;
667  s8Ret = nm_read_reg_with_ret(0x142c, &val32);
668  if(s8Ret != M2M_SUCCESS) {
669  M2M_ERR("[pullup_ctrl]: failed to read\n");
670  goto _EXIT;
671  }
672  if(enable) {
673  val32 &= ~pinmask;
674  } else {
675  val32 |= pinmask;
676  }
677  s8Ret = nm_write_reg(0x142c, val32);
678  if(s8Ret != M2M_SUCCESS) {
679  M2M_ERR("[pullup_ctrl]: failed to write\n");
680  goto _EXIT;
681  }
682 _EXIT:
683  return s8Ret;
684 }
685 #endif /* CONF_PERIPH */
686 
687 sint8 nmi_get_otp_mac_address(uint8 *pu8MacAddr, uint8 * pu8IsValid)
688 {
689  sint8 ret;
690  uint32 u32RegValue;
691  uint8 mac[6];
692  tstrGpRegs strgp = {0};
693 
694  ret = nm_read_reg_with_ret(rNMI_GP_REG_0, &u32RegValue);
695  if(ret != M2M_SUCCESS) goto _EXIT_ERR;
696 
697  ret = nm_read_block(u32RegValue|0x30000,(uint8*)&strgp,sizeof(tstrGpRegs));
698  if(ret != M2M_SUCCESS) goto _EXIT_ERR;
699  u32RegValue = strgp.u32Mac_efuse_mib;
700 
701  if(!EFUSED_MAC(u32RegValue)) {
702  M2M_DBG("Default MAC\n");
703  m2m_memset(pu8MacAddr, 0, 6);
704  goto _EXIT_ERR;
705  }
706 
707  M2M_DBG("OTP MAC\n");
708  u32RegValue >>=16;
709  ret = nm_read_block(u32RegValue|0x30000, mac, 6);
710  m2m_memcpy(pu8MacAddr,mac,6);
711  if(pu8IsValid) *pu8IsValid = 1;
712  return ret;
713 
714 _EXIT_ERR:
715  if(pu8IsValid) *pu8IsValid = 0;
716  return ret;
717 }
718 
720 {
721  sint8 ret;
722  uint32 u32RegValue;
723  uint8 mac[6];
724  tstrGpRegs strgp = {0};
725 
726  ret = nm_read_reg_with_ret(rNMI_GP_REG_0, &u32RegValue);
727  if(ret != M2M_SUCCESS) goto _EXIT_ERR;
728 
729  ret = nm_read_block(u32RegValue|0x30000,(uint8*)&strgp,sizeof(tstrGpRegs));
730  if(ret != M2M_SUCCESS) goto _EXIT_ERR;
731  u32RegValue = strgp.u32Mac_efuse_mib;
732 
733  u32RegValue &=0x0000ffff;
734  ret = nm_read_block(u32RegValue|0x30000, mac, 6);
735  m2m_memcpy(pu8MacAddr, mac, 6);
736 
737  return ret;
738 
739 _EXIT_ERR:
740  return ret;
741 }
sint8 enable_interrupts(void)
Definition: nmasic.c:213
NMI_API void m2m_memcpy(uint8 *pDst, uint8 *pSrc, uint32 sz)
Copy specified number of bytes from source buffer to destination buffer.
Definition: nm_common.c:36
#define M2M_ATE_FW_IS_UP_VALUE
Definition: nmasic.h:55
#define M2M_WAIT_FOR_HOST_REG
Definition: nmasic.h:48
#define rHAVE_EXT_PA_INV_TX_RX
Definition: nmasic.h:73
sint8 nm_read_block(uint32 u32Addr, uint8 *puBuf, uint32 u32Sz)
Definition: nmbus.c:195
This module contains common APIs declarations.
#define rBT_CHIP_ID_REG
sint8 get_gpio_val(uint8 gpio, uint8 *val)
#define NMI_STATE_REG
Definition: nmasic.h:45
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:111
sint8 nmi_get_otp_mac_address(uint8 *pu8MacAddr, uint8 *pu8IsValid)
Definition: nmasic.c:687
sint8 nm_read_reg_with_ret(uint32 u32Addr, uint32 *pu32RetVal)
Definition: nmbus.c:130
#define rHAVE_USE_PMU_BIT
Definition: nmasic.h:70
#define rHAVE_SLEEP_CLK_SRC_RTC_BIT
Definition: nmasic.h:71
#define EFUSED_MAC(value)
Definition: nmasic.h:67
#define NMI_INTR_ENABLE
Definition: nmasic.c:43
sint8 chip_wake(void)
Definition: nmasic.c:405
#define NMI_GLB_RESET_0
Definition: nmasic.c:40
#define M2M_SUCCESS
Definition: nm_common.h:51
#define M2M_ERR_INIT
Definition: nm_common.h:56
#define M2M_ATE_FW_START_VALUE
Definition: nmasic.h:54
#define M2M_FINISH_BOOT_ROM
Definition: nmasic.h:50
uint32 nmi_get_rfrevid(void)
Definition: nmasic.c:360
#define rNMI_GP_REG_1
Definition: nmasic.h:42
static uint32 clk_status_reg_adr
Definition: nmasic.c:58
#define TIMEOUT
Definition: nmasic.c:49
#define BOOTROM_REG
Definition: nmasic.h:46
sint8 chip_reset_and_cpu_halt(void)
Definition: nmasic.c:416
#define REV_3A0
Definition: nmasic.h:59
#define rHAVE_LEGACY_RF_SETTINGS
Definition: nmasic.h:74
#define M2M_DBG(...)
Definition: nm_debug.h:81
sint8 wait_for_bootrom(uint8 arg)
Definition: nmasic.c:469
This module contains WINC3400 ASIC specific internal APIs.
#define NMI_PIN_MUX_0
Definition: nmasic.c:42
void nm_bsp_sleep(uint32 u32TimeMsec)
NMI_API void m2m_memset(uint8 *pBuf, uint8 val, uint32 sz)
Set specified number of data bytes in specified data buffer to specified value.
Definition: nm_common.c:58
sint8 chip_reset(void)
Definition: nmasic.c:450
sint8 nm_write_reg(uint32 u32Addr, uint32 u32Val)
Definition: nmbus.c:155
#define M2M_ERR(...)
Definition: nm_debug.h:80
#define M2M_FINISH_INIT_STATE
Definition: nmasic.h:49
void chip_idle(void)
Definition: nmasic.c:189
#define M2M_START_FIRMWARE
Definition: nmasic.h:51
sint8 set_gpio_val(uint8 gpio, uint8 val)
sint8 wait_for_firmware_start(uint8 arg)
Definition: nmasic.c:528
void nmi_update_pll(void)
Definition: nmasic.c:382
sint8 chip_apply_conf(uint32 u32Conf)
Definition: nmasic.c:60
uint32 nmi_get_chipid(void)
Definition: nmasic.c:278
This module contains WINC3400 bus APIs implementation.
void restore_pmu_settings_after_global_reset(void)
Definition: nmasic.c:370
sint8 set_gpio_dir(uint8 gpio, uint8 dir)
#define rHAVE_LOGS_DISABLED_BIT
Definition: nmasic.h:75
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:103
sint8 pullup_ctrl(uint32 pinmask, uint8 enable)
This module contains WINC3400 BSP APIs declarations.
sint8 nmi_get_mac_address(uint8 *pu8MacAddr)
Definition: nmasic.c:719
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:89
#define REV_2B0
Definition: nmasic.h:57
#define REV(id)
Definition: nmasic.h:66
void enable_rf_blocks(void)
Definition: nmasic.c:200
#define NMI_REV_REG
Definition: nmasic.h:47
sint8 cpu_start(void)
Definition: nmasic.c:244
void nmi_set_sys_clk_src_to_xo(void)
Definition: nmasic.c:393
sint8 nm_clkless_wake(void)
Wakeup the chip using clockless registers.
Definition: nmasic.c:106
uint32 nm_read_reg(uint32 u32Addr)
Definition: nmbus.c:104
#define M2M_ERR_BUS_FAIL
Definition: nm_common.h:57
sint8 chip_deinit(void)
Definition: nmasic.c:566
#define rHAVE_SLEEP_CLK_SRC_XO_BIT
Definition: nmasic.h:72
#define rNMI_GP_REG_0
Definition: nmasic.h:41


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:58