r_config_dma.h 4.67 KB
Newer Older
时昊's avatar
时昊 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
/*
****************************************************************************
PROJECT : D1x
FILE    : $Id: r_config_dma.h 7180 2016-01-07 17:45:54Z tobyas.hennig $
============================================================================
DESCRIPTION
DMA configuration for D1x
============================================================================
                            C O P Y R I G H T
============================================================================
                           Copyright (c) 2015
                                  by
                       Renesas Electronics (Europe) GmbH.
                           Arcadiastrasse 10
                          D-40472 Duesseldorf
                               Germany
                          All rights reserved.
============================================================================
Purpose: only for testing

Warranty Disclaimer

Because the Product(s) is licensed free of charge, there is no warranty
of any kind whatsoever and expressly disclaimed and excluded by Renesas,
either expressed or implied, including but not limited to those for
non-infringement of intellectual property, merchantability and/or
fitness for the particular purpose.
Renesas shall not have any obligation to maintain, service or provide bug
fixes for the supplied Product(s) and/or the Application.

Each User is solely responsible for determining the appropriateness of
using the Product(s) and assumes all risks associated with its exercise
of rights under this Agreement, including, but not limited to the risks
and costs of program errors, compliance with applicable laws, damage to
or loss of data, programs or equipment, and unavailability or
interruption of operations.

Limitation of Liability

In no event shall Renesas be liable to the User for any incidental,
consequential, indirect, or punitive damage (including but not limited
to lost profits) regardless of whether such liability is based on breach
of contract, tort, strict liability, breach of warranties, failure of
essential purpose or otherwise and even if advised of the possibility of
such damages. Renesas shall not be liable for any services or products
provided by third party vendors, developers or consultants identified or
referred to the User by Renesas in connection with the Product(s) and/or the
Application.

****************************************************************************
*/

#ifndef CONFIG_DMA_H_
#define CONFIG_DMA_H_

#if defined(R_DBG_PRINT_DMA_REGS) || defined(R_DBG_PRINT_MSG)
    #include <stdio.h>
    #include "r_dbg_api.h"
#endif

/***********************************************************
  Title: upd70xxxx dmac Configuration
*/

/***********************************************************
  Section: Global Defines
*/

/***********************************************************
  Constant: EE_DMAC_MACRO_NUM

  Number of macros in the device.
*/

#define R_DMA_MACRO_NUM 1u

/***********************************************************
  Constant: EE_DMAC_CHANNEL_NUM

  Number of channels in the device.
*/

#define R_DMA_CHANNEL_NUM 8u

/***********************************************************
  Constant: DMAC_SYSTEM_CLOCK

  System Clock of the macro
*/

#define R_DMA_SYSTEM_CLOCK 20000000u

/***********************************************************
  Constant: DMAC_BASE_ADDRESS

  Base address of the macro
*/

#define R_DMA_BASE_ADDRESS 0xFFFF7300u

#define R_DMA_DTFR_BASE_ADDRESS 0xFFFF7B00u

#define R_DMA_CHANNEL_OFFSET     0x30u
#define R_DTFR_CHANNEL_OFFSET    0x02u
#define R_DMA_CHANNEL_OFFSET_GAP 0x80u

/***********************************************************
  Section: Global Macros
*/

/***********************************************************
  Macro: R_DMA_WRITE_REG

  Write DMAC register with predefined size.
  SIZE allowed values are 8, 16, 32
*/

#ifdef R_DBG_PRINT_DMA_REGS
    #define R_DMA_WRITE_REG(SIZE, ADDR, VALUE)                \
        {                                                     \
            R_DBG_PrintRegCmd((SIZE), (ADDR), (VALUE));       \
            *(( volatile uint##SIZE##_t * )(ADDR)) = (VALUE); \
        }
#else
    #define R_DMA_WRITE_REG(SIZE, ADDR, VALUE)                \
        {                                                     \
            *(( volatile uint##SIZE##_t * )(ADDR)) = (VALUE); \
        }
#endif

/***********************************************************
  Macro: R_DMA_READ_REG

  Read DMAC register with predefined size.
  SIZE allowed values are 8, 16, 32
*/

#ifdef R_DBG_PRINT_DMA_REGS
    #define R_DMA_READ_REG(SIZE, ADDR) (R_DBG_PrintRegRead##SIZE##(ADDR))
#else
    #define R_DMA_READ_REG(SIZE, ADDR) (*(( volatile uint##SIZE##_t * )((ADDR))))
#endif

#endif /* CONFIG_DMA_H_ */