The remaining 128 bytes of
the HIC memory-mapped region can be used as a general-purpose
buffer. To write to or read from this region:
- The device enables the HIC by writing 0xA to the
HICGCR.HICEN register
- The device configures the availability and polarity of
the HIC pins using the HICMODECR.RW_MODE,
HICMODECR.BEN_PRESENT, HICMODECR.RDY_PRESENT, and
HICPINPOLCR registers
To write data to the
device:
- The
external host writes to the H2D buffer, that is,
H2D_BUF register
- After
completing the write, the external host triggers an
interrupt (H2DINT) to the device by writing a
pattern to the HICH2DTOKEN register. This pattern
can be any value and a useful value to write to the
HICH2DTOKEN register is the number of bytes written
by the external host. Any write to the HICH2DTOKEN
register triggers H2DINT.
- The
device acknowledges this interrupt by transferring
the data from the H2D buffer (H2D_BUF register) to
the required location.
To read data from the
device:
- The
device writes to the D2H buffer, that is, D2H_BUF
register
- After completing the write, the device triggers an
interrupt (D2HINT) to the external host by writing a
pattern to the HICD2HTOKEN register. This pattern
can be any value and a useful value to write to the
HICD2HTOKEN register is the number of bytes written
by the device.
- The external host acknowledges this interrupt by reading
the contents of the D2H buffer (D2H_BUF
register).
Note: An error is not
generated if writes to the D2H_BUF and H2D_BUF exceed the memory
region, that is, 128 bytes. The application needs to make sure
writes to the above regions are appropriately bounded.