CPC H04R 5/04 (2013.01) [G06F 3/162 (2013.01); H04M 1/6058 (2013.01); H04R 5/033 (2013.01); H04S 1/007 (2013.01); H03M 1/66 (2013.01); H04R 2420/03 (2013.01); H04R 2420/05 (2013.01)] | 20 Claims |
1. A channel configuration method of driving a motor by using audio, applied to an electronic device, wherein the electronic device is provided with an Android system, a system of driving a motor by using audio that is of the electronic device comprises an audio service module, an audio abstraction module, a codec driver, and a codec chip, the audio service module is communicatively connected to the audio abstraction module, the audio abstraction module is communicatively connected to the codec driver, the codec driver is communicatively connected to the codec chip, the audio service module is disposed at an application architecture layer of the Android system, the audio abstraction module is disposed at a hardware abstraction layer of the Android system, the codec driver is disposed at a kernel layer of the Android system, the codec chip is disposed at a hardware layer of the Android system, and the method comprises:
receiving a headset insertion/removal message by using the audio service module, and sending the headset insertion/removal message to the audio abstraction module;
receiving the headset insertion/removal message by using the audio abstraction module, determining a digital-to-analog converter (DAC) channel configuration policy in the codec chip based on the headset insertion/removal message, and sending the DAC channel configuration policy to the codec driver, wherein a DAC channel is used to transmit earpiece or headset data, and transmit motor data to a class-D amplifier (ClassD) to drive the motor; and
receiving the DAC channel configuration policy by using the codec driver, and controlling, by using the codec driver, the codec chip to reconfigure the DAC channel based on the DAC channel configuration policy.
|