Skip to content

Commit

Permalink
[updated] RL78/G24_FPB related files for Arduino library.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiyaKobayashi committed Sep 30, 2024
1 parent ee45440 commit d9be5ad
Show file tree
Hide file tree
Showing 131 changed files with 28,547 additions and 30,894 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# ArduinoCore-rl78g24_fpb
* ArduinoCore-rl78g24_fpb for https://github.com/renesas/Arduino/tree/master/hardware
# ArduinoCore-rl78g24

# Support
If you find a bug you can submit an issue here on Renesas site:
http://www.renesas.com/contact
This repository contains the source code and configuration files of the Arduino Core for Renesas RL78/G24 Fast Prototyping Board platform.

# Notes
* This repository contains the source code and configuration files of the Arduino RL78/G24 Fast Prototyping Board platform.
# Quick Start Guide and more information

# More information
* The wiki below includes some information about how to use Arduino Library on Renesas Boards.
* https://github.com/renesas/Arduino/wiki
The wiki below includes ‘Quick Start Guide’ about how to install and use Arduino Library on the Renesas Board and more information. Please try to take a look at the site.

* https://github.com/renesas/Arduino/wiki
51 changes: 14 additions & 37 deletions cores/rl78g24/Arduino.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
/*
Arduino.h - Main include file for the Arduino SDK
Copyright (c) 2014 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef Arduino_h
#define Arduino_h

Expand All @@ -39,10 +20,6 @@ extern "C" {
#define _HALT() asm("halt;");
#define _STOP() asm("stop;");

/* Software PWM 定義 */
#define SW_PWM_TIMER 6
#define SWPWM_MIN 1024

#define clockCyclesPerMicrosecond() (configCPU_CLOCK_HZ / 1000000) //!< CPUの動作周波数を1000000で割ったもの
#define clockCyclesToMicroseconds(cycle) ((cycle) / clockCyclesPerMicrosecond()) //!< サイクルあたりの時間[us]
#define microsecondsToClockCycles(us) ((us) * clockCyclesPerMicrosecond()) //!< 時間当たりのサイクル数
Expand Down Expand Up @@ -78,7 +55,7 @@ extern "C"{
#define INPUT_TTL_PULLUP 0x6

/* PWM setting. */
#define PWM_MASTER_CLOCK (32000000)
#define PWM_MASTER_CLOCK (48000000)
#if PWM_MASTER_CLOCK == 32000000
#define PWM_MASTER_MODE (0x0801) // CK0を選択
#define PWM_SLAVE_MODE (0x0409)
Expand Down Expand Up @@ -166,19 +143,19 @@ void loop();
/* S3 core (with Multiply/divide/multiply & accumulate instructions)*/

#if (F_CPU == 48000000)
/* For RL78/G23, RL78/G22, etc. */
#define MICROS_EXEC_TIME (4) /* micros() execution time(unit:us) */
#define DELAYMICROSECONDS_ADJUST1 (2) /* Processing time(unit:us) if delayMicroseconds() function returns immediately */
#define DELAYMICROSECONDS_ADJUST2 (MICROS_EXEC_TIME + DELAYMICROSECONDS_ADJUST1 + 1)
#define DELAYMICROSECONDS_ADJUST3 (DELAYMICROSECONDS_ADJUST2 + MICROS_EXEC_TIME)
#define DELAYMICROSECONDS_ADJUST4 (4) /* Adjustment when waiting for time in delay_wait(). (visual check) */
/* For RL78/G24, etc. */
#define MICROS_EXEC_TIME (3) /* micros() execution time(unit:us) */
#define DELAYMICROSECONDS_ADJUST1 (1) /* Processing time(unit:us) if delayMicroseconds() function returns immediately */
#define DELAYMICROSECONDS_ADJUST2 (4) // (MICROS_EXEC_TIME + DELAYMICROSECONDS_ADJUST1 + 1)
#define DELAYMICROSECONDS_ADJUST3 (8) // (DELAYMICROSECONDS_ADJUST2 + MICROS_EXEC_TIME)
#define DELAYMICROSECONDS_ADJUST4 (6) /* Adjustment when waiting for time in delay_wait(). (visual check) */
#elif (F_CPU == 32000000)
/* For RL78/G23, RL78/G22, etc. */
#define MICROS_EXEC_TIME (4) /* micros() execution time(unit:us) */
#define DELAYMICROSECONDS_ADJUST1 (2) /* Processing time(unit:us) if delayMicroseconds() function returns immediately */
#define MICROS_EXEC_TIME (3) /* micros() execution time(unit:us) */
#define DELAYMICROSECONDS_ADJUST1 (1) /* Processing time(unit:us) if delayMicroseconds() function returns immediately */
#define DELAYMICROSECONDS_ADJUST2 (MICROS_EXEC_TIME + DELAYMICROSECONDS_ADJUST1 + 1)
#define DELAYMICROSECONDS_ADJUST3 (DELAYMICROSECONDS_ADJUST2 + MICROS_EXEC_TIME)
#define DELAYMICROSECONDS_ADJUST4 (4) /* Adjustment when waiting for time in delay_wait(). (visual check) */
#define DELAYMICROSECONDS_ADJUST4 (5) /* Adjustment when waiting for time in delay_wait(). (visual check) */
#else /* (F_CPU == 16000000) */
#endif /* (F_CPU == 16000000) */

Expand All @@ -199,10 +176,10 @@ void loop();
#elif (F_CPU == 16000000)
/* For RL78/G15, etc */
#define MICROS_EXEC_TIME (13) /* unit : us */
#define DELAYMICROSECONDS_ADJUST1 (3) /* Processing time(unit:us) if delayMicroseconds() function returns immediately */
#define DELAYMICROSECONDS_ADJUST2 (MICROS_EXEC_TIME + DELAYMICROSECONDS_ADJUST1 + 1)
#define DELAYMICROSECONDS_ADJUST3 (DELAYMICROSECONDS_ADJUST2 + MICROS_EXEC_TIME)
#define DELAYMICROSECONDS_ADJUST4 (2) /* Adjustment when waiting for time in delay_wait(). (visual check) */
#define DELAYMICROSECONDS_ADJUST1 (1) /* Processing time(unit:us) if delayMicroseconds() function returns immediately */
#define DELAYMICROSECONDS_ADJUST2 (15) // (MICROS_EXEC_TIME + DELAYMICROSECONDS_ADJUST1 + 1)
#define DELAYMICROSECONDS_ADJUST3 (18) // (DELAYMICROSECONDS_ADJUST2 + MICROS_EXEC_TIME)
#define DELAYMICROSECONDS_ADJUST4 (2) /* Adjustment when waiting for time in delay_wait(). (visual check) */
#else /* (F_CPU == XXX) */
#endif /* (F_CPU == XXX) */

Expand Down
Loading

0 comments on commit d9be5ad

Please sign in to comment.