| 1 |
/* |
| 2 |
* The MIT License (MIT) |
| 3 |
* |
| 4 |
* Copyright (c) 2021 Renesas Electronics Corporation |
| 5 |
* |
| 6 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 |
* of this software and associated documentation files (the "Software"), to deal |
| 8 |
* in the Software without restriction, including without limitation the rights |
| 9 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 |
* copies of the Software, and to permit persons to whom the Software is |
| 11 |
* furnished to do so, subject to the following conditions: |
| 12 |
* |
| 13 |
* The above copyright notice and this permission notice shall be included in |
| 14 |
* all copies or substantial portions of the Software. |
| 15 |
* |
| 16 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 |
* THE SOFTWARE. |
| 23 |
*/ |
| 24 |
|
| 25 |
#ifndef RA_RA_CONFIG_H_ |
| 26 |
#define RA_RA_CONFIG_H_ |
| 27 |
|
| 28 |
#include <stdint.h> |
| 29 |
#include "py/mpconfig.h" |
| 30 |
|
| 31 |
#if defined(RA4M1) | defined(RA4W1) |
| 32 |
#define SCI_CH_MAX 10 |
| 33 |
#define SCI_CH_NUM 4 |
| 34 |
#define SCI_TX_BUF_SIZE 128 |
| 35 |
#define SCI_RX_BUF_SIZE 256 |
| 36 |
#define PCLK 48000000 |
| 37 |
#elif defined(RA6M1) | defined(RA6M2) |
| 38 |
#define SCI_CH_MAX 10 |
| 39 |
#define SCI_CH_NUM 4 |
| 40 |
#define SCI_TX_BUF_SIZE 128 |
| 41 |
#define SCI_RX_BUF_SIZE 256 |
| 42 |
#define PCLK 120000000 |
| 43 |
#elif defined(RA6M5) |
| 44 |
#define SCI_CH_MAX 10 |
| 45 |
#define SCI_CH_NUM 4 |
| 46 |
#define SCI_TX_BUF_SIZE 128 |
| 47 |
#define SCI_RX_BUF_SIZE 256 |
| 48 |
#define PCLK 100000000 |
| 49 |
#else |
| 50 |
#error "CMSIS MCU Series is not specified." |
| 51 |
#endif |
| 52 |
|
| 53 |
#if defined(MICROPY_HW_MCU_PCLK) |
| 54 |
#undef PCLK |
| 55 |
#define PCLK MICROPY_HW_MCU_PCLK |
| 56 |
#endif |
| 57 |
|
| 58 |
#define SCI_DEF_BAUD (115200) |
| 59 |
|
| 60 |
#if !defined(RA_PRI_SYSTICK) |
| 61 |
#define RA_PRI_SYSTICK (0) |
| 62 |
#endif |
| 63 |
#if !defined(RA_PRI_UART) |
| 64 |
#define RA_PRI_UART (1) |
| 65 |
#endif |
| 66 |
#if !defined(RA_PRI_SDIO) |
| 67 |
#define RA_PRI_SDIO (4) |
| 68 |
#endif |
| 69 |
#if !defined(RA_PRI_DMA) |
| 70 |
#define RA_PRI_DMA (5) |
| 71 |
#endif |
| 72 |
#if !defined(RA_PRI_FLASH) |
| 73 |
#define RA_PRI_FLASH (6) |
| 74 |
#endif |
| 75 |
#if !defined(RA_PRI_OTG_FS) |
| 76 |
#define RA_PRI_OTG_FS (6) |
| 77 |
#endif |
| 78 |
#if !defined(RA_PRI_OTG_HS) |
| 79 |
#define RA_PRI_OTG_HS (6) |
| 80 |
#endif |
| 81 |
#if !defined(RA_PRI_TIM5) |
| 82 |
#define RA_PRI_TIM5 (6) |
| 83 |
#endif |
| 84 |
#if !defined(RA_PRI_CAN) |
| 85 |
#define RA_PRI_CAN (7) |
| 86 |
#endif |
| 87 |
#if !defined(RA_PRI_SPI) |
| 88 |
#define RA_PRI_SPI (8) |
| 89 |
#endif |
| 90 |
#if !defined(RA_PRI_I2C) |
| 91 |
#define RA_PRI_I2C (8) |
| 92 |
#endif |
| 93 |
#if !defined(RA_PRI_TIMX) |
| 94 |
#define RA_PRI_TIMX (13) |
| 95 |
#endif |
| 96 |
#if !defined(RA_PRI_EXTINT) |
| 97 |
#define RA_PRI_EXTINT (14) |
| 98 |
#endif |
| 99 |
#if !defined(RA_PRI_PENDSV) |
| 100 |
#define RA_PRI_PENDSV (15) |
| 101 |
#endif |
| 102 |
#if !defined(RA_PRI_RTC_WKUP) |
| 103 |
#define RA_PRI_RTC_WKUP (15) |
| 104 |
#endif |
| 105 |
|
| 106 |
#if !defined(__WEAK) |
| 107 |
#define __WEAK __attribute__((weak)) |
| 108 |
#endif |
| 109 |
|
| 110 |
#endif /* RA_RA_CONFIG_H_ */ |