Changeset 0af682c in rtems
- Timestamp:
- Nov 9, 2020, 8:16:51 AM (2 months ago)
- Branches:
- 5
- Children:
- 1dbdf94e
- Parents:
- f84c4a5
- git-author:
- Christian Mauderer <christian.mauderer@…> (11/09/20 08:16:51)
- git-committer:
- Christian Mauderer <christian.mauderer@…> (11/12/20 07:31:41)
- Location:
- bsps/arm/atsam
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
bsps/arm/atsam/contrib/libraries/libchip/source/xdmad.c
rf84c4a5 r0af682c 133 133 } 134 134 135 /* 136 * Update the internal xdmad state. Returns true if further processing in the 137 * callback is recommended. 138 * 139 * In an earlier version of the API this has been done by the interrupt handler 140 * directly. But in some cases the application might want to process some of the 141 * other interrupts too. Therefore the user callback should now decide itself 142 * whether this is necessary or not. 143 */ 144 bool XDMAD_UpdateStatusFromCallback(sXdmad *pXdmad, 145 uint32_t Channel, 146 uint32_t status) 147 { 148 Xdmac *pXdmac; 149 uint32_t xdmaGlobalChStatus; 150 bool bExec; 151 152 bExec = false; 153 pXdmac = pXdmad->pXdmacs; 154 xdmaGlobalChStatus = XDMAC_GetGlobalChStatus(pXdmac); 155 156 if ((xdmaGlobalChStatus & (XDMAC_GS_ST0 << Channel)) == 0) { 157 uint32_t xdmaChannelIntMask; 158 sXdmadChannel *pCh; 159 160 pCh = &pXdmad->XdmaChannels[Channel]; 161 162 xdmaChannelIntMask = XDMAC_GetChannelItMask(pXdmac, Channel); 163 status &= xdmaChannelIntMask; 164 165 if (status & XDMAC_CIS_BIS) { 166 if ((xdmaChannelIntMask & XDMAC_CIM_LIM) == 0) { 167 pCh->state = XDMAD_STATE_DONE; 168 bExec = true; 169 } 170 } 171 172 if (status & XDMAC_CIS_LIS) { 173 pCh->state = XDMAD_STATE_DONE; 174 bExec = true; 175 } 176 177 if (status & XDMAC_CIS_DIS) { 178 pCh->state = XDMAD_STATE_DONE; 179 bExec = true; 180 } 181 } else { 182 /* Block end interrupt for LLI dma mode */ 183 if (XDMAC_GetChannelIsr(pXdmac, Channel) & XDMAC_CIS_BIS) { 184 bExec = true; 185 } 186 } 187 188 return bExec; 189 } 190 135 191 void XDMAD_DoNothingCallback(uint32_t Channel, void *pArg, uint32_t status) 136 192 { 137 /* Do nothing */ 193 /* Do nothing except status update */ 194 XDMAD_UpdateStatusFromCallback((sXdmad *)pArg, Channel, status); 138 195 } 139 196 … … 158 215 for (j = 0; j < pXdmad->numChannels; j ++) { 159 216 pXdmad->XdmaChannels[j].fCallback = XDMAD_DoNothingCallback; 217 pXdmad->XdmaChannels[j].pArg = (void *)pXdmad; 160 218 } 161 219 -
bsps/arm/atsam/include/libchip/include/xdmad.h
rf84c4a5 r0af682c 242 242 extern void XDMAD_DoNothingCallback(uint32_t Channel, void *pArg, uint32_t status); 243 243 244 extern bool XDMAD_UpdateStatusFromCallback(sXdmad *pXdmad, 245 uint32_t Channel, 246 uint32_t status); 247 244 248 extern eXdmadRC XDMAD_SetCallback(sXdmad *pXdmad, 245 249 uint32_t dwChannel,
Note: See TracChangeset
for help on using the changeset viewer.