2.1.3.2 ROM Commands

All general ROM commands for standard speed communication are implemented.

The simplest ROM command is the SKIP ROM command. It simply calls the SendByte function with the SKIP ROM command byte as argument.

Flowcharts for the READ ROM and MATCH ROM commands are shown in the figure below.

Figure 2-3. Read ROM Flowchart and Match ROM Flowchart

The flowchart for the SEARCH ROM command is shown in the figure below. This function will find one slave device for each time it is run until there are no undiscovered slave devices on the bus. The last time it is run, it will return OWI_ROM_SEARCH_FINISHED. In addition to the ‘pin’ parameter, used to select which bus to perform the search on, two parameters must be passed to this function: ‘lastDeviation’ and ‘bitPattern’. These parameters control the slave device search. Refer to the table below to understand how to use these parameters to complete a full search for all slave devices.

Table 2-2. bitPattern and lastDeviation Usage
BitPatternlastDeviation
First timeZero filled eight byte array0
Consecutive runsA copy of the eight-byte array returned through bitPattern pointer last runValue returned from SearchRom last run

The function is implemented in this way to give the caller maximum flexibility. The example software for the polled driver shows how it can be used to implement the full search.

Figure 2-4. Search ROM Command