diff options
author | ian <ian@FreeBSD.org> | 2015-08-23 16:17:00 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2015-08-23 16:17:00 +0000 |
commit | 341404d849b10e3bbdf570230b41a2d920e27587 (patch) | |
tree | cbe997d544e85e443c8ba963e7b2d41e19694f49 /share/man/man4/uftdi.4 | |
parent | 403ac3fe2ac5f9025e10e44971d01a8c6ef8d0ae (diff) | |
download | FreeBSD-src-341404d849b10e3bbdf570230b41a2d920e27587.zip FreeBSD-src-341404d849b10e3bbdf570230b41a2d920e27587.tar.gz |
MFC r264394, r286382, r286385, r286389:
Add support to the uftdi driver for reading and writing the serial eeprom
that can be attached to the chips, via ioctl() calls.
Return the current ftdi bitbang mode with the UFTDIIOC_GET_BITMODE ioctl.
Document the recently added get-bitmode and eeprom read/write functionality.
Diffstat (limited to 'share/man/man4/uftdi.4')
-rw-r--r-- | share/man/man4/uftdi.4 | 71 |
1 files changed, 64 insertions, 7 deletions
diff --git a/share/man/man4/uftdi.4 b/share/man/man4/uftdi.4 index 05bc18a..687d443 100644 --- a/share/man/man4/uftdi.4 +++ b/share/man/man4/uftdi.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 31, 2014 +.Dd August 6, 2015 .Dt UFTDI 4 .Os .Sh NAME @@ -110,6 +110,11 @@ The must be one of the .Va uftdi_bitmodes values. +Setting +.Va mode +to +.Dv UFTDI_BITMODE_NONE +returns the channel to standard UART mode. .Bd -literal enum uftdi_bitmodes { @@ -136,20 +141,23 @@ the desired mode, then you .Xr read 2 and .Xr write 2 -data which either reflects pin state or is interpreted +data which either reflects pin state or is interpreted as MPSSE commands and parameters, depending on the mode. .It Dv UFTDIIOC_GET_BITMODE Pq Vt "struct uftdi_bitmode" -Return the state of the bitbang pins at the time of the call in the +Return the current bitbang mode in the +.Va mode +member, and the state of the DBUS0..DBUS7 pins at the time +of the call in the .Va iomask member. -The -.Va mode -member is unused. +The pin state can be read while the chip is in any mode, including +.Dv UFTDI_BITMODE_NONE +(UART) mode. .It Dv UFTDIIOC_SET_ERROR_CHAR Pq Vt int Set the character which is inserted into the buffer to mark the point of an error such as FIFO overflow. .It Dv UFTDIIOC_SET_EVENT_CHAR Pq Vt int -Set the character which causes a partial FIFO full of data +Set the character which causes a partial FIFO full of data to be returned immediately even if the FIFO is not full. .It Dv UFTDIIOC_SET_LATENCY Pq Vt int Set the amount of time to wait for a full FIFO, @@ -164,6 +172,55 @@ This is the .Va bcdDevice value from the .Va usb_device_descriptor . +.It Dv UFTDIIOC_READ_EEPROM Pq Vt "struct uftdi_eeio" +Read one or more words from the configuration eeprom. +The FTDI chip performs eeprom I/O in 16-bit words. +Set +.Va offset +and +.Va length +to values evenly divisible by two before the call, and the +.Va data +array will contain the requested values from eeprom after the call. +.Bd -literal +struct uftdi_eeio +{ + uint16_t offset; + uint16_t length; + uint16_t data[64]; +}; +.Ed +.Pp +The FT232R chip has an internal eeprom. +An external serial eeprom is optional on other FTDI chips. +The eeprom may contain 64, 128, or 256 words, +depending on the part used. +Multiple calls may be needed to read or write the larger parts. +When no eeprom is present, all words in the returned data are 0xffff. +An erased eeprom also reads as all 0xffff. +.It Dv UFTDIIOC_WRITE_EEPROM Pq Vt "struct uftdi_eeio" +Write one or more words to the configuration eeprom. +The +.Va uftdi_eeio +values are as described for +.Dv UFTDIIOC_READ_EEPROM . +.Pp +The FTDI chip does a blind write to the eeprom, and it will appear +to succeed even when no eeprom is present. +To ensure a good write you must read back and verify the data. +It is +.Em not +necessary to erase before writing. +Any position within the eeprom can be overwritten at any time. +.It Dv UFTDIIOC_ERASE_EEPROM Pq Vt int +Erase the entire eeprom. +This is useful primarily for test and debugging, as there is no +need to erase before writing. +To help prevent accidental erasure caused by calling the wrong +ioctl, you must pass the special value +.Dv UFTDI_CONFIRM_ERASE +as the argument to this ioctl. +.El .Sh HARDWARE The .Nm |