All Packages  This Package  Class Hierarchy  Class Search  Index

Class kh.hc11.McuLink
java.lang.Object
   |
   +----kh.hc11.McuLink

  Summary

public class  McuLink
     extends java.lang.Object
{
          // Constructors 2
     public McuLink();
     public McuLink(SerialPort) throws IOException;

          // Methods 16
     public void assembleDownload(URL, ProgressMonitor) throws IOException, InterruptedException, AssemblerException;
     public byte[] createCommand(int, int);
     public void disableInterrupts() throws IOException;
     public void download(InputStream, ProgressMonitor) throws IOException, InterruptedException;
     public void enableInterrupts() throws IOException;
     public boolean isConnected();
     public int mask(int, int, int) throws IOException;
     public void postReset() throws IOException;
     public int readByte(int) throws IOException;
     public int readWord(int) throws IOException;
     public void resetMCU() throws IOException;
     public synchronized byte[] sendCommand(byte[]) throws IOException;
     public int sendCommandByteResult(byte[]) throws IOException;
     public int sendCommandWordResult(byte[]) throws IOException;
     public int writeByte(int, int) throws IOException;
     public int writeWord(int, int) throws IOException;
}


  Cross Reference

Extended By:
FlyLink





  Constructors

· McuLink

Summary  |  Top
   public McuLink() 

Opens a link - but doesn't connect to any real hardware - allows me to develop when not connected.



· McuLink

Summary  |  Top
   public McuLink(SerialPort port)  throws IOException


  Methods

· assembleDownload

Summary  |  Top
   public void assembleDownload(URL mcuCode, 
                                ProgressMonitor monitor)  throws IOException, InterruptedException, AssemblerException

Uses special boot mode to download a current copy of the MCU code The provided URL is assumed to be a SOURCE file which should be assembled.



· createCommand

Summary  |  Top
   public byte[] createCommand(int opcode, 
                               int address) 

Creates a command buffer with the command and address already created



· disableInterrupts

Summary  |  Top
   public void disableInterrupts()  throws IOException

Turns off 6811 interrupts



· download

Summary  |  Top
   public void download(InputStream mcuCode, 
                        ProgressMonitor monitor)  throws IOException, InterruptedException

Uses special boot mode to download a current copy of the MCU code The provided stream will be CLOSED after reading. It is assumed that the inputStream contains S19 data - i.e. the input stream is not a raw binary stream



· enableInterrupts

Summary  |  Top
   public void enableInterrupts()  throws IOException

Turns on 6811 interrupts



· isConnected

Summary  |  Top
   public boolean isConnected() 

Returns:
true if we are connected to the MCU


· mask

Summary  |  Top
   public int mask(int address, 
                   int andmask, 
                   int ormask)  throws IOException

Performs and atomic and then or with an address and return the old value



· postReset

Summary  |  Top
   public void postReset()  throws IOException

This method is called after the link is reset. We feed many zeros so that the MCU can init it's serial stuff



· readByte

Summary  |  Top
   public int readByte(int address)  throws IOException

Read a byte value from a specified address



· readWord

Summary  |  Top
   public int readWord(int address)  throws IOException

Read a word value from a specified address



· resetMCU

Summary  |  Top
   public void resetMCU()  throws IOException

Resets the MCU



· sendCommand

Summary  |  Top
   public synchronized byte[] sendCommand(byte[] command)  throws IOException

Send a command buffer and wait for the response - throws an exception if an error is encountered



· sendCommandByteResult

Summary  |  Top
   public int sendCommandByteResult(byte[] command)  throws IOException

A wrapper which assumes we want only a single byte result



· sendCommandWordResult

Summary  |  Top
   public int sendCommandWordResult(byte[] command)  throws IOException

A wrapper which assumes we want only a single word result



· writeByte

Summary  |  Top
   public int writeByte(int address, 
                        int value)  throws IOException

Write a byte value from a specified address and return the old value



· writeWord

Summary  |  Top
   public int writeWord(int address, 
                        int value)  throws IOException

Write a word value from a specified address and return the old value



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7