Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Uno R4 Minima + WIFI #595

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

keeeal
Copy link

@keeeal keeeal commented Sep 28, 2024

Adds support for Uno R4 Minima + WIFI

Closes #590

Compiler options

It looks like the compiler options used to specify the R4 Minima and R4 WIFI are ARDUINO_UNOR4_MINIMA and ARDUINO_UNOR4_WIFI respectively.

Explanation of each definition

CBI and SBI

Clear Bit In and Set Bit In macros.

#define cbi(reg, bitmask) *reg &= ~bitmask
#define sbi(reg, bitmask) *reg |= bitmask

I am not 100% confident these are the correct implementations over digitalWrite(bitmask, LOW).

pulse_high and pulse_low

These are the same for all board variants given the CBI+SBI are correct.

#define pulse_high(reg, bitmask) sbi(reg, bitmask); cbi(reg, bitmask);
#define pulse_low(reg, bitmask) cbi(reg, bitmask); sbi(reg, bitmask);

Clear Port and Set Port

Also the same as for all other board variants.

#define cport(port, data) port &= data
#define sport(port, data) port |= data

Swap and fontbyte

The swap macro conflicts with the definition in tuple.h, which is included in the Uno R4's implementation of SPI.h. However, swap doesn't seem to be used anywhere else in this repo, so I did not define it here.

#define fontbyte(x) cfont.font[x]

fontbyte is also not used in this repo but it isn't causing any problems so I left it alone.

Register types

These seem to be the only definitions that are actually used anywhere in this repo

I initially thought that since the Renesas RA4M1 is a 32 bit CPU, the registers would be uint32_t, but that throws an error at compile time suggesting they are uint16_t registers. Using uint16_t compiles without issue.

#define regtype volatile uint16_t
#define regsize uint16_t

This is currently untested!

My camera modules haven't arrived yet. This change was sufficient to compile the examples but I do not know whether it works with the camera yet!

@keeeal keeeal force-pushed the master branch 2 times, most recently from 6e7aa2f to 8b276d3 Compare September 28, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error: 'regtype' does not name a type
1 participant