Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
Adding Raspberry Pi 5, but board codes are not known yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Delporte committed Sep 28, 2023
1 parent 067188d commit feb2e8e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Raspberry Pi Info :: Utility Library providing information about the Raspberry P

Project website: [pi4j.com](https://pi4j.com/).

This library is continuation of the project started by Frank Delporte
This library is a continuation of the project started by Frank Delporte
on [github.com/FDelporte/PiHeaders](https://github.com/FDelporte/PiHeaders).

### Build and distribute with JReleaser
Expand Down
48 changes: 29 additions & 19 deletions src/main/java/com/pi4j/boardinfo/definition/BoardModel.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.pi4j.boardinfo.definition;

import com.pi4j.boardinfo.util.Markdown;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pi4j.boardinfo.util.Markdown;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
Expand All @@ -18,6 +18,7 @@
* <a href="https://en.wikipedia.org/wiki/Raspberry_Pi#Specifications">en.wikipedia.org/wiki/Raspberry_Pi</a>
* <a href="https://oastic.com/posts/how-to-know-which-raspberry-do-you-have/">oastic.com/posts/how-to-know-which-raspberry-do-you-have</a>
* <a href="https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#new-style-revision-codes-in-use">raspberrypi.com/documentation/computers/raspberry-pi.html#new-style-revision-codes-in-use</a>
* <a href="https://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/">raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/</a>
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BoardModel {
Expand Down Expand Up @@ -122,6 +123,15 @@ public enum BoardModel {
Cpu.CORTEX_A72, 4,
Collections.singletonList(1800),
Collections.singletonList(4096 * 1024)),
MODEL_5_B("Raspberry Pi 5 Model B", SINGLE_BOARD_COMPUTER,
Arrays.asList("??", "??"),
PiModel.MODEL_B,
HeaderVersion.TYPE_3,
LocalDate.of(2023, 9, 28),
Soc.BCM2712,
Cpu.CORTEX_A76, 4,
Collections.singletonList(2400),
Arrays.asList(4096 * 1024, 8192 * 1024)),
COMPUTE_1("Compute Module 1", STACK_ON_COMPUTER,
Collections.singletonList("900061"),
PiModel.COMPUTE,
Expand Down Expand Up @@ -287,6 +297,24 @@ public static BoardModel getByBoardName(String boardName) {
return matches.get(0);
}

public static String toMarkdownTable() {
StringBuilder rt = new StringBuilder();
rt.append(Markdown.toHeaderRow(Arrays.asList("Name", "Label", "Model", "Header version", "Release date", "Soc", "CPU", "#CPU", "Memory GB")));
for (BoardModel boardModel : BoardModel.values()) {
rt.append(Markdown.toValueRow(Arrays.asList(
boardModel.name(),
boardModel.getLabel(),
boardModel.getModel().name(),
boardModel.getHeaderVersion().name(),
boardModel.getReleaseDate().format(DateTimeFormatter.ofPattern("yyyy-MM")),
boardModel.getSoc().name(),
boardModel.getCpu().getLabel(),
String.valueOf(boardModel.getNumberOfCpu()),
String.valueOf(boardModel.getVersionsMemoryInMb()))));
}
return rt.toString();
}

public String getName() {
return name();
}
Expand Down Expand Up @@ -346,22 +374,4 @@ public List<Float> getVersionsMemoryInGb() {
public List<String> getRemarks() {
return remarks;
}

public static String toMarkdownTable() {
StringBuilder rt = new StringBuilder();
rt.append(Markdown.toHeaderRow(Arrays.asList("Name", "Label", "Model", "Header version", "Release date", "Soc", "CPU", "#CPU", "Memory GB")));
for (BoardModel boardModel : BoardModel.values()) {
rt.append(Markdown.toValueRow(Arrays.asList(
boardModel.name(),
boardModel.getLabel(),
boardModel.getModel().name(),
boardModel.getHeaderVersion().name(),
boardModel.getReleaseDate().format(DateTimeFormatter.ofPattern("yyyy-MM")),
boardModel.getSoc().name(),
boardModel.getCpu().getLabel(),
String.valueOf(boardModel.getNumberOfCpu()),
String.valueOf(boardModel.getVersionsMemoryInMb()))));
}
return rt.toString();
}
}
4 changes: 3 additions & 1 deletion src/main/java/com/pi4j/boardinfo/definition/Cpu.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ public enum Cpu {
CORTEX_A53("Cortex-A53"),
CORTEX_A7("Cortex-A7"),
CORTEX_A72("Cortex-A72"),
CORTEX_A76("Cortex-A76"),
CORTEX_MO_PLUS("Cortex-M0+"),
UNKNOWN("Unknown");
UNKNOWN("Unknown"),
;

private final String label;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/pi4j/boardinfo/definition/Soc.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public enum Soc {
BCM2710A1(InstructionSet.ARM_V8),
BCM2711(InstructionSet.ARM_V8),
BCM2711C0(InstructionSet.ARM_V8),
BCM2712(InstructionSet.ARM_V8),
BCM2835(InstructionSet.ARM_V6),
BCM2836(InstructionSet.ARM_V7),
BCM2837(InstructionSet.ARM_V8),
Expand Down

0 comments on commit feb2e8e

Please sign in to comment.