Connecting device
By designing a connection device that includes a transmission end, a memory and a controller, and using lookup tables and instructions for configuration settings, the compatibility problem when the host device communicates with electronic devices of different transmission formats is solved, and a variety of transmission formats are realized. Integration and compatibility improvements.
Patent Information
- Application Number
- CN202110900156.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-06
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-08-06
AI Technical Summary
In the existing technology, when a host device communicates with an electronic device of different transmission formats, it needs to set up different hardware and communication instructions according to the transmission format, resulting in increased communication burden and difficulty in achieving compatibility with multiple transmission formats.
Design a connection device that includes multiple transmission terminals, memories and controllers. Through lookup tables and configuration instructions or transmission instructions, communication between the host device and electronic devices with multiple different transmission formats is realized. The controller is used according to the The index value and selection information select the appropriate transmission end for configuration setting and communication.
The device can effectively integrate the host device with a variety of electronic devices of different transmission formats, improve the compatibility of the host device, realize a single connector to connect electronic devices of different transmission formats, simplify the communication process, and reduce the communication burden.
Smart Images

Figure CN114116562B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a device, and more particularly to a connecting device. Background Art
[0002] In the prior art, if a host-side device wants to perform communication operations such as writing or reading with electronic devices of different transmission formats, in addition to the need to set up a transmission end in hardware, the host-side device must also adaptively provide corresponding communication instructions based on the different transmission formats of the electronic devices. This places a communication burden on the host-side device. Summary of the invention
[0003] The invention provides a connection device for integrating a host end device to connect to a plurality of electronic devices of different transmission formats.
[0004] A connection device of the present invention is suitable for connecting between an electronic device and a host-end device. The host-end device generates a configuration instruction for communication based on a host-end lookup table stored therein. The connection device includes multiple transmission ends, a memory, and a controller. The transmission end is suitable for connecting to; the memory stores a lookup table, the lookup table records multiple transmission format numbers, and the transmission format numbers correspond to the transmission formats respectively; the controller is electrically connected to the transmission end and the memory. When at least one of the transmission ends among the multiple transmission ends is connected to the host end and the electronic device, the controller receives a configuration instruction from the host-end device. The configuration instruction includes a first field and a second field. The first field records the transmission format index value, and the second field records the selection information. The controller searches the lookup table based on the transmission format index value to obtain the connection transmission format from the transmission format. The controller selects at least one of the corresponding transmission ends from the transmission end based on the selection information. The controller configures the electronic device through the connection transmission format.
[0005] A connection device of the present invention is suitable for connecting between an electronic device and a host-end device. The host-end device generates at least one transmission instruction for communication based on the host-end lookup table stored therein. The connection device includes multiple transmission terminals, a memory, and a controller. The transmission terminal is suitable for connecting to the electronic device. The memory stores a lookup table, which records multiple transmission numbers and multiple transmission functions, and the transmission numbers correspond to the transmission functions respectively. The controller is electrically connected to the transmission terminal and the memory. When at least one of the multiple transmission terminals connects the host end and the electronic device, the controller receives the transmission instruction from the host end device to communicate with the electronic device. The transmission instruction includes a header field and a first field. The header field records the transmission index value. The first field records the transmission information. The controller queries the lookup table based on the transmission index value to obtain the connection transmission function from the transmission function. The controller communicates with the electronic device through the connection transmission function based on the content of the transmission information.
[0006] Based on the above, the connecting device can effectively integrate the connection between the host device and electronic devices with multiple different transmission formats. A single connector can be used to connect electronic devices with different transmission formats, effectively integrating multiple different transmission formats when communicating between the host device and the electronic devices, thereby improving the compatibility of the host device. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 Schematic diagram of a connecting device according to an embodiment of the present invention.
[0008] Figure 2A Schematic diagram of a configuration instruction received by a connecting device according to an embodiment of the present invention.
[0009] Figure 2B Schematic diagram of a configuration instruction received by a connecting device according to an embodiment of the present invention.
[0010] Figure 2C Schematic diagram of a configuration instruction received by a connecting device according to an embodiment of the present invention.
[0011] Figure 3A It is a schematic diagram of a transmission instruction received by a connecting device according to an embodiment of the present invention.
[0012] Figure 3B It is a schematic diagram of a transmission instruction received by a connecting device according to an embodiment of the present invention.
[0013] Figure 3C It is a schematic diagram of a transmission instruction received by a connecting device according to an embodiment of the present invention.
[0014] The reference numerals are described as follows:
[0015] 1: Connecting device
[0016] 10: Controller
[0017] 11-1 to 11-n: Transmission end
[0018] 12: Memory
[0019] 2: Host device
[0020] 3: Electronic devices
[0021] ADC_R, GPIO_R, GPIO_W, I2C_R, I2C_W, PWM_R, SPI_R, SPI_W: Transfer index value
[0022] DR: Duty cycle value
[0023] En_In: Enable index value
[0024] En_PWM: Output enable index value
[0025] F_I2C, F_PWM, F_SPI: operating frequency value
[0026] HWID: Hardware address information
[0027] I2C_RL: read length value
[0028] I2C_Wr1, I2C_Wr2: data to be written
[0029] In_Con: Configuration index value
[0030] In_GPIO, In_I2C, In_ADC, In_ADC, In_PWM, In_SPI: transmission format index value
[0031] L11, L21~L27: instruction length value
[0032] Rd_Addr: read address
[0033] S_GPIO, S_I2C, S_ADC, S_PWM, S_SPI: connection index value
[0034] Set_GPIO: Setting information
[0035] Set_PWM: Transmit setting data
[0036] Set_SPI: Transmit setting information
[0037] SPI_RL: Read length value
[0038] SUM11~SUM15, SUM21~SUM28: total value
[0039] SV: Signature Value
[0040] SPI_Wr1: write information
[0041] Wr_In: Write index value
[0042] Wr_Addr: write address DETAILED DESCRIPTION
[0043] Figure 11 is a schematic diagram of a connection device 1 according to an embodiment of the present invention. The connection device 1 includes a controller 10, a plurality of transmission terminals 11-1 to 11-n, and a memory 12. The connection device 1 is connected between a host device 2 and an electronic device 3. One transmission terminal 11-2 among the transmission terminals 11-1 to 11-n of the connection device 1 is connected to the electronic device 3. In general, the connection device 1 connects the host device 2 to the electronic device 3. In this way, the host device 2 may have different operating systems, and the electronic device 3 may have different transmission specifications. The connection device 1 may integrate the host device 2 and the electronic device 3 from different operating systems to communicate. In one embodiment, corresponding to the transmission specification of the electronic device 3, the connection device 1 may selectively connect to the electronic device 3 with the transmission terminal 11-2 among the transmission terminals 11-1 to 11-n, so that the host device 2 is connected to the electronic device 3 through the connection device 1. Further, in order to communicate with the electronic device 3 with different transmission specifications, the controller 10 of the connection device 1 may receive instructions from the host device 2 to communicate with the electronic device 3. Although Figure 1 The main device 2 and the connecting device 1 shown in the figure are configured as separate structures, but the main device 2 and the connecting device 1 can also be integrated into a single structure, which also belongs to the scope of the present invention.
[0044] The connection device 1 can be connected to the host device 2 and the electronic device 3 to enable the host device 2 and the electronic device 3 to communicate. The connection device 1 can include but is not limited to, for example, a Universal Serial Bus (USB) hub, as long as the connection device 1 can be connected between the host device and the electronic device and provide a connection transmission function between the two.
[0045] The controller 10 of the connection device 1 can receive at least one configuration instruction from the host device 2 to configure the electronic device 3, and then receive the transmission instruction from the host device 2 to communicate with the electronic device 3. In detail, the configuration instruction provided by the host device 2 can correspond to a specific connection transmission format, and the controller 10 can read the configuration instruction to configure the electronic device 3 of the connection transmission format, such as enabling, disabling or other functions. Then, after the configuration setting is completed, the host device 2 can provide a transmission instruction to a specific transmission end (such as the transmission end 11-2), and the connection device 1 can read the transmission instruction to perform communication such as writing or reading on the electronic device 3 connected to the transmission end. According to different design requirements, the number of transmission ends connected to the electronic device 3 can be adaptively increased, so that the electronic device 3 can be connected to the host device 2 through at least one transmission end of the connection device 1. Therefore, the connection device 1 can be connected between the host device 2 and the electronic device 3, so that the host device 2 can communicate with the electronic device 3 of different transmission specifications, thereby improving the hardware compatibility between different transmission specifications. Furthermore, the host device 2 may provide a signal to the connection device 1 via a Human Interface Device (HID) transmission protocol of the Universal Serial Bus, so as to provide a signal packet conforming to the transmission protocol to the connection device 1 to communicate with the electronic device 3 .
[0046] The controller 10 may be a hardware circuit designed by a hardware description language (HDL) or any other digital circuit design method known to those skilled in the art, and implemented by a field programmable gate array (FPGA), a complex programmable logic device (CPLD), or an application-specific integrated circuit (ASIC). Alternatively, the controller 10 may include a central processing unit (CPU), or other programmable general-purpose or special-purpose micro control unit (MCU), a microprocessor (microprocessor), a digital signal processor (DSP), a programmable controller, an application-specific integrated circuit (ASIC), a graphics processing unit (GPU), an arithmetic logic unit (ALU), a complex programmable logic device (CPLD), a field programmable gate array (FPGA), or other similar components or a combination of the above components.
[0047] The transmission specifications of the transmission terminals 11-1 to 11-n may include, but are not limited to, general-purpose input / output (GPIO) format, inter-integrated circuit (IC) bus (ICB) format, and the like. 2 C) format, pulse width modulation (PWM) format, serial peripheral bus (SPI) format and analog to digital converter (ADC) format. Therefore, the connecting device 1 can be connected to electronic devices 3 with different transmission specifications through the transmission terminals 11-1 to 11-n.
[0048] The memory 12 stores a lookup table, in which a plurality of transmission format numbers and a plurality of transmission formats may be stored, and the transmission format numbers correspond to the transmission formats respectively. The controller 10 may query the lookup table according to the transmission format index value included in the configuration instruction, that is, the controller 10 may select the transmission format number that matches the transmission format index value by comparing the transmission format index value with the transmission format number, and select the corresponding transmission format from the transmission format as the connection transmission format according to the matching transmission format number. The memory 12 may include but is not limited to, for example, any type of fixed or removable random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), flash memory (Flash Memory), hard disk drive (Hard Disk Drive, HDD), solid state drive (Solid State Drive, SSD) or similar elements or a combination of the above elements.
[0049] The host device 2 may include, but is not limited to, a mobile station, an advanced mobile station (AMS), a server, a client, a desktop computer, a laptop computer, a network computer, a workstation, a personal digital assistant (PDA), a personal computer (PC), a tablet computer, a scanner, a telephone device, a pager, a camera, a television, a handheld game console, a music device, or a wireless sensor, etc. In one embodiment, in order to provide configuration instructions and / or transmit instructions to the electronic device 3 to be communicated, the host device 2 may also store a corresponding host lookup table, so that the host device 3 can better provide configuration instructions and / or transmit instructions to the connection device 1.
[0050] For the configuration instructions received by the connection device 1, please refer to Figure 2A , Figure 2A Schematic diagram of a configuration instruction received by a connection device 1 according to an embodiment of the present invention. The configuration instruction includes a header field, a first field, and a second field. The header field may record a configuration index value of the configuration instruction, and the controller 10 may read the configuration index value of the header field to identify the received instruction as a configuration instruction, and read the information in the subsequent first field. The first field may record a transmission format index value, and the controller 10 may determine the format of the overall configuration instruction based on the transmission format index value. In other words, the controller 10 may compare the transmission format index value with the transmission format number stored in the memory to select the connection transmission format, and then determine the connection transmission format corresponding to the configuration instruction and the packet structure of the configuration instruction, so as to read the information in the subsequent second field in the configuration instruction.
[0051] The second column may record selection information, and the controller 10 may select one or more transmission ends according to the selection information to perform configuration settings for one or more connected electronic devices 3. Figure 1 The connecting device 1 is only shown as being connected to one electronic device 3, but the present invention is not limited thereto. The connecting device 1 can of course be connected to multiple electronic devices 3 simultaneously through the corresponding transmission ends 11-1~11-n, and configure and communicate with one or more connected electronic devices 3 according to the configuration instructions provided by the host device 2.
[0052] For details, please refer to Figure 2B , Figure 2B Schematic diagram of a configuration instruction received by a connection device 1 according to another embodiment of the present invention. In this embodiment, the configuration instruction may include, in addition to the header field, the first field and the second field, an instruction length field, a signature field and a sum check field. The contents recorded in the header field, the first field and the second field can be referred to the above-mentioned related sections, which will not be repeated here. In detail, the instruction length field can record the instruction length value, so that the controller 10 can obtain the length of the configuration instruction accordingly. The signature field can record the signature value, and the controller 10 verifies the host device 2 that sends the configuration instruction according to the signature value. The sum check field records the sum value, which can be the sum value generated by adding up all the data in the configuration instruction. The controller 10 can perform operations such as checking and debugging on the received configuration instruction according to the sum value.
[0053] For further information, please refer to Figure 2C , Figure 2C It is a schematic diagram of a configuration instruction received by a connecting device 1 according to another embodiment of the present invention. Figure 2C The packet formats of configuration instructions provided by the host-side device 2 for different transmission specifications are exemplarily listed. In the present embodiment, the host-side device 2 may provide configuration instructions for different connection transmission formats such as GPIO format, I2C format, ADC format, PWM format, SPI format, etc. Configuration instructions of different transmission specifications may have the same configuration index value In_Con. Therefore, the controller 10 may identify the received instruction as a configuration instruction based on the configuration index value In_Con. For example, the configuration index value In_Con may be 0x43 and have a length of one byte. Configuration instructions of different transmission specifications may also have the same instruction length value L11, so that the lengths of configuration instructions of different transmission specifications may be unified, which is convenient for the controller 10 to read. For example, the instruction length value L11 may record the length of the configuration instruction as 22 bytes, and the instruction length value L11 itself has a length of one byte.
[0054] In the first field, different connection transmission formats may correspond to different transmission format index values. The controller 10 may determine the detailed packet format of the configuration instruction accordingly. For example, the transmission format index value In_GPIO may be 0x47; the transmission format index value In_I2C may be 0x69; the transmission format index value In_PWM may be 0x50; the transmission format index value In_SPI may be 0x03, and the transmission format index value In_GPIO, the transmission format index value In_I2C, the transmission format index value In_PWM, and the transmission format index value In_SPI may have the same length of four bytes. The controller 10 may query the lookup table according to the transmission format index value to determine the connection transmission format corresponding to the configuration instruction.
[0055] In the second field, corresponding configuration setting information may be included according to different transmission specifications. For example, when the configuration instruction is to perform configuration settings for the GPIO format, the selection information may include a connection index value S_GPIO and a setting information Set_GPIO. The controller 10 may transmit an enable or disable signal to the thirteen GPIO transmission terminals among the output terminals 11-1 to 11-n according to the connection index value S_GPIO. The controller 10 also sets the electronic devices connected to the thirteen GPIO transmission terminals to an input state or an output state according to the setting information Set_GPIO. In this example, the connection index value S_GPIO may have a length of four bytes, the first thirteen bits of which may correspond to different GPIO transmission terminals respectively, and the controller 10 may enable or disable each GPIO transmission terminal according to the connection index value S_GPIO. The setting information Set_GPIO may have a length of 4 bytes, wherein the first 13 bits may correspond to different GPIO transmission ends respectively. The controller 10 may set the electronic devices connected to the GPIO transmission ends to input state or output state respectively according to the setting information Set_GPIO.
[0056] When the configuration command is for configuring the I2C format, the selection information may include a connection index value S_I2C, hardware address information HWID, and an operating frequency value F_I2C. The controller 10 may select one of the two I2C transmission ends connected to the electronic device 3 from the output ends 11-1 to 11-n according to the connection index value S_I2C. The controller 10 may connect to a storage device (e.g., a physical address of an electronically erasable rewritable read-only memory) of the electronic device 3 according to the hardware address information HWID to read or write to the storage device. The controller 10 may set the frequency for communicating in the I2C format according to the operating frequency value F_I2C. In this example, the hardware address information HWID and the connection index value S_I2C may have a total length of four bytes, wherein the first eight bits may record the hardware address information HWID, and the seventeenth and eighteenth bits may record the connection index value S_I2C. In addition, the operating frequency value F_I2C may have a length of 4 bytes, and the operating frequency value F_I2C may record a value between 0 and 0x190 to correspondingly represent an operating frequency value between 0 and 400 kHz.
[0057] When the configuration command is for configuring the ADC format, the selection information may include a connection index value S_ADC and blank data (i.e., data 0x00000000 of four-byte length), and the controller 10 may select one of the eight ADC transmission terminals in the output terminals 11-1 to 11-n according to the connection index value S_ADC. In this example, the connection index value S_I2C may have a length of four bytes, and the first eight bits thereof may correspond to the respective ADC transmission terminals.
[0058] When the configuration command is for configuring the PWM format, the selection information may include a connection index value S_PWM, a duty cycle value DR, and an operating frequency value F_PWM. The controller 10 may select one of the four PWM transmission terminals in the output terminals 11-1 to 11-n according to the connection index value S_PWM. In this example, the duty cycle value DR and the connection index value S_PWM may have a total length of four bytes, wherein the first seven bits may record values between 0 and 0x64 to correspondingly represent a duty cycle of 0% to 100%, and the seventeenth bit to the twentieth bit may respectively correspond to the four PWM transmission terminals, so that the controller 10 may select one of the transmission terminals accordingly. The operating frequency value F_PWM may have a length of four bytes, and may record values between 0x0000000A to 0x000F4240 to correspondingly represent an operating frequency between 10 and 1 MHz.
[0059] When the configuration command is for the SPI format, the selection information may include a connection index value S_SPI, a transmission setting information Set_SPI, and an operating frequency value F_SPI. The controller 10 may select one of the two SPI transmission ends from the output ends 11-1 to 11-n according to the connection index value S_SPI. The controller 10 may determine the transmission trigger mode, signal width (Data Width), master-slave setting, and other information according to the transmission setting information Set_SPI. In this example, the connection index value S_SPI and the transmission setting information Set_SPI may have a total length of four bytes, wherein the first two bits may record the trigger mode of the PWM format, the tenth to fifteenth bits may record values between 0 and 0x20, corresponding to signal widths of 0 to 32 bits respectively, the sixteenth bit may record the master-slave setting information, and the seventeenth to eighteenth bits may record the selection information corresponding to the two SPI transmission ends respectively. The operating frequency value F_SPI may have a length of 4 bytes and may record a value between 0 and 0x044AA200 to correspondingly represent an operating frequency between 0 and 72 MHz.
[0060] In the signature field, configuration commands of different connection transmission formats may have the same signature value SV, so that the controller 10 can read the signature value for verification. For example, the signature value SV may have a length of four bytes and may be 0x61676550. In the sum check field, four-byte sum values SUM11-SUM15 may be recorded, and the sum values SUM11-SUM15 respectively record the sum of the data of each configuration command after adding them up, so that the controller 10 can perform operations such as checking and debugging each configuration command according to the sum values SUM11-SUM15.
[0061] Therefore, the connection device 1 can receive the configuration command of the unified format provided by the host device 2, so as to configure the electronic device 3 according to the control of the host device 2. In other words, the host device 2 can use the configuration command of the single signal format to configure the electronic devices with different connection transmission formats through the connection device 1, effectively integrating a variety of different connection transmission formats when the host device 2 and the electronic device 3 communicate, thereby improving the compatibility of the host device 2.
[0062] Figure 3AIt is a schematic diagram of a transmission instruction received by a connecting device 1 according to an embodiment of the present invention. In one embodiment, after providing the configuration instruction, the host-side device 2 may then provide a transmission instruction to the connecting device 1 to perform read, write or other communication operations on the electronic device 3. In another embodiment, the host-side device 2 may directly provide a transmission instruction to the connecting device 1 to perform read, write or other communication operations on the electronic device 3. In detail, the transmission instruction includes a header field and a third field. The header field records a transmission index value, and the third field records transmission information. The controller 10 can query the lookup table based on the transmission index value to obtain the transmission instruction format to determine the packet format of the transmission instruction and the connection transmission function that the host-side device 2 intends to perform.
[0063] Furthermore, a plurality of transmission numbers and a plurality of transmission functions may be stored in the lookup table of the memory 12 of the connection device 1, and the transmission numbers correspond to the transmission functions respectively. The controller 10 may compare the transmission numbers in the lookup table by comparing the transmission index value to select the transmission number that matches the transmission index value, and select the corresponding transmission function from the transmission functions as the connection transmission function according to the matching transmission number.
[0064] In detail, Figure 3B Schematic diagram of a transmission instruction received by a connection device 1 according to an embodiment of the present invention. The transmission instruction may include a header field, an instruction length field, a third field, a signature field, and a sum check field. The header field records a transmission index value; the instruction length field records an instruction length value; the third field records transmission information; the signature field records a signature value; and the sum check field records a sum value. For the contents recorded in the header field, the instruction length field, the signature field, and the sum check field, please refer to the above description of the transmission instruction. Figure 2A to Figure 2C The descriptions about the header field, the instruction length field, the signature field and the sum check field are not repeated here.
[0065] Figure 3C It is a schematic diagram of a transmission instruction received by a connecting device 1 according to an embodiment of the present invention.
[0066] In the header field, each transmission instruction records a transmission index value, so that the controller 10 of the connection device 1 can identify the packet format and function corresponding to each transmission instruction. For example, when the header field records the transmission index value GPIO_W, I2C_W or SPI_W, the transmission instruction is respectively for the electronic device 3 connected to the GPIO, I2C or SPI transmission end to perform a write operation; when the header field records the transmission index value GPIO_R, I2C_R, ADC_R, PWM_R, SPI_R, the transmission instruction is respectively for the electronic device 3 connected to the GPIO, I2C, ADC, PWM or SPI transmission end to perform a read operation. For example, the transmission index values GPIO_W, GPIO_R, I2C_W, I2C_R, ADC_R, PWM_R, SPI_W, SPI_R can be 0x47, 0x48, 0x41, 0x69, 0x6A, 0x50, 0x03, 0x04, and all have a length of 1 byte. In addition, the transmission index values I2C_W, I2C_R, SPI_W and SPI_R may also be 0x6B, 0x6C, 0x05 and 0x06 respectively, so that the host device 2 can perform read or write operations on the electronic device 3 connected to the I2C or SPI transmission end.
[0067] In the command length field, the transmission instructions corresponding to the GPIO format for read and write operations may record the same command length value L21, and the transmission instruction in the GPIO format may be 22 bytes in length. Other instructions corresponding to the I2C format, ADC format, PWM format, and SPI format may have different command length values L22-L27, respectively, and all the command length values L21-L27 in the command length field may have a length of one bit.
[0068] In the third field, when the transmission instruction is to perform a write operation on the electronic device 3 connected to the GPIO transmission terminal, the third field may record an enable index value En_In or a write index value Wr_In. The enable index value En_In may have a length of four bytes, and the first thirteen bits correspond to the thirteen GPIO transmission terminals to indicate their enablement or disablement. The write index value Wr_In may have a length of four bytes, and the first thirteen bits correspond to the thirteen GPIO transmission terminals to indicate the GPIO transmission terminal for the write operation.
[0069] When the transmission instruction is to perform a read operation on the electronic device 3 connected to the GPIO transmission end, the third field may only record blank data, and the controller 10 of the connecting device 1 will perform a read operation on all electronic devices 3 connected to the GPIO transmission end, so that the host device 2 reads all electronic devices 3 in GPIO format.
[0070] When the transmission instruction is to perform a write operation on the electronic device 3 connected to the I2C transmission end, the third field can record the data to be written I2C_Wr1, and the data length can be changed according to the length of the written data I2C_Wr1.
[0071] When the transmission instruction is to perform a read operation on the electronic device 3 connected to the I2C transmission end, the third field may record the data to be written I2C_Wr2 or the read length value I2C_RL. Similarly, the data length of the data to be written I2C_Wr2 may vary according to the data to be written, and the read length value I2C_RL may have a length of one byte. For example, the data to be written I2C_Wr1 and the read length value I2C_RL may have a total length of N bytes, the first N-1 bytes are the data to be written I2C_Wr2, which may record the data to be written, and the last byte is the read length value I2C_RL, whose value may be between 0x01 and 0x36, to indicate that the data length of the data to be written I2C_Wr2 is 1 to 54.
[0072] When the transmission command is for performing a read operation on the electronic device 3 connected to the ADC transmission end, the third field may only record blank data having a length of 12 bytes, so that the electronic device 3 returns the converted data according to the transmission command.
[0073] When the transmission instruction is for performing a read operation on the electronic device 3 connected to the PWM transmission terminal, the third column may record the output enable index value En_PWM and the transmission setting data Set_PWM. The output enable index value En_PWM may have a length of four bytes, and its first bit may record the information of output enablement or output disablement for the electronic device 3. The transmission setting data Set_PWM may have a length of four bytes, and the first seven bits may record the setting value of the duty cycle, and its value may be between 0 and 0x64 to represent a duty cycle of 0 to 100% respectively. The seventeenth bit to the twentieth bit respectively store the enable or disable information of the four PWM transmission terminals.
[0074] When the transmission instruction is to perform a write operation on the electronic device 3 connected to the SPI transmission end, the third field may record the write address Wr_Addr or the write information SPI_Wr1. The write address Wr_Addr may have a length of four bytes, the first byte of which is the instruction code in the SPI format, and the second byte to the fourth byte record the twenty-four-bit address information. The write information SPI_Wr1 may record the data that the host device 2 wants to write, and the data length may vary according to the requirements.
[0075] When the transmission instruction is to perform a read operation on the electronic device 3 connected to the SPI transmission end, the third field may record the read address Rd_Addr or the read length value SPI_RL. The read address Rd_Addr may have a length of four bytes, and the read length value SPI_RL may have a length of one byte. The first byte of the read address Rd_Addr may be an instruction code in the SPI format, and the second byte to the fourth byte record the twenty-four-bit address information. The read address Rd_Addr may record the length value of the data that the host device 2 wants to read.
[0076] In the signature field, configuration commands of different connection transmission formats may have the same signature value SV, so that the controller 10 can read the signature value for verification. For example, the signature value SV may have a length of four bytes and may be 0x61676550. In the sum check field, four-byte sum values SUM21-SUM28 may be recorded, and the sum values SUM21-SUM28 respectively record the sum of the bit values of each configuration command, so that the controller 10 can perform operations such as checking and debugging based on this.
[0077] Furthermore, when the electronic device 3 receives the transmission instruction of the read operation, the electronic device 3 may transmit the data requested by the host device 2 back to the connection device 1 according to the transmission instruction.
[0078] For example, when the electronic device 3 receives a transmission instruction with a transmission index value GPIO_R, the electronic device 3 may return a return instruction with the same format. The return instruction may have a header field, an instruction length field, a third field, a signature field, and a sum check field. The header field may record the transmission index value GPIO_R with a length of one byte. The instruction length field may record the instruction length value L21 with a length of one byte. The third field may record the enable status value with a length of four bytes, record the write status value with a length of four bytes, and record the blank data with a length of four bytes. The first thirteen bits of the enable status value recorded with a length of four bytes may correspond to the thirteen GPIO transmission terminals respectively, so as to respectively record whether the electronic device connected to each GPIO transmission terminal is enabled. The first thirteen bits of the write status value recorded with a length of four bytes may correspond to the thirteen GPIO transmission terminals respectively, so as to respectively record whether the electronic device connected to each GPIO transmission terminal is set to an input state or an output state. The signature field may record the signature value SV with a length of four bytes. The sum check field can be summed up according to the data of the return command to record the sum value corresponding to the return command.
[0079] For example, when the electronic device 3 receives a transmission instruction with a transmission index value I2C_W, the electronic device 3 may provide a return instruction accordingly. The return instruction may have a header field, an instruction length field, a third field, a signature field, and a sum check field. The header field may record the transmission index value I2C_W with a length of one byte. The instruction length field may record the instruction length value L22 with a length of one byte. The third field may record the I2C write information with a length of four bytes, and record the blank data with a length of eight bytes. The four-byte I2C write information may correspond to the written write data length value of the transmission instruction, and its value may be between 1 and 54. The signature field may record the signature value SV with four bytes. The sum check field may be summed up according to the data of the return instruction to record the sum value corresponding to the return instruction.
[0080] For example, when the electronic device 3 receives a transmission instruction with a transmission index value I2C_R, the electronic device 3 can provide a return instruction accordingly. The return instruction can have a header field, an instruction length field, a third field, a signature field, and a sum check field. The header field can record the transmission index value GPIO_R with a length of one byte. The instruction length field can record the instruction length value with a length of one byte, and the instruction length value can correspond to the read length value I2C_RL. The third field can record the read data, and the length of the read data can be adjusted according to the read length value I2C_RL in the transmission instruction provided by the host device 2. The signature field can record the signature value SV in four bytes. The sum check field can be summed up according to the data of the return instruction to record the sum value corresponding to the return instruction.
[0081] For example, when the electronic device 3 receives a transmission instruction with a transmission index value ADC_R, the electronic device 3 can provide a return instruction accordingly. The return instruction can have a header field, an instruction length field, a third field, a signature field, and a sum check field. The header field can record the transmission index value ADC_R with a length of one byte. The instruction length field can record the instruction length value with a length of one byte. The third field can record multiple ADC read data, each ADC read data has a length of four bytes. The first ten bits of each ADC read data record the converted data, and the seventeenth bit to the twenty-fourth bit of each ADC read data corresponds to eight ADC transmission ends. The signature field can record the signature value SV in four bytes. The sum check field can be summed up according to the data of the return instruction to record the sum value corresponding to the return instruction.
[0082] For example, when the electronic device 3 receives a transmission instruction with a transmission index value SPI_R, the electronic device 3 can provide a return instruction accordingly. The return instruction can have a header field, an instruction length field, a third field, a signature field, and a sum check field. The header field can record the transmission index value SPI_R with a length of one byte. The value of the transmission index value SPI_R can be, for example, 0x04 or 0x06 to correspond to the read SPI transmission end. The instruction length field can record the instruction length value with a length of one byte. The third field can record the read data, and the byte length of the read data can be adjusted according to the read length value SPI_RL in the transmission instruction provided by the host device 2. The signature field can record the signature value SV in four bytes. The sum check field can be summed up according to the data of the return instruction to record the sum value corresponding to the return instruction.
[0083] Therefore, after configuration setting, the connection device 1 can receive transmission instructions of different formats provided by the host device 2, and communicate with the electronic device 3 according to the control of the host device 2 by identifying the transmission instructions. In other words, the connection device 1 can integrate the transmission instructions of different formats provided by the host device 2 to perform read or write operations with the corresponding electronic device 3, effectively integrating a variety of different connection transmission formats when communicating between the host device 2 and the electronic device 3, thereby improving the compatibility of the host device 2.
[0084] In summary, the host device can be connected to the connection device through the human interface device transmission protocol of the universal serial bus, and then connected to multiple electronic devices with different connection transmission formats, so that the host device can communicate with different connection transmission formats. Host devices with different operating systems can configure and set electronic devices with different connection transmission formats through the connection device with configuration instructions in a unified packet format, and then perform communication operations through transmission instructions, so the connection device can effectively improve the compatibility between the host device and the electronic device.
Claims
1. A connection device, suitable for connecting between an electronic device and a host device, characterized in that: The connecting device comprises: A plurality of transmission terminals, each of which can be connected to the electronic device; a memory storing a lookup table, wherein the lookup table records a plurality of transmission format numbers, wherein the transmission format numbers correspond to the plurality of transmission formats respectively; and A controller is electrically connected to the transmission end and the memory. The host-end device generates at least one set of configuration instructions for communication based on a host-end lookup table stored therein. When at least one of the transmission ends is connected to the host end and the electronic device, the controller receives the at least one set of configuration instructions from the host-end device. The at least one set of configuration instructions includes a first field and a second field. The first field records a transmission format index value, and the second field records a selection information. The controller searches the lookup table based on the transmission format index value to obtain a connection transmission format from the transmission format. The controller selects the corresponding at least one of the transmission ends from the transmission ends based on the selection information. The controller configures the electronic device through the connection transmission format.
2. The connection device according to claim 1, characterized in that The controller compares the transmission format index value with the transmission format number to select the connection transmission format connected to the electronic device from the transmission formats.
3. The connection device according to claim 2, characterized in that The transmission format includes a universal input-output format, an integrated circuit bus format, a pulse width modulation format, a serial peripheral bus format or an analog-to-digital converter format.
4. The connection device according to claim 1, characterized in that: The at least one configuration instruction also includes a header field, an instruction length field, a signature field and a sum check field. The header field records a configuration index value corresponding to the at least one configuration instruction. The controller searches the lookup table according to the configuration index value to obtain a configuration instruction format. The instruction length field records an instruction length value of the at least one configuration instruction. The signature field records a signature value. The controller authenticates the at least one configuration instruction according to the signature value. The sum check field records a sum value of all bit data in the at least one configuration instruction. The controller debugs the at least one configuration instruction according to the sum value.
5. The connection device according to claim 1, characterized in that: The memory stores a plurality of transmission numbers, each of which corresponds to a plurality of transmission functions. After the controller receives at least one configuration instruction, the controller communicates with the electronic device according to a transmission instruction received by the host device, the transmission instruction includes a header field and a third field, the header field records a transmission index value, and the third field records a transmission information. The controller queries the lookup table according to the transmission index value to obtain a connection transmission function from the transmission function. The controller communicates with the electronic device and executes the connection transmission function according to the content of the transmission information.
6. The connection device according to claim 5, characterized in that The transmission instruction also includes a header field, an instruction length field, a signature field and a sum check field. The header field records a transmission index value corresponding to the transmission instruction. The controller searches the lookup table according to the transmission index value to obtain a connection transmission instruction format. The instruction length field records an instruction length value of the transmission instruction. The signature field records a signature value. The controller authenticates the transmission instruction according to the signature value. The sum check field records a sum value of all bit data in the transmission instruction. The controller debugs the transmission instruction according to the sum value.
7. The connection device according to any one of claims 1 to 6, characterized in that: The host device and the connection device communicate with each other through the human interface device transmission protocol of the universal serial bus.
8. A connection device, suitable for connecting between an electronic device and a host device, characterized in that: The connecting device comprises: A plurality of transmission ends, each of which is suitable for connecting to the electronic device; a memory storing a lookup table, wherein the lookup table records a plurality of transmission numbers, wherein the transmission numbers correspond to a plurality of transmission functions respectively; and A controller is electrically connected to the transmission end and the memory. The host-side device generates at least one transmission instruction for communication based on a host-side lookup table stored therein. When at least one of the transmission ends is connected to the host end and the electronic device, the controller receives the at least one transmission instruction from the host-side device to communicate with the electronic device. The at least one transmission instruction includes a header field and a first field. The header field records a transmission index value, and the first field records a transmission information. The controller queries the lookup table based on the transmission index value to obtain a connection transmission function from the transmission function. The controller communicates with the electronic device and executes the connection transmission function based on the content of the transmission information.
9. The connection device according to claim 8, characterized in that The at least one transmission instruction also includes a header field, an instruction length field, a signature field and a sum check field. The header field records the transmission index value corresponding to the at least one transmission instruction, the instruction length field records an instruction length value of the at least one transmission instruction, the signature field records a signature value, and the controller authenticates the at least one transmission instruction based on the signature value. The sum check field records a sum value of all bit data in the at least one transmission instruction, and the controller debugs the at least one transmission instruction based on the sum value.
10. The connection device according to claim 8 or 9, characterized in that: The host device and the connection device communicate with each other via a human interface device transmission protocol of a universal serial bus.
Citation Information
Patent Citations
Mode switching system and mode switching method applying same
CN110188060A
Adapter, converted data storage device and method of operation of a converted data storage device
CN1592883A
