Changeset fd12159 in rtems


Ignore:
Timestamp:
Dec 15, 2016, 5:12:46 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
cb59276
Parents:
8dd83d3
git-author:
Sebastian Huber <sebastian.huber@…> (12/15/16 05:12:46)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/15/16 10:05:05)
Message:

bsp/atsam: Use inline functions for XDMA access

Location:
c/src/lib/libbsp/arm/atsam
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/atsam/Makefile.am

    r8dd83d3 rfd12159  
    381381libbsp_a_SOURCES += libraries/libchip/source/usart_dma.c
    382382libbsp_a_SOURCES += libraries/libchip/source/wdt.c
    383 libbsp_a_SOURCES += libraries/libchip/source/xdmac.c
    384383libbsp_a_SOURCES += libraries/libchip/source/xdmad.c
    385384libbsp_a_SOURCES += libraries/libchip/source/xdma_hardware_interface.c
  • c/src/lib/libbsp/arm/atsam/libraries/libchip/include/xdmac.h

    r8dd83d3 rfd12159  
    7979#endif /* __rtems__ */
    8080#include <stdint.h>
     81#include <assert.h>
    8182
    8283/*------------------------------------------------------------------------------
     
    123124#endif
    124125
    125 static inline void XDMAC_StartTransfer(Xdmac *pXdmac, uint8_t iChannel)
    126 {
    127         pXdmac->XDMAC_GE = (XDMAC_GE_EN0 << iChannel);
    128         pXdmac->XDMAC_GIE = (XDMAC_GIE_IE0 << iChannel);
    129 }
    130 
    131 extern uint32_t XDMAC_GetType(Xdmac *pXdmac);
    132 extern uint32_t XDMAC_GetConfig(Xdmac *pXdmac);
    133 extern uint32_t XDMAC_GetArbiter(Xdmac *pXdmac);
    134 extern void XDMAC_EnableGIt (Xdmac *pXdmac, uint8_t dwInteruptMask);
    135 extern void XDMAC_DisableGIt (Xdmac *pXdmac, uint8_t dwInteruptMask);
    136 extern uint32_t XDMAC_GetGItMask(Xdmac *pXdmac);
    137 extern uint32_t XDMAC_GetGIsr(Xdmac *pXdmac);
    138 extern uint32_t XDMAC_GetMaskedGIsr(Xdmac *pXdmac);
    139 extern void XDMAC_EnableChannel(Xdmac *pXdmac, uint8_t channel);
    140 extern void XDMAC_EnableChannels(Xdmac *pXdmac, uint32_t bmChannels);
    141 extern void XDMAC_DisableChannel(Xdmac *pXdmac, uint8_t channel);
    142 extern void XDMAC_DisableChannels(Xdmac *pXdmac, uint32_t bmChannels);
    143 extern uint32_t XDMAC_GetGlobalChStatus(Xdmac *pXdmac);
    144 extern void XDMAC_SuspendReadChannel(Xdmac *pXdmac, uint8_t channel);
    145 extern void XDMAC_SuspendWriteChannel(Xdmac *pXdmac, uint8_t channel);
    146 extern void XDMAC_SuspendReadWriteChannel(Xdmac *pXdmac, uint8_t channel);
    147 extern void XDMAC_ResumeReadWriteChannel(Xdmac *pXdmac, uint8_t channel);
    148 extern void XDMAC_SoftwareTransferReq(Xdmac *pXdmac, uint8_t channel);
    149 extern uint32_t XDMAC_GetSoftwareTransferStatus(Xdmac *pXdmac);
    150 extern void XDMAC_SoftwareFlushReq(Xdmac *pXdmac, uint8_t channel);
    151 extern void XDMAC_EnableChannelIt (Xdmac *pXdmac, uint8_t channel,
    152                                                                    uint8_t dwInteruptMask);
    153 extern void XDMAC_DisableChannelIt (Xdmac *pXdmac, uint8_t channel,
    154                                                                         uint8_t dwInteruptMask);
    155 extern uint32_t XDMAC_GetChannelItMask (Xdmac *pXdmac, uint8_t channel);
    156 extern uint32_t XDMAC_GetChannelIsr (Xdmac *pXdmac, uint8_t channel);
    157 extern uint32_t XDMAC_GetMaskChannelIsr (Xdmac *pXdmac, uint8_t channel);
    158 extern void XDMAC_SetSourceAddr(Xdmac *pXdmac, uint8_t channel, uint32_t addr);
    159 extern void XDMAC_SetDestinationAddr(Xdmac *pXdmac, uint8_t channel,
    160                                                                          uint32_t addr);
    161 extern void XDMAC_SetDescriptorAddr(Xdmac *pXdmac, uint8_t channel,
    162                                                                         uint32_t addr, uint8_t ndaif);
    163 extern void XDMAC_SetDescriptorControl(Xdmac *pXdmac, uint8_t channel,
    164                                                                            uint8_t config);
    165 extern void XDMAC_SetMicroblockControl(Xdmac *pXdmac, uint8_t channel,
    166                                                                            uint32_t ublen);
    167 extern void XDMAC_SetBlockControl(Xdmac *pXdmac, uint8_t channel,
    168                                                                   uint16_t blen);
    169 extern void XDMAC_SetChannelConfig(Xdmac *pXdmac, uint8_t channel,
    170                                                                    uint32_t config);
    171 extern uint32_t XDMAC_GetChannelConfig(Xdmac *pXdmac, uint8_t channel);
    172 extern void XDMAC_SetDataStride_MemPattern(Xdmac *pXdmac, uint8_t channel,
    173                 uint32_t dds_msp);
    174 extern void XDMAC_SetSourceMicroBlockStride(Xdmac *pXdmac, uint8_t channel,
    175                 uint32_t subs);
    176 extern void XDMAC_SetDestinationMicroBlockStride(Xdmac *pXdmac, uint8_t channel,
    177                 uint32_t dubs);
    178 extern uint32_t XDMAC_GetChDestinationAddr(Xdmac *pXdmac, uint8_t channel);
     126/**
     127 * \brief Get XDMAC global type.
     128 *
     129 * \param pXdmac Pointer to the XDMAC peripheral.
     130 */
     131static inline uint32_t XDMAC_GetType(Xdmac *pXdmac)
     132{
     133        assert(pXdmac);
     134        return pXdmac->XDMAC_GTYPE;
     135}
     136
     137/**
     138 * \brief Get XDMAC global configuration.
     139 *
     140 * \param pXdmac Pointer to the XDMAC peripheral.
     141 */
     142static inline uint32_t XDMAC_GetConfig(Xdmac *pXdmac)
     143{
     144        assert(pXdmac);
     145        return pXdmac->XDMAC_GCFG;
     146}
     147
     148/**
     149 * \brief Get XDMAC global weighted arbiter configuration.
     150 *
     151 * \param pXdmac Pointer to the XDMAC peripheral.
     152 */
     153static inline uint32_t XDMAC_GetArbiter(Xdmac *pXdmac)
     154{
     155        assert(pXdmac);
     156        return pXdmac->XDMAC_GWAC;
     157}
     158
     159/**
     160 * \brief Enables XDMAC global interrupt.
     161 *
     162 * \param pXdmac Pointer to the XDMAC peripheral.
     163 * \param dwInteruptMask IT to be enabled.
     164 */
     165static inline void XDMAC_EnableGIt (Xdmac *pXdmac, uint8_t dwInteruptMask)
     166{
     167        assert(pXdmac);
     168        pXdmac->XDMAC_GIE = (XDMAC_GIE_IE0 << dwInteruptMask);
     169}
     170
     171/**
     172 * \brief Disables XDMAC global interrupt
     173 *
     174 * \param pXdmac Pointer to the XDMAC peripheral.
     175 * \param dwInteruptMask IT to be enabled
     176 */
     177static inline void XDMAC_DisableGIt (Xdmac *pXdmac, uint8_t dwInteruptMask)
     178{
     179        assert(pXdmac);
     180        pXdmac->XDMAC_GID = (XDMAC_GID_ID0 << dwInteruptMask);
     181}
     182
     183/**
     184 * \brief Get XDMAC global interrupt mask.
     185 *
     186 * \param pXdmac Pointer to the XDMAC peripheral.
     187 */
     188static inline uint32_t XDMAC_GetGItMask(Xdmac *pXdmac)
     189{
     190        assert(pXdmac);
     191        return (pXdmac->XDMAC_GIM);
     192}
     193
     194/**
     195 * \brief Get XDMAC global interrupt status.
     196 *
     197 * \param pXdmac Pointer to the XDMAC peripheral.
     198 */
     199static inline uint32_t XDMAC_GetGIsr(Xdmac *pXdmac)
     200{
     201        assert(pXdmac);
     202        return (pXdmac->XDMAC_GIS);
     203}
     204
     205/**
     206 * \brief Get XDMAC masked global interrupt.
     207 *
     208 * \param pXdmac Pointer to the XDMAC peripheral.
     209 */
     210static inline uint32_t XDMAC_GetMaskedGIsr(Xdmac *pXdmac)
     211{
     212        uint32_t _dwStatus;
     213        assert(pXdmac);
     214        _dwStatus = pXdmac->XDMAC_GIS;
     215        _dwStatus &= pXdmac->XDMAC_GIM;
     216        return _dwStatus;
     217}
     218
     219/**
     220 * \brief enables the relevant channel of given XDMAC.
     221 *
     222 * \param pXdmac Pointer to the XDMAC peripheral.
     223 * \param channel Particular channel number.
     224 */
     225static inline void XDMAC_EnableChannel(Xdmac *pXdmac, uint8_t channel)
     226{
     227        assert(pXdmac);
     228        assert(channel < XDMAC_CHANNEL_NUM);
     229        pXdmac->XDMAC_GE = (XDMAC_GE_EN0 << channel);
     230}
     231
     232/**
     233 * \brief enables the relevant channels of given XDMAC.
     234 *
     235 * \param pXdmac Pointer to the XDMAC peripheral.
     236 * \param bmChannels Channels bitmap.
     237 */
     238static inline void XDMAC_EnableChannels(Xdmac *pXdmac, uint32_t bmChannels)
     239{
     240        assert(pXdmac);
     241        pXdmac->XDMAC_GE = bmChannels;
     242}
     243
     244/**
     245 * \brief Disables the relevant channel of given XDMAC.
     246 *
     247 * \param pXdmac Pointer to the XDMAC peripheral.
     248 * \param channel Particular channel number.
     249 */
     250static inline void XDMAC_DisableChannel(Xdmac *pXdmac, uint8_t channel)
     251{
     252        assert(pXdmac);
     253        assert(channel < XDMAC_CHANNEL_NUM);
     254        pXdmac->XDMAC_GD = (XDMAC_GD_DI0 << channel);
     255}
     256
     257/**
     258 * \brief Disables the relevant channels of given XDMAC.
     259 *
     260 * \param pXdmac Pointer to the XDMAC peripheral.
     261 * \param bmChannels Channels bitmap.
     262 */
     263static inline void XDMAC_DisableChannels(Xdmac *pXdmac, uint32_t bmChannels)
     264{
     265        assert(pXdmac);
     266        pXdmac->XDMAC_GD = bmChannels;
     267}
     268
     269
     270/**
     271 * \brief Get Global channel status of given XDMAC.
     272 * \note: When set to 1, this bit indicates that the channel x is enabled.
     273   If a channel disable request is issued, this bit remains asserted
     274   until pending transaction is completed.
     275 * \param pXdmac Pointer to the XDMAC peripheral.
     276 */
     277static inline uint32_t XDMAC_GetGlobalChStatus(Xdmac *pXdmac)
     278{
     279        assert(pXdmac);
     280        return pXdmac->XDMAC_GS;
     281}
     282
     283/**
     284 * \brief Suspend the relevant channel's read.
     285 *
     286 * \param pXdmac Pointer to the XDMAC peripheral.
     287 * \param channel Particular channel number.
     288 */
     289static inline void XDMAC_SuspendReadChannel(Xdmac *pXdmac, uint8_t channel)
     290{
     291        assert(pXdmac);
     292        assert(channel < XDMAC_CHANNEL_NUM);
     293        pXdmac->XDMAC_GRS |= XDMAC_GRS_RS0 << channel;
     294}
     295
     296/**
     297 * \brief Suspend the relevant channel's write.
     298 *
     299 * \param pXdmac Pointer to the XDMAC peripheral.
     300 * \param channel Particular channel number.
     301 */
     302static inline void XDMAC_SuspendWriteChannel(Xdmac *pXdmac, uint8_t channel)
     303{
     304        assert(pXdmac);
     305        assert(channel < XDMAC_CHANNEL_NUM);
     306        pXdmac->XDMAC_GWS |= XDMAC_GWS_WS0 << channel;
     307}
     308
     309/**
     310 * \brief Suspend the relevant channel's read & write.
     311 *
     312 * \param pXdmac Pointer to the XDMAC peripheral.
     313 * \param channel Particular channel number.
     314 */
     315static inline void XDMAC_SuspendReadWriteChannel(Xdmac *pXdmac, uint8_t channel)
     316{
     317        assert(pXdmac);
     318        assert(channel < XDMAC_CHANNEL_NUM);
     319        pXdmac->XDMAC_GRWS = (XDMAC_GRWS_RWS0 << channel);
     320}
     321
     322/**
     323 * \brief Resume the relevant channel's read & write.
     324 *
     325 * \param pXdmac Pointer to the XDMAC peripheral.
     326 * \param channel Particular channel number.
     327 */
     328static inline void XDMAC_ResumeReadWriteChannel(Xdmac *pXdmac, uint8_t channel)
     329{
     330        assert(pXdmac);
     331        assert(channel < XDMAC_CHANNEL_NUM);
     332        pXdmac->XDMAC_GRWR = (XDMAC_GRWR_RWR0 << channel);
     333}
     334
     335/**
     336 * \brief Set software transfer request on the relevant channel.
     337 *
     338 * \param pXdmac Pointer to the XDMAC peripheral.
     339 * \param channel Particular channel number.
     340 */
     341static inline void XDMAC_SoftwareTransferReq(Xdmac *pXdmac, uint8_t channel)
     342{
     343
     344        assert(pXdmac);
     345        assert(channel < XDMAC_CHANNEL_NUM);
     346        pXdmac->XDMAC_GSWR = (XDMAC_GSWR_SWREQ0 << channel);
     347}
     348
     349/**
     350 * \brief Get software transfer status of the relevant channel.
     351 *
     352 * \param pXdmac Pointer to the XDMAC peripheral.
     353 */
     354static inline uint32_t XDMAC_GetSoftwareTransferStatus(Xdmac *pXdmac)
     355{
     356
     357        assert(pXdmac);
     358        return pXdmac->XDMAC_GSWS;
     359}
     360
     361/**
     362 * \brief Get interrupt status for the relevant channel of given XDMA.
     363 *
     364 * \param pXdmac Pointer to the XDMAC peripheral.
     365 * \param channel Particular channel number.
     366 */
     367static inline uint32_t XDMAC_GetChannelIsr (Xdmac *pXdmac, uint8_t channel)
     368{
     369        assert(pXdmac);
     370        assert(channel < XDMAC_CHANNEL_NUM);
     371        return pXdmac->XDMAC_CHID[channel].XDMAC_CIS;
     372}
     373
     374/**
     375 * \brief Set software flush request on the relevant channel.
     376 * \note: This API is used as polling without enabling FIE interrupt.
     377 * The user can use it in interrupt mode after deleting while sentense.
     378 * \param pXdmac Pointer to the XDMAC peripheral.
     379 * \param channel Particular channel number.
     380 */
     381static inline void XDMAC_SoftwareFlushReq(Xdmac *pXdmac, uint8_t channel)
     382{
     383        assert(pXdmac);
     384        assert(channel < XDMAC_CHANNEL_NUM);
     385        pXdmac->XDMAC_GSWF = (XDMAC_GSWF_SWF0 << channel);
     386
     387        while (!(XDMAC_GetChannelIsr(pXdmac, channel) & XDMAC_CIS_FIS));
     388}
     389
     390/**
     391 * \brief Disable interrupt with mask on the relevant channel of given XDMA.
     392 *
     393 * \param pXdmac Pointer to the XDMAC peripheral.
     394 * \param channel Particular channel number.
     395 * \param dwInteruptMask Interrupt mask.
     396 */
     397static inline void XDMAC_EnableChannelIt (Xdmac *pXdmac, uint8_t channel,
     398                                                        uint8_t dwInteruptMask)
     399{
     400        assert(pXdmac);
     401        assert(channel < XDMAC_CHANNEL_NUM);
     402        pXdmac->XDMAC_CHID[channel].XDMAC_CIE = dwInteruptMask;
     403}
     404
     405/**
     406 * \brief Enable interrupt with mask on the relevant channel of given XDMA.
     407 *
     408 * \param pXdmac Pointer to the XDMAC peripheral.
     409 * \param channel Particular channel number.
     410 * \param dwInteruptMask Interrupt mask.
     411 */
     412static inline void XDMAC_DisableChannelIt (Xdmac *pXdmac, uint8_t channel,
     413                                                         uint8_t dwInteruptMask)
     414{
     415        assert(pXdmac);
     416        assert(channel < XDMAC_CHANNEL_NUM);
     417        pXdmac->XDMAC_CHID[channel].XDMAC_CID = dwInteruptMask;
     418}
     419
     420/**
     421 * \brief Get interrupt mask for the relevant channel of given XDMA.
     422 *
     423 * \param pXdmac Pointer to the XDMAC peripheral.
     424 * \param channel Particular channel number.
     425 */
     426static inline uint32_t XDMAC_GetChannelItMask (Xdmac *pXdmac, uint8_t channel)
     427{
     428        assert(pXdmac);
     429        assert(channel < XDMAC_CHANNEL_NUM);
     430        return pXdmac->XDMAC_CHID[channel].XDMAC_CIM;
     431}
     432
     433/**
     434 * \brief Get masked interrupt status for the relevant channel of given XDMA.
     435 *
     436 * \param pXdmac Pointer to the XDMAC peripheral.
     437 * \param channel Particular channel number.
     438 */
     439static inline uint32_t XDMAC_GetMaskChannelIsr (Xdmac *pXdmac, uint8_t channel)
     440{
     441        uint32_t status;
     442        assert(pXdmac);
     443        assert(channel < XDMAC_CHANNEL_NUM);
     444        status = pXdmac->XDMAC_CHID[channel].XDMAC_CIS;
     445        status &= pXdmac->XDMAC_CHID[channel].XDMAC_CIM;
     446
     447        return status;
     448}
     449
     450/**
     451 * \brief Set source address for the relevant channel of given XDMA.
     452 *
     453 * \param pXdmac Pointer to the XDMAC peripheral.
     454 * \param channel Particular channel number.
     455 * \param addr Source address.
     456 */
     457static inline void XDMAC_SetSourceAddr(Xdmac *pXdmac, uint8_t channel, uint32_t addr)
     458{
     459        assert(pXdmac);
     460        assert(channel < XDMAC_CHANNEL_NUM);
     461        pXdmac->XDMAC_CHID[channel].XDMAC_CSA = addr;
     462}
     463
     464/**
     465 * \brief Set destination address for the relevant channel of given XDMA.
     466 *
     467 * \param pXdmac Pointer to the XDMAC peripheral.
     468 * \param channel Particular channel number.
     469 * \param addr Destination address.
     470 */
     471static inline void XDMAC_SetDestinationAddr(Xdmac *pXdmac, uint8_t channel, uint32_t addr)
     472{
     473        assert(pXdmac);
     474        assert(channel < XDMAC_CHANNEL_NUM);
     475        pXdmac->XDMAC_CHID[channel].XDMAC_CDA = addr;
     476}
     477
     478/**
     479 * \brief Set next descriptor's address & interface for the relevant channel of
     480 *  given XDMA.
     481 *
     482 * \param pXdmac Pointer to the XDMAC peripheral.
     483 * \param channel Particular channel number.
     484 * \param addr Address of next descriptor.
     485 * \param ndaif Interface of next descriptor.
     486 */
     487static inline void XDMAC_SetDescriptorAddr(Xdmac *pXdmac, uint8_t channel,
     488                                                         uint32_t addr, uint8_t ndaif)
     489{
     490        assert(pXdmac);
     491        assert(ndaif < 2);
     492        assert(channel < XDMAC_CHANNEL_NUM);
     493        pXdmac->XDMAC_CHID[channel].XDMAC_CNDA =  (addr & 0xFFFFFFFC) | ndaif;
     494}
     495
     496/**
     497 * \brief Set next descriptor's configuration for the relevant channel of
     498 *  given XDMA.
     499 *
     500 * \param pXdmac Pointer to the XDMAC peripheral.
     501 * \param channel Particular channel number.
     502 * \param config Configuration of next descriptor.
     503 */
     504static inline void XDMAC_SetDescriptorControl(Xdmac *pXdmac, uint8_t channel, uint8_t config)
     505{
     506        assert(pXdmac);
     507        assert(channel < XDMAC_CHANNEL_NUM);
     508        pXdmac->XDMAC_CHID[channel].XDMAC_CNDC = config;
     509}
     510
     511/**
     512 * \brief Set microblock length for the relevant channel of given XDMA.
     513 *
     514 * \param pXdmac Pointer to the XDMAC peripheral.
     515 * \param channel Particular channel number.
     516 * \param ublen Microblock length.
     517 */
     518static inline void XDMAC_SetMicroblockControl(Xdmac *pXdmac, uint8_t channel, uint32_t ublen)
     519{
     520        assert(pXdmac);
     521        assert(channel < XDMAC_CHANNEL_NUM);
     522        pXdmac->XDMAC_CHID[channel].XDMAC_CUBC = XDMAC_CUBC_UBLEN(ublen);
     523}
     524
     525/**
     526 * \brief Set block length for the relevant channel of given XDMA.
     527 *
     528 * \param pXdmac Pointer to the XDMAC peripheral.
     529 * \param channel Particular channel number.
     530 * \param blen Block length.
     531 */
     532static inline void XDMAC_SetBlockControl(Xdmac *pXdmac, uint8_t channel, uint16_t blen)
     533{
     534        assert(pXdmac);
     535        assert(channel < XDMAC_CHANNEL_NUM);
     536        pXdmac->XDMAC_CHID[channel].XDMAC_CBC = XDMAC_CBC_BLEN(blen);
     537}
     538
     539/**
     540 * \brief Set configuration for the relevant channel of given XDMA.
     541 *
     542 * \param pXdmac Pointer to the XDMAC peripheral.
     543 * \param channel Particular channel number.
     544 * \param config Channel configuration.
     545 */
     546static inline void XDMAC_SetChannelConfig(Xdmac *pXdmac, uint8_t channel, uint32_t config)
     547{
     548        assert(pXdmac);
     549        assert(channel < XDMAC_CHANNEL_NUM);
     550        pXdmac->XDMAC_CHID[channel].XDMAC_CC = config;
     551}
     552
     553/**
     554 * \brief Get the relevant channel's configuration of given XDMA.
     555 *
     556 * \param pXdmac Pointer to the XDMAC peripheral.
     557 * \param channel Particular channel number.
     558 */
     559static inline uint32_t XDMAC_GetChannelConfig(Xdmac *pXdmac, uint8_t channel)
     560{
     561        assert(pXdmac);
     562        assert(channel < XDMAC_CHANNEL_NUM);
     563        return pXdmac->XDMAC_CHID[channel].XDMAC_CC;
     564}
     565
     566/**
     567 * \brief Set the relevant channel's data stride memory pattern of given XDMA.
     568 *
     569 * \param pXdmac Pointer to the XDMAC peripheral.
     570 * \param channel Particular channel number.
     571 * \param dds_msp Data stride memory pattern.
     572 */
     573static inline void XDMAC_SetDataStride_MemPattern(Xdmac *pXdmac, uint8_t channel,
     574                                                                        uint32_t dds_msp)
     575{
     576
     577        assert(pXdmac);
     578        assert(channel < XDMAC_CHANNEL_NUM);
     579        pXdmac->XDMAC_CHID[channel].XDMAC_CDS_MSP = dds_msp;
     580}
     581
     582/**
     583 * \brief Set the relevant channel's source microblock stride of given XDMA.
     584 *
     585 * \param pXdmac Pointer to the XDMAC peripheral.
     586 * \param channel Particular channel number.
     587 * \param subs Source microblock stride.
     588 */
     589static inline void XDMAC_SetSourceMicroBlockStride(Xdmac *pXdmac, uint8_t channel,
     590                                                                         uint32_t subs)
     591{
     592        assert(pXdmac);
     593        assert(channel < XDMAC_CHANNEL_NUM);
     594        pXdmac->XDMAC_CHID[channel].XDMAC_CSUS = XDMAC_CSUS_SUBS(subs);
     595}
     596
     597/**
     598 * \brief Set the relevant channel's destination microblock stride of given XDMA.
     599 *
     600 * \param pXdmac Pointer to the XDMAC peripheral.
     601 * \param channel Particular channel number.
     602 * \param dubs Destination microblock stride.
     603 */
     604static inline void XDMAC_SetDestinationMicroBlockStride(Xdmac *pXdmac, uint8_t channel,
     605                uint32_t dubs)
     606{
     607        assert(pXdmac);
     608        assert(channel < XDMAC_CHANNEL_NUM);
     609        pXdmac->XDMAC_CHID[channel].XDMAC_CDUS = XDMAC_CDUS_DUBS(dubs);
     610}
     611
     612/**
     613 * \brief Get the relevant channel's destination address of given XDMA.
     614 *
     615 * \param pXdmac Pointer to the XDMAC peripheral.
     616 * \param channel Particular channel number.
     617 */
     618static inline uint32_t XDMAC_GetChDestinationAddr(Xdmac *pXdmac, uint8_t channel)
     619{
     620        assert(pXdmac);
     621        assert(channel < XDMAC_CHANNEL_NUM);
     622        return pXdmac->XDMAC_CHID[channel].XDMAC_CDA;
     623}
     624
     625static inline void XDMAC_StartTransfer(Xdmac *pXdmac, uint8_t channel)
     626{
     627        assert(pXdmac);
     628        assert(channel < XDMAC_CHANNEL_NUM);
     629        pXdmac->XDMAC_GE = (XDMAC_GE_EN0 << channel);
     630        pXdmac->XDMAC_GIE = (XDMAC_GIE_IE0 << channel);
     631}
     632
    179633#ifdef __cplusplus
    180634}
Note: See TracChangeset for help on using the changeset viewer.