This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Rotary Encoder ISR */ | |
ISR(PCINT0_vect) { | |
// Strawman ~3.75uS delay (@16MHz) so we can reliably detect the detent signal (A & B transition at the same time) even though | |
// the A & B signals are still technically 1-2uS apart. | |
_delay_loop_1(20); | |
// Analog inputs are all on PORTA | |
char pins = (~PINA) & 0x03; // A0 + A1 | |
if ( (pins == 0x03 && rotPinsLast == 0x00) || (pins == 0x00 && rotPinsLast == 0x03) ) { // A & B | |
if (rotTurning) { | |
if (rotDir == 1) { // Completed a clockwise turn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Enable HOCO, set to 50MHz, set CKSEL to HOCO | |
* ICLK by default is CKSEL / 1 | |
*/ | |
mov.l #0x80000, r10 | |
mov.w #0xA507, 1022[r10] ; Enable writing to Clock, Operating Power and VRCR registers | |
mov.b #0, 160[r10] ; Prepare for High-Speed power mode | |
nop | |
while_power_transitioning: | |
mov.b 160[r10], r11 | |
and #16, r11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Default value for Endian and Option Bytes is all binary-1's | |
* which provide a reasonably safe (if slow) default. | |
* Default Endian = Little-Endian | |
*/ | |
PROVIDE (__mdes = 0xFFFFFFFF); | |
PROVIDE (__ofs0 = 0xFFFFFFFF); | |
PROVIDE (__ofs1 = 0xFFFFFFFF); | |
.endian (0xFFFFFF80) : | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* dataflash_rx62n.c | |
* | |
* Created on: Nov 30, 2012 | |
* Author: spirilis | |
*/ | |
#include <stdint.h> | |
#include "iodefine.h" | |
#include "dataflash_rx62n.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17:10:20 **** Incremental Build of configuration HardwareDebug for project test **** | |
make -j4 all | |
'Scanning and building file: ../src/test.cpp' | |
'Invoking: Scanner and Compiler' | |
rx-elf-gcc -MM -MP -MF "src/test.d" -MT"src/test.o" -MT"src/test.d" -x c++ -nostdinc -ffunction-sections -fno-function-cse -fdata-sections -fsection-anchors -free -flto-compression-level=0 -fno-cse-follow-jumps -fno-jump-tables -fno-guess-branch-probability -fno-move-loop-invariants -I"C:\PROGRA~2\KPIT\GNURXV~1.03-\rx-elf\rx-elf/lib/gcc/rx-elf/4.8-GNURX_v14.03/include" -I"C:\PROGRA~2\KPIT\GNURXV~1.03-\rx-elf\rx-elf/rx-elf/include" -I"C:\Renesas\workspace\test\src" -D__RX_LITTLE_ENDIAN__=1 -DCPPAPP -Os -g2 -g -flto -mlittle-endian-data -mcpu=rx200 -nofpu -fno-exceptions -fno-rtti "../src/test.cpp" | |
../src/test.cpp:22:29: error: cannot declare variable 'SPI' to be of abstract type 'RSPI_RX210<0u>' | |
RSPI_RX210<RSPI_INSTANCE_0> SPI; | |
^ | |
In file included from ../src/test.cpp:20:0: | |
C:\Renesas\workspace\test\src/R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18:58:42 **** Incremental Build of configuration HardwareDebug for project test **** | |
make -j4 all | |
'Scanning and building file: ../src/test.cpp' | |
'Invoking: Scanner and Compiler' | |
rx-elf-gcc -MM -MP -MF "src/test.d" -MT"src/test.o" -MT"src/test.d" -x c++ -nostdinc -ffunction-sections -fno-function-cse -fdata-sections -fsection-anchors -free -flto-compression-level=0 -fno-cse-follow-jumps -fno-jump-tables -fno-guess-branch-probability -fno-move-loop-invariants -I"C:\PROGRA~2\KPIT\GNURXV~1.03-\rx-elf\rx-elf/lib/gcc/rx-elf/4.8-GNURX_v14.03/include" -I"C:\PROGRA~2\KPIT\GNURXV~1.03-\rx-elf\rx-elf/rx-elf/include" -I"C:\Renesas\workspace\test\src" -D__RX_LITTLE_ENDIAN__=1 -DCPPAPP -Os -g2 -g -flto -mlittle-endian-data -mcpu=rx200 -nofpu -fno-exceptions -fno-rtti "../src/test.cpp" | |
In file included from ../src/test.cpp:20:0: | |
C:\Renesas\workspace\test\src/RSPI_RX210.h: In instantiation of 'uint8_t RSPI_RX210<rspidrv>::transfer(uint8_t) [with volatile st_rspi& rspidrv = (* & SFRBASE_RSPI0); uint8_t = unsigned char]': | |
.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/^struct .* \{/ { | |
allstructs[$2] = 1; | |
} | |
/^#define[ \t].*volatile struct.*0x/ { | |
struct_name = $5; | |
sfrname = $2; | |
sfr_addr = substr($6,3, length($6)-3); | |
if (allstructs[struct_name] == 1) { | |
sfr[sfrname] = struct_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* GPIO type for Renesas RX (useful for hardcoding port+bit information | |
* for use by other templated C++ class libraries) | |
* | |
* Applicable for RX2xx and RX63x chips only thus far. | |
*/ | |
#ifndef RXGPIO_H | |
#define RXGPIO_H | |
#include <AbstractWiring.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Greeting-related handlers */ | |
#ifndef GREETINGS_H | |
#define GREETINGS_H | |
void HandleHi(void *, const char *, const char *, const char *); | |
void KillBot(void *, const char *, const char *, const char *); | |
void MeetAndGreet(void *, const char *, const char *, const char *); | |
void RollOver(void *, const char *, const char *, const char *); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
... | |
// eUSCI_A0 support | |
P1SEL1 &= ~(BIT4 | BIT5); | |
P1SEL0 |= BIT4|BIT5; | |
PMM_unlockLPM5(); | |
... | |
// MCLK, SMCLK are both at 16MHz running off DCO with FLL bound to XT1 crystal | |
... | |
// Initialize eUSCI_A0 |