CN106815165B - Mobile device and modularized accessory detection method based on same - Google Patents

Mobile device and modularized accessory detection method based on same Download PDF

Info

Publication number
CN106815165B
CN106815165B CN201611167884.5A CN201611167884A CN106815165B CN 106815165 B CN106815165 B CN 106815165B CN 201611167884 A CN201611167884 A CN 201611167884A CN 106815165 B CN106815165 B CN 106815165B
Authority
CN
China
Prior art keywords
accessory
type
access
pin
music
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611167884.5A
Other languages
Chinese (zh)
Other versions
CN106815165A (en
Inventor
朱晓璞
黄宾鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TCL Communication Ningbo Ltd
Original Assignee
Jiekai Communications Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiekai Communications Shenzhen Co Ltd filed Critical Jiekai Communications Shenzhen Co Ltd
Priority to CN201611167884.5A priority Critical patent/CN106815165B/en
Publication of CN106815165A publication Critical patent/CN106815165A/en
Application granted granted Critical
Publication of CN106815165B publication Critical patent/CN106815165B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a modular accessory detection method based on mobile equipment and the mobile equipment, wherein the method comprises the following steps: receiving an external interrupt message from a first access pin; detecting the level state of a second access pin to acquire the identifier of the accessory; obtaining a type of accessory corresponding to the identification of the accessory; and starting the function corresponding to the type of the accessory, so that the modular accessory is interrupted when being connected into the mobile equipment, and finally starting the related function, thereby realizing hot plug identification and differentiated function starting of the modular accessory.

Description

Mobile device and modularized accessory detection method based on same
Technical Field
The invention relates to the field of electronics, in particular to a modular accessory detection method based on mobile equipment and the mobile equipment.
Background
With the large-scale popularization of mobile devices such as smart phones and tablet computers, especially the popularity of large-screen touch smart phones, more and more manufacturers support modular accessories of the mobile devices to meet the differentiation requirements of different users. The modular smart phone is a trend of mobile equipment development, modular accessories at the present stage are subject to compatibility of structure, device driving and the like, and hot plug identification of the modular accessories cannot be realized.
Disclosure of Invention
The invention mainly solves the technical problem of providing a mobile device-based modular accessory detection method and the mobile device, and can solve the problem of hot plug identification of modular accessories.
In order to solve the technical problems, the invention adopts a technical scheme that: a modular accessory detection method based on a mobile device is provided, and comprises the following steps: receiving an external interrupt message from a first access pin; detecting the level state of a second access pin to acquire the identifier of the accessory; obtaining a type of accessory corresponding to the identification of the accessory; a function corresponding to the type of accessory is initiated.
The number of the second access pins is at least two; the detecting the level state of the second access pin to obtain the identifier of the accessory specifically includes: detecting the level states of all the second access pins; and searching the level state combination and identification association data for the identifications corresponding to the level state combinations of all the second access pins.
The types of the accessories at least comprise three types of battery accessories, light accessories and music accessories; the obtaining of the type of the accessory corresponding to the identifier of the accessory specifically includes: if the identification of the accessory is 10, the type of the accessory is a battery accessory; if the identification of the accessory is 01, the type of the accessory is a lighting accessory; if the identification of the accessory is 11, the type of the accessory is a music accessory.
Wherein the starting of the function corresponding to the type of the accessory specifically includes: generating an event message and reporting the event message, wherein the event message at least comprises the type of the accessory; the system of the mobile equipment generates a notification message according to the event message and uploads the notification message to a corresponding application; the corresponding application initiates a function corresponding to the type of the accessory.
Wherein, if the type of the accessory is a battery accessory, the starting of the function corresponding to the type of the accessory specifically includes: starting a charging function of the battery accessory so that the battery accessory can charge a battery of the mobile device; if the type of the accessory is a light accessory, the starting of the function corresponding to the type of the accessory specifically comprises: starting a lighting function of the lighting accessory so that the mobile equipment controls the graph displayed by the lighting accessory by transmitting image data to the lighting accessory; if the type of the accessory is a music accessory, the starting of the function corresponding to the type of the accessory specifically includes: and starting the playing function of the music accessory, so that the mobile equipment controls the music accessory to play music in a dual-channel mode by sending audio data to the music accessory.
Wherein the obtaining of the type of accessory corresponding to the identification of the accessory further comprises: and if the identification of the accessory is 00, generating prompt information to display that the accessory cannot be identified.
In order to solve the technical problem, the invention adopts another technical scheme that: provided is a mobile device, comprising: the modularized electronic device comprises a mainboard and a modularized accessory, wherein the mainboard is at least provided with a first access pin and a second access pin, and the modularized accessory is connected with the mainboard through the access pins; the mainboard is used for detecting the level state of the second access pin after receiving the external interrupt message from the first access pin so as to obtain the identifier of the accessory, obtain the type of the accessory corresponding to the identifier of the accessory and start the function corresponding to the type of the accessory.
The number of the second access pins is at least two; the motherboard is specifically configured to detect the level states of all the second access pins, and search for the identifiers corresponding to the level state combinations of all the second access pins in the level state combination and identifier association data.
The types of the accessories at least comprise three types of battery accessories, light accessories and music accessories; the main board is specifically used for obtaining that the type of the accessory is a battery accessory when the identifier of the accessory is 10; when the identification of the accessory is 01, acquiring that the type of the accessory is a light accessory; when the identification of the accessory is 11, obtaining that the type of the accessory is a music accessory.
Wherein the mainboard is further provided with a communication pin; the main board is specifically used for: when the type of the accessory is a battery accessory, starting a charging function of the battery accessory through the communication pin so that the battery accessory can charge a battery of the mobile device; when the type of the accessory is a light accessory, starting a light function of the light accessory through the communication pin, so that the mobile equipment controls a graph displayed by the light accessory by transmitting image data to the light accessory; when the type of the accessory is a music accessory, starting a playing function of the music accessory through the communication pin, so that the mobile equipment controls the music accessory to play music in a dual-channel mode by sending audio data to the music accessory. A function corresponding to the type of accessory is initiated.
The invention has the beneficial effects that: different from the situation of the prior art, the method and the device can acquire the identification of the accessory by receiving the external interrupt message from the first access pin and detecting the level state of the second access pin, then acquire the type of the accessory corresponding to the identification of the accessory, and finally start the function corresponding to the type of the accessory, so that the modular accessory is interrupted when being accessed into the mobile device, and finally start the related function, thereby realizing the hot plug identification and the differentiated function start of the modular accessory.
Drawings
FIG. 1 is a flow chart of one embodiment of a mobile device based modular accessory detection method of the present invention;
FIG. 2 is a schematic diagram of a first embodiment of the mobile device of the present invention;
FIG. 3 is a schematic diagram of a second embodiment of the mobile device of the present invention;
fig. 4 is a schematic structural diagram of a third embodiment of the mobile device of the present invention;
fig. 5 is a schematic structural diagram of a third embodiment of the mobile device of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for detecting a modular accessory based on a mobile device according to an embodiment of the present invention. As shown in fig. 1, the method for detecting a modular accessory based on a mobile device of the present invention includes:
step S10: receiving an external interrupt message from a first access pin;
specifically, the first access pin is an interrupt trigger pin of the mobile device, when the modular accessory is accessed to the mobile device, the first access pin is communicated to trigger hardware external interrupt of the mobile device, and the mobile device can detect that the modular accessory is accessed according to the interrupt.
Step S12: detecting the level state of the second access pin to acquire the identifier of the accessory;
the number of the second access pins is at least two;
step S12 specifically includes:
step S121: detecting the level states of all second access pins;
step S122: and searching the level state combination and identification associated data for the identifications corresponding to the level state combinations of all the second access pins.
In an application example, the number of the second access pins is two, and the identifiers associated with all the level states are predefined, for example, if the level state of each pin is a high level, the associated identifier is defined as "1", and if the level state of each pin is a low level, the associated identifier is defined as "0", then there are four combinations of the level states of all the second access pins, and the corresponding identifiers are 00, 01, 10, and 11. Of course, in other application examples, the number of the second access pins may be three or more, and the combination of the level states thereof may be eight or more, and is not limited herein.
Step S14: obtaining a type of accessory corresponding to the identification of the accessory;
the types of the accessories at least comprise three types of battery accessories, light accessories and music accessories;
step S14 specifically includes:
step S141: if the identification of the accessory is 10, the type of the accessory is a battery accessory;
step S142: if the identification of the accessory is 01, the type of the accessory is a lighting accessory;
step S143: if the identification of the accessory is 11, the type of accessory is a music accessory.
Wherein, the step S14 further includes:
step S144: if the identification of the accessory is 00, prompt information is generated to display that the accessory cannot be identified.
Specifically, in the application example, taking a mobile device adopting an android system as an example, the mobile device registers a kernel model in the system in advance through a modular accessory detection component (Smart Cover Detect Module), and initializes a model state of the kernel model to a non-access state, namely PLUG _ OUT, and after the modular accessory is accessed to the mobile device, the mobile device performs mobile detection on a level state of a second access pin to obtain an identifier of the accessory, and obtains a type corresponding to the accessory according to the identifier of the accessory; the system presets corresponding association between an accessory identifier and an accessory type, when the identifier of an accessory is 10, the type of the accessory obtained by the modular accessory detection component is a battery accessory (POWER), when the identifier of the accessory is 01, the type of the accessory obtained by the modular accessory detection component is a LIGHT accessory (LIGHT), when the identifier of the accessory is 11, the type of the accessory obtained by the modular accessory detection component is a MUSIC accessory (MUSIC), when the identifier of the accessory is 00, the type of the accessory cannot be identified by the modular accessory detection component, the system generates prompt information to prompt a user that the accessory cannot be identified, and the prompt information can be characters, pictures or voice, and is not specifically limited herein.
Step S16: a function corresponding to the type of accessory is initiated.
Wherein, step S16 specifically includes:
step S161: generating an event message and reporting the event message, wherein the event message at least comprises the type of the accessory;
specifically, IN the application example, after the modular accessory detection component obtains the type of the accessory, the state of the kernel model is set to be the access state, i.e., PLUG _ IN, and the type of the accessory is set to be the obtained type of the accessory, i.e., one of MUSIC, POWER, and LIGHT, and then an event message (Uevent) is generated and reported; wherein the event message includes a state of the kernel model and a type of the accessory.
Step S162: the system of the mobile equipment generates a notification message according to the event message and uploads the notification message to the corresponding application;
specifically, an accessory Service (Smart Cover Service) is registered in advance in an Android system Service (Android System Service) of the mobile device, after the system is started, the accessory Service monitors an accessory Event monitor (Smart Cover Observer Uevent) on a lower layer, when the accessory Event monitor receives an Event message reported by a modular accessory detection component, a kernel model state is obtained, and when the kernel model state is found to be changed into an access state, the Android system Service sends a corresponding Event (Event) to a corresponding upper layer application program (Status Bar/Audio/Light Show APP) according to an accessory type in the Event message to inform accessory access and start a related function.
Step S163: the corresponding application initiates a function corresponding to the type of accessory.
Further, if the type of the accessory is a battery accessory, step S163 specifically includes:
step S1631: a charging function of the battery accessory is initiated so that the battery accessory can charge the battery of the mobile device.
Specifically, in an application example, after the battery accessory is connected to the mobile device, the charging function of the battery accessory can be controlled to be started or stopped through the application program Status Bar, so that when the battery power of the mobile device is low, the battery of the mobile device is charged through the battery accessory, the power utilization efficiency of the battery accessory is improved, and the cruising ability of the mobile device is improved. In addition, when the mobile device is connected to an external power supply, the battery accessory and the battery of the mobile device can be controlled to be charged through the external power supply through the application program Status Bar.
Further, if the type of the accessory is a light accessory, step S163 specifically includes:
step S1632: the light function of the light accessory is activated such that the mobile device controls the graphics displayed by the light accessory by transmitting image data to the light accessory.
Specifically, in an application example, after the Light accessory is connected to the mobile device, the mobile device may transmit image data to the Light accessory through an application Light Show APP, and after the Light accessory receives the image data and is processed by a circuit inside the accessory, the Light accessory controls a Light emitting element inside the accessory to emit Light, for example, an LED tube to emit Light, so as to display the same graphics as the received image data. Of course, in other application examples, the light fitting may control the light emitting element inside to emit light to display a graphic different from the received image data, and the present invention is not limited to this.
Further, if the type of the accessory is a music accessory, step S163 specifically includes:
step S1633: and starting a playing function of the music accessory, so that the mobile equipment controls the music accessory to play music in a dual-channel mode by sending audio data to the music accessory.
Specifically, after the music accessory is connected to the mobile device, the mobile device sends Audio data to the music accessory through the Audio application program, and after the music accessory receives the Audio data, the Audio data is divided into two sound channels through two power amplifiers inside the music accessory for amplification, and the two sound channels are played through two speakers inside the music accessory.
In the above embodiment, the mobile device may obtain the identifier of the accessory by receiving the external interrupt message from the first access pin and detecting the level state of the second access pin, then obtain the type of the accessory corresponding to the identifier of the accessory, and finally start the function corresponding to the type of the accessory, so that the access of the modular accessory to the mobile device is interrupted, and finally start the related function, thereby implementing the hot plug identification and the differentiated function start of the modular accessory.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a mobile device according to a first embodiment of the present invention. As shown in fig. 2, the mobile device 20 of the present invention includes: a motherboard 201 and a modular accessory 202. The modular accessory 202 is connected to the motherboard 201 through an access pin 2011, and the motherboard 201 is at least provided with a first access pin DET and a second access pin ID;
the first access PIN DET and the second access PIN ID both adopt POGO PIN; POGO PIN is a very fine probe, often used in precision connectors, which reduces the weight and bulk of the connector.
The motherboard 201 is configured to detect a level state of the second access pin ID after receiving the external interrupt message from the first access pin DET, to obtain an identifier of the accessory, obtain a type of the accessory corresponding to the identifier of the accessory, and start a function corresponding to the type of the accessory.
Specifically, in an application example, 12 POGO PIN access PINs 2011 are disposed on the motherboard 201, wherein the PINs include one ground PIN GND, one first access PIN DET, two second access PINs ID1 and ID2, and other communication PINs 2011 n; the motherboard 201 periodically detects the state of the access pin 2011, when the modular accessory 202 accesses the mobile device 20, the first access pin DET is turned on to generate an external interrupt message, after the motherboard 201 receives the external interrupt message, the level state of the second access pin ID is detected, the identifier of the accessory is obtained according to the level state combination of the second access pin ID1 and the ID2, and then the motherboard 201 obtains the corresponding accessory type according to the identifier of the accessory, and the specific obtaining method can refer to step S12 and step S14 in an embodiment of the mobile device-based modular accessory detection method of the present invention, which is not repeated here; finally, the main board 201 starts corresponding functions, such as a charging function, a lighting function, etc., according to the obtained accessory type. Of course, in other application examples, the number of the second access pin IDs may also be one or three, and the like, and is not limited herein.
Referring further to fig. 2, the main board 201 is further provided with a communication pin 2011n, and the main board 201 starts a function corresponding to the type of the accessory through the communication pin 2011 n.
Specifically, the number and the type of the communication pins 2011n may be set according to the types of different accessories, for example, when the type of the accessory is a battery accessory, the battery accessory and the motherboard 201 are both provided with two corresponding communication pins 2011n, which are a voltage pin VCHG and a charging pin PMID, respectively, when the motherboard 201 is externally connected to the power supply, the external power supply charges the battery accessory through the voltage pin VCHG, when the motherboard 201 does not have the external power supply, the motherboard 201 may start the charging function of the battery accessory, and the battery accessory charges the battery of the mobile device 20 through the charging pin PMID.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a mobile device according to a second embodiment of the present invention, in which a modular accessory is a battery accessory based on the first embodiment of the mobile device according to the present invention, and as shown in fig. 3, the mobile device 30 according to the present invention includes: a main board 301 and a battery mount 302;
the main board 301 is provided with 12 POGO PIN access PINs 3011, which are a first access PIN DET, second access PINs ID1 and ID2, a voltage PIN VCHG, a charging PIN PMID, a ground PIN GND, and other communication PINs 3011n (not shown), the battery accessory 302 is provided with six POGO PIN PINs corresponding to the first access PIN DET, the second access PINs ID1 and ID2, the voltage PIN VCHG, the charging PIN PMID, and the ground PIN GND, and the battery accessory 302 is connected to the main board 301 through the six POGO PIN PINs.
Specifically, the main board 301 periodically detects the state of the access pin 3011, when the battery accessory 302 is accessed to the mobile device 30, the first access pin DET is turned on to generate an external interrupt message, after the main board 301 receives the external interrupt message, the level states of the second access pin ID1 and ID2 are detected, if the level state of the second access pin ID2 is low level and the level state of the ID1 is high level, the main board 301 obtains the identifier of the accessory as 10, and then, after the main board 301 obtains the corresponding accessory type as the battery accessory according to the identifier 10 of the accessory, the charging function of the battery accessory 302 is started through an application program; when the motherboard 301 is externally connected with power through the USB interface 3012, the external power is sequentially connected with the charging IC3021 of the battery assembly 302 through the USB interface 3012 and the voltage pin VCHG of the motherboard 301, the battery 3022 of the battery assembly 302 is charged through the charging IC3021, and at the same time, the charging IC3013 of the motherboard is connected through the USB interface 3012, the battery 3014 of the motherboard 301 is charged through the charging IC3013, but the USB interface 3012 cannot transmit data at the same time; when the motherboard 301 has no external power source, the motherboard 301 may start the charging function of the battery accessory 302, the battery accessory 302 is connected to the charging IC3013 of the motherboard 301 through the charging pin PMID, and the battery 3014 of the motherboard 301 is charged through the charging IC 3013; when the battery accessory 302 is not connected to the motherboard 301 or the motherboard 301 cannot identify the battery accessory 302, and the motherboard 301 is externally connected with power through the USB interface 3012, the external power can charge the battery 3014 of the motherboard 301 through the USB interface 3012, and the USB interface 3012 can also transmit data at the same time.
Further referring to fig. 3, the charging IC3021 of the battery assembly 302 is also connected to a display lamp 3024 via a microprocessor 3023, and the microprocessor 3023 can display the remaining power state of the battery 3022 of the battery assembly 302 when the battery assembly 302 charges the battery 3014 of the motherboard 301 and display the power state of the battery 3022 when the external power supply charges the battery 3022 of the battery assembly 302 via the USB interface 3012.
Through the above embodiment, when the battery accessory is connected to the mainboard, the charging function of the accessory is started, the cruising ability of the mobile device can be prolonged, and when the mobile device runs, the battery accessory does not need to be connected, and the mobile device can still normally work, so that the hot plug of the battery accessory is realized.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a third embodiment of the mobile device of the present invention, and is based on the first embodiment of the mobile device of the present invention, wherein the modular accessory is a light accessory, and as shown in fig. 4, the mobile device 40 of the present invention includes: a main board 401 and a light fitting 402;
the main board 401 is provided with 12 POGO PIN access PINs 4011, which are a first access PIN DET, second access PINs ID1 and ID2, a power PIN VBAT, a data PIN SDA, a clock PIN SDL, a ground PIN GND and other communication PINs 4011n (not shown), the light accessory 402 is provided with seven POGO PIN PINs corresponding to the first access PIN DET, the second access PINs ID1 and ID2, the power PIN VBAT, the data PIN SDA, the clock PIN SDL and the ground PIN GND, the light accessory 402 is connected with the main board 401 through the seven POGO PIN PINs, and the main board 401 supplies power to the light accessory 402 through the power PIN VBAT.
As shown in fig. 4, an interrupt handler 4012 is disposed in the main board 401, the interrupt handler 4012 periodically detects a state of the access pin 4011, when the light accessory 402 is accessed to the mobile device 40, the first access pin DET is turned on to generate an external interrupt message, after receiving the external interrupt message, the interrupt handler 4012 detects level states of the second access pin ID1 and ID2, if the level state of the second access pin ID1 is a low level, and the level state of the ID2 is a high level, the main board 401 obtains an identifier of the accessory as 01, and then, according to the identifier 01 of the accessory, after obtaining that the corresponding accessory type is the light accessory, the main board 401 starts a light function of the light accessory 402 through an application program.
Specifically, the light fitting 402 is provided with a control chip 4021 and a light emitting element 4022, wherein the light emitting element 4022 may be an LED tube or the like, which is not limited herein. The interrupt processor 4012 of the main board 401 is connected to the control chip 4021 through the data pin SDA and the clock pin SDL, and transmits image data and a control signal to the data pin SDA and the clock pin SDL, so that after the control chip 4021 receives the image data, the control chip processes the image data according to the control signal, and can control the luminance, the contrast, and the like of light emitted by the light emitting element 4022.
Through above-mentioned embodiment, when the light accessory inserts the mainboard, start the light function of accessory, through sending different image data can control the luminance etc. of accessory to the accessory to realize different light effects, and when the mobile device moves, also can not insert this light accessory, the mobile device still can normally work, thereby realizes the hot plug of light accessory.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a fourth embodiment of the mobile device according to the present invention, in which the modular accessory type is a music accessory based on the first embodiment of the mobile device according to the present invention, and as shown in fig. 5, the mobile device 50 according to the present invention includes: a main board 501 and a music accessory 502;
the main board 501 is provided with 12 POGO PIN access PINs 5011, which are a first access PIN DET, a second access PIN ID1 and ID2, a power supply PIN VBAT, a data PIN SDA, a clock PIN SDL, a ground PIN GND, a left channel PIN Audio _ L, a right channel PIN Audio _ R, a reset PIN RST and other communication PINs 5011n (not shown), the music accessory 502 is provided with ten POGO PIN PINs corresponding to the first access PIN DET, the second access PIN ID1 and ID2, the power supply PIN VBAT, the data PIN SDA, the clock PIN SDL, the ground PIN GND, the left channel PIN Audio _ L, the right channel PIN Audio _ R and the reset PIN RST, the music accessory 502 is connected to the main board 501 through the ten POGO PIN PINs, wherein the main board 501 provides power to the music accessory 502 through the power supply PIN VBAT.
As shown in fig. 5, an interrupt handler 5012 is provided in the main board 501, the interrupt handler 5012 periodically detects the state of the access pin 5011, when the music accessory 502 is accessed to the mobile device 50, the first access pin DET is turned on to generate an external interrupt message, the interrupt handler 5012 detects the level state of the second access pin ID1 after receiving the external interrupt message, if the level states of the second access pin ID1 and ID2 are both high level, the main board 501 obtains the identifier 11 of the accessory, and then the main board 501 obtains the corresponding accessory type as a music accessory according to the identifier 11 of the accessory, and then starts the music function of the music accessory 502 through an application program.
Further referring to fig. 5, the music accessory 502 is provided with two power amplification chips 5021 and 5022 connected to the data pin SDA and the clock pin SDL, and two speakers 5023 and 5024 connected to the two power amplification chips 5021, respectively, wherein the power amplification chip 5021 is connected to the left channel pin Audio _ L, and the power amplification chip 5022 is connected to the right channel pin Audio _ R.
Specifically, the interrupt handler 5012 of the motherboard 501 transmits Audio data to the power amplifier chips 5021 and 5022 through the data pin SDA and the clock pin SDL, after the power amplifier chips 5021 and 5022 receive the Audio data, the power amplifier chip 5021 connected to the left channel pin Audio _ L amplifies the left channel data of the Audio data, outputs the amplified data to the speaker 5023 for playing, and after the power amplifier chip 5022 connected to the right channel pin Audio _ R amplifies the right channel data of the Audio data, outputs the amplified data to the speaker 5024 for playing, thereby implementing dual-channel playing.
Through above-mentioned embodiment, when the music accessory inserts the mainboard, start the music function of accessory, when sending audio data to the accessory, the music accessory can be with this audio data through controlling the binaural playing to improve the audio playback effect, and when the mobile device was operated, also can not insert this music accessory, the mobile device still can normally work, thereby realizes the hot plug of music accessory.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A modular accessory detection method based on mobile equipment is characterized by comprising the following steps:
based on an android system, registering a kernel model in the system in advance through a modular accessory detection component, and initializing the state of the kernel model into a non-access state;
receiving an external interrupt message from a first access pin;
detecting the level state of a second access pin to acquire the identifier of the accessory; obtaining a type of accessory corresponding to the identification of the accessory;
setting the state of the kernel model as an access state;
after the android system is started, the accessory service monitors an accessory event monitor on the lower layer, when the accessory event monitor receives an event message reported by the modular accessory detection component, the kernel model state is acquired, and when the kernel model state is found to be changed into an access state, the android system service sends a corresponding event to a corresponding upper layer application program according to the accessory type in the event message to inform the accessory access;
a function corresponding to the type of accessory is initiated.
2. The method of claim 1, wherein the second number of access pins is at least two;
the detecting the level state of the second access pin to obtain the identifier of the accessory specifically includes:
detecting the level states of all the second access pins;
and searching the level state combination and identification association data for the identifications corresponding to the level state combinations of all the second access pins.
3. The method of claim 2, wherein the types of accessories include at least three types of battery accessories, light accessories, and music accessories;
the obtaining of the type of the accessory corresponding to the identifier of the accessory specifically includes:
if the identification of the accessory is 10, the type of the accessory is a battery accessory;
if the identification of the accessory is 01, the type of the accessory is a lighting accessory;
if the identification of the accessory is 11, the type of the accessory is a music accessory.
4. The method of claim 3,
if the type of the accessory is a battery accessory, the starting of the function corresponding to the type of the accessory specifically includes: starting a charging function of the battery accessory so that the battery accessory can charge a battery of the mobile device;
if the type of the accessory is a light accessory, the starting of the function corresponding to the type of the accessory specifically comprises: starting a lighting function of the lighting accessory so that the mobile equipment controls the graph displayed by the lighting accessory by transmitting image data to the lighting accessory;
if the type of the accessory is a music accessory, the starting of the function corresponding to the type of the accessory specifically includes: and starting the playing function of the music accessory, so that the mobile equipment controls the music accessory to play music in a dual-channel mode by sending audio data to the music accessory.
5. The method of claim 3, wherein the obtaining a type of accessory corresponding to the identification of the accessory further comprises:
and if the identification of the accessory is 00, generating prompt information to display that the accessory cannot be identified.
6. A mobile device, based on an android system, comprising: the mobile device registers a kernel model in a system in advance through the modular accessory detection component and initializes the kernel model state to a non-access state;
the main board is at least provided with a first access pin and a second access pin, and the modularized accessory is connected with the main board through the access pins;
the mainboard is used for detecting the level state of the second access pin after receiving the external interrupt message from the first access pin, to obtain the identification of the accessory, to obtain the type of the accessory corresponding to the identification of the accessory, and after the modular accessory detection component obtains the type of the accessory, setting the state of the kernel model as an access state, after the system is started, monitoring an accessory event monitor on the lower layer by an accessory service, when the accessory event monitor receives the event message reported by the modular accessory detection component, acquires the kernel model state, and finds that the kernel model state is changed into an access state, and the android system service sends a corresponding event to a corresponding upper application program according to the accessory type in the event message to inform the accessory access, and starts a function corresponding to the accessory type.
7. The mobile device of claim 6, wherein the second number of access pins is at least two;
the motherboard is specifically configured to detect the level states of all the second access pins, and search for the identifiers corresponding to the level state combinations of all the second access pins in the level state combination and identifier association data.
8. The mobile device of claim 7, wherein the types of accessories include at least three types of battery accessories, light accessories, and music accessories;
the main board is specifically used for obtaining that the type of the accessory is a battery accessory when the identifier of the accessory is 10; when the identification of the accessory is 01, acquiring that the type of the accessory is a light accessory; when the identification of the accessory is 11, obtaining that the type of the accessory is a music accessory.
9. The mobile device of claim 8,
the mainboard is further provided with a communication pin; the main board is specifically used for:
when the type of the accessory is a battery accessory, starting a charging function of the battery accessory through the communication pin so that the battery accessory can charge a battery of the mobile device;
when the type of the accessory is a light accessory, starting a light function of the light accessory through the communication pin, so that the mobile equipment controls a graph displayed by the light accessory by transmitting image data to the light accessory;
when the type of the accessory is a music accessory, starting a playing function of the music accessory through the communication pin, so that the mobile equipment controls the music accessory to play music in a dual-channel mode by sending audio data to the music accessory, and starting a function corresponding to the type of the accessory.
CN201611167884.5A 2016-12-16 2016-12-16 Mobile device and modularized accessory detection method based on same Active CN106815165B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611167884.5A CN106815165B (en) 2016-12-16 2016-12-16 Mobile device and modularized accessory detection method based on same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611167884.5A CN106815165B (en) 2016-12-16 2016-12-16 Mobile device and modularized accessory detection method based on same

Publications (2)

Publication Number Publication Date
CN106815165A CN106815165A (en) 2017-06-09
CN106815165B true CN106815165B (en) 2020-01-03

Family

ID=59108964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611167884.5A Active CN106815165B (en) 2016-12-16 2016-12-16 Mobile device and modularized accessory detection method based on same

Country Status (1)

Country Link
CN (1) CN106815165B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121681B (en) * 2017-12-04 2020-12-11 泾县谷声信息科技有限公司 Hot plug implementation method, terminal and storage medium
CN109510895A (en) * 2018-10-24 2019-03-22 惠州Tcl移动通信有限公司 Method, mobile terminal and the storage medium that mobile terminal control fitting works
CN110141221B (en) * 2019-06-28 2021-04-13 联想(北京)有限公司 Monitoring equipment, method and system
CN111182412B (en) * 2019-12-31 2021-04-13 联想(北京)有限公司 Electronic equipment, data processing method for electronic equipment and conference system equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295277A (en) * 2007-04-23 2008-10-29 三星电子株式会社 System and method for recognizing external device by portable terminal
CN101827157A (en) * 2009-03-05 2010-09-08 宏达国际电子股份有限公司 Automatic detection and recognition method of electronic device, electronic system and peripheral device
CN103581787A (en) * 2012-08-03 2014-02-12 快捷半导体(苏州)有限公司 Self-configuration device and method for operating electrical device
CN103593319A (en) * 2013-11-06 2014-02-19 苏州泰思特电子科技有限公司 Serial port application method for supporting hot plugging and identifying external device automatically
CN106021138A (en) * 2016-05-18 2016-10-12 深圳市海能达通信有限公司 Accessory, host as well as multi-accessory ID identification system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253459A (en) * 2013-06-28 2014-12-31 鸿富锦精密工业(深圳)有限公司 USB device with power supply mode switching function

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295277A (en) * 2007-04-23 2008-10-29 三星电子株式会社 System and method for recognizing external device by portable terminal
CN101827157A (en) * 2009-03-05 2010-09-08 宏达国际电子股份有限公司 Automatic detection and recognition method of electronic device, electronic system and peripheral device
CN103581787A (en) * 2012-08-03 2014-02-12 快捷半导体(苏州)有限公司 Self-configuration device and method for operating electrical device
CN103593319A (en) * 2013-11-06 2014-02-19 苏州泰思特电子科技有限公司 Serial port application method for supporting hot plugging and identifying external device automatically
CN106021138A (en) * 2016-05-18 2016-10-12 深圳市海能达通信有限公司 Accessory, host as well as multi-accessory ID identification system and method

Also Published As

Publication number Publication date
CN106815165A (en) 2017-06-09

Similar Documents

Publication Publication Date Title
US11288407B2 (en) Method and electronic device for controlling voltage output to external electronic device according to size of voltage detected at signal terminal connected to external electronic device
US10886672B2 (en) Connector for connecting antenna and electronic device having the same
KR102609837B1 (en) Electronic device and method of communicating with an external device via a power supply line
CN106815165B (en) Mobile device and modularized accessory detection method based on same
EP3113298B1 (en) Connecting device and method for recognizing device
US9448611B2 (en) Interface expending method and device for tablet computer
KR102427206B1 (en) An device and a method for controlling a microphone according to a connection of an external accessory
KR20190020971A (en) Electronic device with conductive exterior member, and leakage current detection method related thereto
CN109450023B (en) Charging circuit, charging processing method, electronic device, and storage medium
KR102553585B1 (en) Electronic device and method for charging stylus pen thereof
US11176078B2 (en) Communication method using input/output interface, and apparatus therefor
CN113937832B (en) Charging cable, and identification method and system thereof
WO2016190573A1 (en) Electronic device and power managing method thereof
US11243594B2 (en) Electronic device supporting connection with external device and power consumption reducing method when using electronic device in connection with external device
WO2021033965A1 (en) Electronic device for power management, and operation method therefor
KR20120042445A (en) Method and apparatus for charging for battery of portable terminal
KR20210014356A (en) Electronic device for preventing damage of usb device and operating method thereof
US11349516B2 (en) Electronic device in which tray for loading SIM card is inserted, and control method therefor
US20140068113A1 (en) Data transmission between a portable electronic device and various accessory devices via respective dedicated connection interfaces
US11269588B2 (en) Electronic device for outputting audio through USB port and method thereof
US11394225B2 (en) Method and apparatus for changing impedance of terminal included in connector
KR102469568B1 (en) Apparatus and method for receiving a broadcast signal using type c connector
US20210093198A1 (en) Method for performing wireless communication by using biosensor and electronic device therefor
WO2020204451A1 (en) Method for keyless reset, and electronic device therefor
KR20190105857A (en) Electronic device and method for sensing temperature of speaker

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200916

Address after: 6 / F, No.5, Lane 999, Yangfan Road, hi tech Zone, Ningbo City, Zhejiang Province

Patentee after: TCL COMMUNICATION (NINGBO) Co.,Ltd.

Address before: 518063 Guangdong city of Shenzhen province Nanshan District ten South Road West High Technology South Road North Tower B 16 floor TCL

Patentee before: Jiekai communication (Shenzhen) Co.,Ltd.