Disclosure of Invention
In view of the above, the present invention is proposed to provide a car machine system power amplifier type identification method, an electronic device and a computer storage medium, which overcome the above problems or at least partially solve the above problems.
According to one aspect of the invention, a vehicle machine system power amplifier type identification method is provided, which is applied to an MCU main control chip, wherein the MCU main control chip comprises a CAN driving module, an I2C driving module, a GPIO driving module and a power amplifier type judgment module, and the method comprises the following steps:
the GPIO driving module outputs a power-on signal;
the power amplifier type judging module polls and outputs each built-in power amplifier information in a built-in power amplifier information table through the I2C driving module within a preset time length from the time when the GPIO driving module outputs the power-on signal, and determines whether the power amplifier type of the vehicle machine system is a built-in power amplifier according to a response result of an I2C bus;
the power amplifier type judging module reads identification information of external power amplifier equipment through the CAN driving module under the condition that the preset time length is exceeded and the power amplifier type of the car machine system is not determined to be an internal power amplifier, and determines whether the power amplifier type of the car machine system is the external power amplifier or not according to the identification information.
Optionally, the determining, by the power amplifier type determining module, whether the power amplifier type of the in-vehicle machine system is a built-in power amplifier according to a response result of the I2C bus includes:
the power amplifier type judging module judges whether a response exists on the I2C bus within the preset time length; and if so, determining that the power amplifier type of the vehicle machine system is a built-in power amplifier.
Optionally, the determining module of the power amplifier type determines whether the power amplifier type of the in-vehicle machine system is an external power amplifier according to the identification information, including:
the power amplifier type judging module identifies whether the external power amplifier information table stores the identification information or not; and if so, determining that the power amplifier type of the vehicle-mounted machine system is an external power amplifier.
Optionally, the power amplifier type determining module identifies whether the external power amplifier information table stores the identification information, and further includes:
and if the external power amplifier information table does not store the identification information, determining that the power amplifier type of the vehicle-mounted machine system is a default power amplifier.
Optionally, the identification information of the external power amplifier includes at least one of: part number information and an audio mode signal.
Optionally, the method further comprises:
if the power amplifier type judgment module determines that the power amplifier type of the vehicle-mounted machine system is a built-in power amplifier, the built-in power amplifier is initialized and started according to built-in power amplifier information of the built-in power amplifier; and if the power amplifier type of the vehicle-mounted machine system is determined to be an external power amplifier, initializing and starting the external power amplifier according to the identification information of the external power amplifier.
Optionally, the built-in power amplifier information includes address information of the built-in power amplifier.
Optionally, the GPIO driver module and the I2C driver module are configured to be electrically connected to the internal power amplifier, and respectively power on and transmit control data for the internal power amplifier;
the I2C driving module is configured to be electrically connected with the external power amplifier device and transmits control data for the external power amplifier.
According to another aspect of the present invention, there is also provided an electronic apparatus, including:
a processor;
a memory storing a computer program;
the computer program, when executed by the processor, causes the electronic device to perform the method as any one of the above.
According to yet another aspect of the invention, there is also provided a computer storage medium having stored therein at least one instruction, at least one program, set of code or set of instructions, which is loaded by a processor and which performs a method as described in any one of the above.
In the invention, after the vehicle-mounted host is powered on, the GPIO driving module outputs a power-on signal, the power amplifier type judging module polls and outputs each built-in power amplifier information in the built-in power amplifier information table through the I2C driving module within a preset time length from the time when the GPIO driving module outputs the power-on signal, and determines whether the power amplifier type of the vehicle-mounted system is a built-in power amplifier according to a response result of the I2C bus; and reading the identification information of the external power amplifier equipment through the CAN driving module under the condition that the preset time length is exceeded and the power amplifier type of the vehicle machine system is not determined to be the internal power amplifier, and determining whether the power amplifier type of the vehicle machine system is the external power amplifier or not according to the identification information. Based on the technical scheme provided by the invention, the power amplifier type of the vehicle-mounted machine system can be automatically identified after the vehicle-mounted host is powered on, two software versions do not need to be compiled, and the software development and maintenance cost is reduced; furthermore, after the power amplifier type configured for the vehicle is confirmed, the DSP can be informed to perform corresponding initialization, so that the performance requirement of early sounding of the power amplifier is met.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a schematic configuration diagram of an in-vehicle host according to an embodiment of the present invention. Referring to fig. 1, an MCU (micro controller Unit) main control chip 100 and a DSP (Digital signal processing) audio chip 400 are integrated in a vehicle-mounted host 200, and the DSP audio chip 600 is electrically connected to the MCU main control chip 100 through an I2C bus for transmitting control data. Under the condition that the power amplifier type of the vehicle-mounted system is a built-in power amplifier, a built-in power amplifier chip 300 is integrated in the vehicle-mounted host 200, and the built-in power amplifier chip 300 is electrically connected with the MCU main control chip 100 through an I2C bus and used for transmitting control data; the built-in power amplifier chip 300 is also electrically connected with the MCU main control chip 100 through a GPIO terminal for receiving a power-on signal of the MCU main control chip 100, wherein the GPIO terminal is specially used for powering on the built-in power amplifier chip 300 in the design of the MCU main control chip 100; the DSP audio chip 600 is electrically connected to the built-in power amplifier chip 300 through an audio bus, and is configured to transmit audio data. Under the condition that the power amplifier type of the vehicle-mounted machine system is an external power amplifier, the external power amplifier equipment 500 is independent of the vehicle-mounted host 200, the external power amplifier equipment 500 is powered by the whole vehicle and is powered before the vehicle-mounted host, and the external power amplifier equipment 500 is electrically connected with the MCU main control chip 100 through the CAN bus and used for transmitting control data; the DSP audio chip 600 is also electrically connected to the external power amplifier 50 through an audio bus for transmitting audio data.
Fig. 2 is a schematic structural diagram of an MCU master control chip according to one embodiment of the present invention. Referring to fig. 2, a CAN driver module 140, an I2C driver module 130, a GPIO driver module 120, a DSP management module 110, a power amplifier management module 150, and a power amplifier type determination module 160 are integrated in the MCU main control chip. The CAN driver module 140 provides a read/write interface of the CAN bus; the I2C driving module 130 provides a read-write interface of the I2C bus; the GPIO driver module 120 provides a terminal read/write interface; the power amplifier type determining module 160 integrates the pre-adapted internal power amplifier information of one (or more) internal power amplifier chips 300 and the part number information of the external power amplifier device 500 or other CAN signal information capable of supporting the MCU main control chip 100 to identify the external power amplifier type. The power amplifier management module 150 is responsible for internal power amplifier, external power amplifier initialization and application layer communication management. The DSP management module is responsible for DSP audio chip 600 set initialization and application layer communication management.
Based on the MCU main control chip 100, the present invention provides a car machine system power amplifier type identification method, and fig. 3 is a schematic flow of the car machine system power amplifier type identification method according to an embodiment of the present invention. Referring to fig. 3, the method may include at least the following steps.
Step S302: the GPIO driving module 120 outputs a power-on signal;
step S304: the power amplifier type judging module 160 polls and outputs each built-in power amplifier information in the built-in power amplifier information table through the I2C driving module 130 within a preset time length from the time when the GPIO driving module 120 outputs the power-on signal, and determines whether the power amplifier type of the car machine system is a built-in power amplifier according to a response result of the I2C bus;
step S306: the power amplifier type determining module 160 reads the identification information of the external power amplifier device through the CAN driving module 140 under the condition that the preset time length is exceeded and the power amplifier type of the in-vehicle system is not determined to be the internal power amplifier, and determines whether the power amplifier type of the in-vehicle system is the external power amplifier according to the identification information.
In the embodiment of the present invention, after the vehicle-mounted host 200 is powered on, the GPIO driving module 120 outputs a power-on signal, the power amplifier type determining module 160 polls and outputs each internal power amplifier information in the internal power amplifier information table through the I2C driving module 130 within a preset time period from when the GPIO driving module 120 outputs the power-on signal, and determines whether the power amplifier type of the vehicle-mounted system is a internal power amplifier according to a response result of the I2C bus. The power amplifier type determining module 160 reads the identification information of the external power amplifier device 500 through the CAN driving module 140 under the condition that the preset time length is exceeded and the power amplifier type of the in-vehicle system is not determined to be the internal power amplifier, and determines whether the power amplifier type of the in-vehicle system is the external power amplifier according to the identification information. Based on the technical scheme provided by the invention, the power amplifier type of the vehicle-mounted machine system can be automatically identified after the vehicle-mounted host 200 is powered on, two versions of software do not need to be compiled, and the software development and maintenance cost is reduced; furthermore, after the power amplifier type of the vehicle-mounted machine system is determined, the DSP can be informed to perform corresponding initialization, and the performance requirement of early sounding of the power amplifier is met.
The vehicle-mounted host 200 is connected to the environment of the whole vehicle through a connector, and the whole vehicle supplies power to the vehicle-mounted host 200 through a wiring harness connector. After the MCU main control chip 100 is powered on, the GPIO driving module 120 outputs a power-on signal. In the presence of the built-in power amplifier chip 300, the built-in power amplifier chip 300 receives a power-on signal from the GPIO driver module 120.
In some embodiments of the present invention, the determining, by the power amplifier type determining module 160 mentioned in step S302, whether the power amplifier type of the in-vehicle system is a built-in power amplifier according to the response result of the I2C bus may include: the power amplifier type determining module 160 determines whether there is a response on the I2C bus within a preset time period; and if so, determining that the power amplifier type of the vehicle machine system is a built-in power amplifier.
Specifically, the preset duration at least meets the initialization duration of the built-in power amplifier chip and the duration of each piece of built-in power amplifier information in the built-in power amplifier information table which is completely polled once. The preset time period may be set according to actual conditions, for example, 100ms, and the like, and the present invention is not limited. If the power amplifier configured in the vehicle-mounted machine system is a built-in power amplifier in the corresponding built-in power amplifier information table, the built-in power amplifier configured in the vehicle-mounted machine system sends an ACK response to the I2C bus after receiving the corresponding built-in power amplifier information. The power amplifier type determining module 160 may continuously detect the I2C bus, and after detecting that the ACK response exists in the I2C bus, may determine that the power amplifier type of the in-vehicle system is a built-in power amplifier.
The internal power amplifier information may include address information of the internal power amplifier chip 300, where the address information of different internal power amplifier chips is different, for example, the address information of the internal power amplifier chips of NXP and TI is different. The power amplifier type determining module 160 may determine not only the power amplifier type of the car machine system but also the address information of the internal power amplifier chip 300 according to the response on the I2C bus. After determining the address information of the internal power amplifier chip 300, the power amplifier type determining module 160 initializes the internal power amplifier according to the internal power amplifier information of the internal power amplifier.
Specifically, the power amplifier type determining module 160 notifies the address information of the built-in power amplifier chip 300 to the DSP management module 110 and the power amplifier management module 150, so that the DSP management module 110 and the power amplifier management module 150 are respectively responsible for the initialization and the application layer management of the built-in power amplifier chip 300 and the DSP audio chip 600. Therefore, two software versions do not need to be compiled, and the requirement of early sounding of the power amplifier can be met.
In addition, the power amplifier type determining module 160 reads the identification information of the external power amplifier device 500 through the CAN driving module 140 when the preset time length is exceeded and the power amplifier type of the in-vehicle system is not determined to be the internal power amplifier, and determines whether the power amplifier type of the in-vehicle system is the external power amplifier according to the identification information.
Specifically, determining, by the power amplifier type determining module 160, whether the power amplifier type of the in-vehicle machine system is an external power amplifier according to the identification information may include: the power amplifier type judgment module 160 identifies whether the external power amplifier information table stores the identification information; and if so, determining that the power amplifier type of the vehicle machine system is an external power amplifier.
Wherein the identification information may include at least one of: part number information and significance mode signal information. The power amplifier type judging module 160 compares the read identification information of the external power amplifier with the part number information and the audio mode signal information in the external power amplifier information table, and if the identification information is stored in the external power amplifier information table, the power amplifier type of the vehicle-mounted machine system can be determined to be the external power amplifier; if the external power amplifier information table does not store the identification information, the power amplifier type of the vehicle-mounted machine system can be determined to be a non-external power amplifier.
Since the part number information and the audio mode signal information of different external power amplifiers are also different, the part number information or the audio mode signal information of the external power amplifier device 500 can be determined while the power amplifier type of the vehicle-mounted device system is determined to be the external power amplifier. After determining the part number information or the sound effect mode signal information of the external power amplifier device 500, the power amplifier type determining module 160 may initialize and start the external power amplifier according to the identification information of the external power amplifier device 500.
Specifically, the power amplifier type determining module 160 may notify the external power amplifier identification information to the DSP management module 110 and the power amplifier management module 150, so that the DSP management module 110 and the power amplifier management module 150 are respectively responsible for the initialization and the application layer management of the external power amplifier device 500 and the DSP audio chip 600. Therefore, two software versions do not need to be compiled, and the requirement of early sounding of the power amplifier can be met.
In some embodiments of the present invention, after the power amplifier type determining module 160 identifies whether the external power amplifier information table stores the identification information, the method further includes: and if the external power amplifier information table does not store the identification information, determining that the power amplifier type of the vehicle-mounted machine system is a default power amplifier.
Specifically, after the power amplifier type of the vehicle machine system is determined to be the default power amplifier, the power amplifier of the vehicle machine system can be driven according to the pre-stored address information of the built-in power amplifier or the part number information of the external power amplifier or the sound effect mode signal information. The pre-stored address information of the internal power amplifier or the part number information of the external power amplifier or the sound effect mode signal is stored in the power amplifier type determining module 160.
Based on the same inventive concept, the present invention further provides an electronic device 400, and fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Referring to fig. 4, the electronic device 400 comprises a processor 410 and a memory 420 in which a computer program 421 is stored; the computer program 421, when executed by the processor 410, causes the electronic device 400 to perform a method according to any of the embodiments described above.
Based on the same inventive concept, the present invention also proposes a computer storage medium having at least one instruction, at least one program, code set, or instruction set stored therein, the at least one instruction, at least one program, code set, or instruction set being loaded by a processor and executing the method according to any one of the above embodiments.
The invention provides a vehicle machine system power amplifier type identification method, an electronic device and a computer storage medium, in the method, after a vehicle-mounted host 200 is powered on, a GPIO driving module 120 outputs a power-on signal, a power amplifier type judgment module 160 polls and outputs each built-in power amplifier information in a built-in power amplifier information table through an I2C driving module 130 within a preset time period after the GPIO driving module 120 outputs the power-on signal, and determines whether the power amplifier type of the vehicle machine system is a built-in power amplifier according to a response result of an I2C bus. The power amplifier type determining module 160 reads the identification information of the external power amplifier device 500 through the CAN driving module 140 under the condition that the preset time length is exceeded and the power amplifier type of the in-vehicle system is not determined to be the internal power amplifier, and determines whether the power amplifier type of the in-vehicle system is the external power amplifier according to the identification information. Based on the technical scheme provided by the invention, the power amplifier type of the vehicle-mounted machine system can be automatically identified after the vehicle-mounted host 200 is powered on, two versions of software do not need to be compiled, and the software development and maintenance cost is reduced; furthermore, after the power amplifier type of the vehicle-mounted machine system is determined, the DSP can be informed to perform corresponding initialization, and the performance requirement of early sounding of the power amplifier is met.
It is clear to those skilled in the art that the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and for the sake of brevity, further description is omitted here.
In addition, the functional units in the embodiments of the present invention may be physically independent of each other, two or more functional units may be integrated together, or all the functional units may be integrated in one processing unit. The integrated functional units may be implemented in the form of hardware, or in the form of software or firmware.
Those of ordinary skill in the art will understand that: the integrated functional units, if implemented in software and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computing device (e.g., a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention when the instructions are executed. And the aforementioned storage medium includes: u disk, removable hard disk, Read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disk, and other various media capable of storing program code.
Alternatively, all or part of the steps of implementing the foregoing method embodiments may be implemented by hardware (such as a computing device, e.g., a personal computer, a server, or a network device) associated with program instructions, which may be stored in a computer-readable storage medium, and when the program instructions are executed by a processor of the computing device, the computing device executes all or part of the steps of the method according to the embodiments of the present invention.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments can be modified or some or all of the technical features can be equivalently replaced within the spirit and principle of the present invention; such modifications or substitutions do not depart from the scope of the present invention.