Lines Matching refs:MSC
82 #define ECC_CTRL_REG (MSC->ECCCTRL)
88 #define ECC_IFC_REG (MSC->IFC)
92 #define ECC_FAULT_CTRL_REG (MSC->CTRL)
109 #define ECC_CTRL_REG (MSC->ECCCTRL)
117 #define ECC_IFC_REG (MSC->IFC)
122 #define ECC_FAULT_CTRL_REG (MSC->CTRL)
214 #define MSC_IS_LOCKED() ((MSC->STATUS & _MSC_STATUS_REGLOCK_MASK) != 0U)
216 #define MSC_IS_LOCKED() ((MSC->LOCK & _MSC_LOCK_MASK) != 0U)
316 uint32_t status = MSC->STATUS; in mscStatusWait()
382 MSC->ADDRB = address; in writeBurst()
384 if (MSC->STATUS & MSC_STATUS_INVADDR) { in writeBurst()
388 MSC->WDATA = *data++; in writeBurst()
395 MSC->WRITECMD = MSC_WRITECMD_WRITEEND; in writeBurst()
399 MSC->WDATA = *data++; in writeBurst()
403 MSC->WRITECMD = MSC_WRITECMD_WRITEEND; in writeBurst()
428 MSC->LOCK = MSC_LOCK_LOCKKEY_UNLOCK; in MSC_Init()
430 MSC->WRITECTRL_CLR = MSC_WRITECTRL_WREN; in MSC_Init()
440 MSC->LOCK = MSC_LOCK_LOCKKEY_UNLOCK; in MSC_Deinit()
442 MSC->WRITECTRL_CLR = MSC_WRITECTRL_WREN; in MSC_Deinit()
444 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_Deinit()
462 mscReadCtrl = MSC->RDATACTRL & ~MSC_RDATACTRL_DOUTBUFEN; in MSC_ExecConfigSet()
468 MSC->RDATACTRL = mscReadCtrl; in MSC_ExecConfigSet()
470 mscReadCtrl = MSC->READCTRL & ~MSC_READCTRL_DOUTBUFEN; in MSC_ExecConfigSet()
475 MSC->READCTRL = mscReadCtrl; in MSC_ExecConfigSet()
514 MSC->LOCK = MSC_LOCK_LOCKKEY_UNLOCK; in MSC_ErasePage()
516 MSC->WRITECTRL_SET = MSC_WRITECTRL_WREN; in MSC_ErasePage()
517 MSC->ADDRB = (uint32_t)startAddress; in MSC_ErasePage()
518 MSC->WRITECMD = MSC_WRITECMD_ERASEPAGE; in MSC_ErasePage()
527 MSC->WRITECTRL_CLR = MSC_WRITECTRL_WREN; in MSC_ErasePage()
530 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_ErasePage()
592 MSC->LOCK = MSC_LOCK_LOCKKEY_UNLOCK; in MSC_WriteWord()
595 MSC->WRITECTRL_SET = MSC_WRITECTRL_WREN; in MSC_WriteWord()
616 MSC->WRITECTRL_CLR = MSC_WRITECTRL_WREN; in MSC_WriteWord()
619 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_WriteWord()
635 MSC->WRITECTRL_SET = MSC_WRITECTRL_WREN; // Set write enable bit in MSC_MassErase()
636 MSC->MISCLOCKWORD_CLR = MSC_MISCLOCKWORD_MELOCKBIT; // Enable Write ctrl access in MSC_MassErase()
637 MSC->WRITECMD = MSC_WRITECMD_ERASEMAIN0; // Start Mass erase procedure in MSC_MassErase()
639 MSC->MISCLOCKWORD_SET = MSC_MISCLOCKWORD_MELOCKBIT; // Reenable mass erase lock bit in MSC_MassErase()
640 MSC->WRITECTRL_CLR = MSC_WRITECTRL_WREN; // Disable Write ctrl access in MSC_MassErase()
705 MSC->LOCK = MSC_LOCK_LOCKKEY_UNLOCK; in MSC_WriteWordDma()
707 MSC->WRITECTRL |= MSC_WRITECTRL_WREN; in MSC_WriteWordDma()
716 MSC->ADDRB = dst; in MSC_WriteWordDma()
719 if (MSC->STATUS & MSC_STATUS_INVADDR) { in MSC_WriteWordDma()
727 LDMA->CH[ch].DST = (uint32_t)&MSC->WDATA; in MSC_WriteWordDma()
738 MSC->WRITECMD = MSC_WRITECMD_WRITEEND; in MSC_WriteWordDma()
746 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_WriteWordDma()
748 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_WriteWordDma()
776 MSC->LOCK = MSC_UNLOCK_CODE; in MSC_Init()
778 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_Init()
792 MSC->TIMEBASE = (MSC->TIMEBASE & ~(_MSC_TIMEBASE_BASE_MASK in MSC_Init()
802 MSC->TIMEBASE = (MSC->TIMEBASE & ~(_MSC_TIMEBASE_BASE_MASK in MSC_Init()
817 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_Deinit()
819 MSC->LOCK = 0; in MSC_Deinit()
834 mscReadCtrl = MSC->READCTRL & _MSC_READCTRL_MODE_MASK; in MSC_ExecConfigSet()
848 mscReadCtrl = MSC->READCTRL & ~(0 in MSC_ExecConfigSet()
889 MSC->READCTRL = mscReadCtrl; in MSC_ExecConfigSet()
918 while ((MSC->STATUS & MSC_STATUS_BUSY) && (timeOut != 0)) { in MSC_LoadVerifyAddress()
927 MSC->ADDRB = (uint32_t)address; in MSC_LoadVerifyAddress()
928 MSC->WRITECMD = MSC_WRITECMD_LADDRIM; in MSC_LoadVerifyAddress()
931 if (MSC->STATUS & MSC_STATUS_INVADDR) { in MSC_LoadVerifyAddress()
967 if (!(MSC->WRITECTRL & MSC_WRITECTRL_LPWRITE)) { in MSC_LoadWriteData()
973 while ((!(MSC->STATUS & MSC_STATUS_WDATAREADY)) && (timeOut != 0)) { in MSC_LoadWriteData()
982 MSC->WRITECTRL &= ~MSC_WRITECTRL_WDOUBLE; in MSC_LoadWriteData()
984 MSC->WDATA = *data++; in MSC_LoadWriteData()
985 MSC->WRITECMD = MSC_WRITECMD_WRITEONCE; in MSC_LoadWriteData()
990 while ((MSC->STATUS & MSC_STATUS_BUSY) && (timeOut != 0)) { in MSC_LoadWriteData()
998 if (MSC->STATUS & MSC_STATUS_LOCKED) { in MSC_LoadWriteData()
1007 MSC->WRITECTRL |= MSC_WRITECTRL_WDOUBLE; in MSC_LoadWriteData()
1019 MSC->WDATA = *data++; in MSC_LoadWriteData()
1021 MSC->WRITECMD = MSC_WRITECMD_WRITEONCE; in MSC_LoadWriteData()
1025 MSC->WDATA = *data++; in MSC_LoadWriteData()
1026 while (!(MSC->STATUS & MSC_STATUS_WDATAREADY)) ; in MSC_LoadWriteData()
1027 MSC->WDATA = *data++; in MSC_LoadWriteData()
1029 MSC->WRITECMD = MSC_WRITECMD_WRITEONCE; in MSC_LoadWriteData()
1035 while ((MSC->STATUS & MSC_STATUS_BUSY) && (timeOut != 0)) { in MSC_LoadWriteData()
1044 if (MSC->STATUS & MSC_STATUS_LOCKED) { in MSC_LoadWriteData()
1049 MSC->ADDRB += 4; in MSC_LoadWriteData()
1050 MSC->WRITECMD = MSC_WRITECMD_LADDRIM; in MSC_LoadWriteData()
1057 MSC->WRITECTRL &= ~MSC_WRITECTRL_WDOUBLE; in MSC_LoadWriteData()
1089 MSC->LOCK = MSC_LOCK_LOCKKEY_UNLOCK; in MSC_WriteWordI()
1104 MSC->WRITECTRL |= MSC_WRITECTRL_WREN; in MSC_WriteWordI()
1119 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_WriteWordI()
1121 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_WriteWordI()
1159 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_WriteWordI()
1164 MSC->WRITECTRL &= ~MSC_WRITECTRL_WDOUBLE; in MSC_WriteWordI()
1168 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_WriteWordI()
1207 MSC->LOCK = MSC_LOCK_LOCKKEY_UNLOCK; in MSC_ErasePage()
1218 MSC->WRITECTRL |= MSC_WRITECTRL_WREN; in MSC_ErasePage()
1221 MSC->ADDRB = (uint32_t)startAddress; in MSC_ErasePage()
1222 MSC->WRITECMD = MSC_WRITECMD_LADDRIM; in MSC_ErasePage()
1225 if (MSC->STATUS & MSC_STATUS_INVADDR) { in MSC_ErasePage()
1227 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_ErasePage()
1229 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_ErasePage()
1235 MSC->WRITECMD = MSC_WRITECMD_ERASEPAGE; in MSC_ErasePage()
1238 while ((MSC->STATUS & MSC_STATUS_BUSY) && (timeOut != 0)) { in MSC_ErasePage()
1242 if (MSC->STATUS & MSC_STATUS_LOCKED) { in MSC_ErasePage()
1244 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_ErasePage()
1246 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_ErasePage()
1252 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_ErasePage()
1254 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_ErasePage()
1259 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_ErasePage()
1261 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_ErasePage()
1420 MSC->LOCK = MSC_LOCK_LOCKKEY_UNLOCK; in MSC_WriteWordDma()
1422 MSC->WRITECTRL |= MSC_WRITECTRL_WREN; in MSC_WriteWordDma()
1431 MSC->ADDRB = dst; in MSC_WriteWordDma()
1432 MSC->WRITECMD = MSC_WRITECMD_LADDRIM; in MSC_WriteWordDma()
1435 if (MSC->STATUS & MSC_STATUS_INVADDR) { in MSC_WriteWordDma()
1443 LDMA->CH[ch].DST = (uint32_t)&MSC->WDATA; in MSC_WriteWordDma()
1447 MSC->WRITECMD = MSC_WRITECMD_WRITETRIG; in MSC_WriteWordDma()
1460 MSC->WRITECMD = MSC_WRITECMD_WRITEEND; in MSC_WriteWordDma()
1463 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_WriteWordDma()
1465 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_WriteWordDma()
1478 MSC->LOCK = MSC_LOCK_LOCKKEY_UNLOCK; in MSC_MassErase()
1481 MSC->WRITECTRL |= MSC_WRITECTRL_WREN; in MSC_MassErase()
1484 MSC->MASSLOCK = MSC_MASSLOCK_LOCKKEY_UNLOCK; in MSC_MassErase()
1487 MSC->WRITECMD = MSC_WRITECMD_ERASEMAIN0; in MSC_MassErase()
1490 while ((MSC->STATUS & MSC_STATUS_BUSY) != 0U) { in MSC_MassErase()
1495 MSC->WRITECMD = MSC_WRITECMD_ERASEMAIN1; in MSC_MassErase()
1498 while ((MSC->STATUS & MSC_STATUS_BUSY) != 0U) { in MSC_MassErase()
1503 MSC->MASSLOCK = MSC_MASSLOCK_LOCKKEY_LOCK; in MSC_MassErase()
1506 MSC->WRITECTRL &= ~MSC_WRITECTRL_WREN; in MSC_MassErase()
1509 MSC->LOCK = MSC_LOCK_LOCKKEY_LOCK; in MSC_MassErase()