• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SpiNNakerManchester / JavaSpiNNaker / 6233274834

19 Sep 2023 08:46AM UTC coverage: 36.409% (-0.6%) from 36.982%
6233274834

Pull #658

github

dkfellows
Merge branch 'master' into java-17
Pull Request #658: Update Java version to 17

1656 of 1656 new or added lines in 260 files covered. (100.0%)

8373 of 22997 relevant lines covered (36.41%)

0.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/SpiNNaker-comms/src/main/java/uk/ac/manchester/spinnaker/messages/model/SerialVector.java
1
/*
2
 * Copyright (c) 2022 The University of Manchester
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package uk.ac.manchester.spinnaker.messages.model;
17

18
import java.nio.IntBuffer;
19

20
import uk.ac.manchester.spinnaker.machine.MemoryLocation;
21
import uk.ac.manchester.spinnaker.messages.bmp.ReadADC;
22
import uk.ac.manchester.spinnaker.messages.bmp.ReadSerialVector;
23

24
/**
25
 * The data in the BMP serial vector.
26
 * <p>
27
 * See {@code cmd_bmp_info()} in {@code bmp_cmd.c}.
28
 *
29
 * @param hardwareVersion
30
 *            Hardware version.
31
 * @param serialNumber
32
 *            LPC1768 serial number. Length {@value #SERIAL_LENGTH}.
33
 * @param flashBuffer
34
 *            Flash buffer address.
35
 * @param boardStat
36
 *            {@code board_stat} address for the board. See {@link ReadADC} for
37
 *            an operation that reads this.
38
 * @param cortexBoot
39
 *            Cortex boot vector address. Can be used to determine which copy of
40
 *            the BMP code was successfully booted from.
41
 * @see ReadSerialVector
42
 */
43
public record SerialVector(int hardwareVersion, IntBuffer serialNumber,
×
44
                MemoryLocation flashBuffer, MemoryLocation boardStat,
45
                MemoryLocation cortexBoot) {
46
        /** The number of words in the {@link #serialNumber() serial_number}. */
47
        public static final int SERIAL_LENGTH = 4;
48

49
        /**
50
         * @return The device serial number, as a read-only buffer. Length
51
         *         {@value #SERIAL_LENGTH}.
52
         */
53
        // @formatter:off
54
        /* Obtained from LPC17xx In Application Programming function 58. The API
55
         * descriptions for these things are fairly well buried in the LPC17xx User
56
         * Manual. This is the relevant part:
57
         *
58
         * Command      Read device serial number
59
         * Input        Command code: 58<sub>10</sub>
60
         *              Parameters:   None
61
         * Return Code  CMD_SUCCESS |
62
         * Result       Result0: First 32-bit word of Device Identification Number
63
         *                       (at the lowest address)
64
         *              Result1: Second 32-bit word of Device Identification Number
65
         *              Result2: Third 32-bit word of Device Identification Number
66
         *              Result3: Fourth 32-bit word of Device Identification Number
67
         * Description  This command is used to read the device identification
68
         *              number. The serial number may be used to uniquely identify
69
         *              a single unit among all LPC17xx devices.
70
         *
71
         * The four words of the result form the four words provided below, in the
72
         * order described above (not that that typically matters). */
73
        // @formatter:on
74
        public IntBuffer serialNumber() {
75
                // Make a new instance so positions aren't shared
76
                return serialNumber.asReadOnlyBuffer();
×
77
        }
78
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc