diff --git a/en/device-dev/driver/Readme-EN.md b/en/device-dev/driver/Readme-EN.md index 47851b4dbf94f87febcbc7364d29df31d2c283b8..55f5c19b5fcf88377f7ccd2f0b2148aff2dd883b 100644 --- a/en/device-dev/driver/Readme-EN.md +++ b/en/device-dev/driver/Readme-EN.md @@ -10,25 +10,35 @@ - [Platform Driver Development](driver-develop.md) - [ADC](driver-platform-adc-develop.md) - [GPIO](driver-platform-gpio-develop.md) + - [HDMI](driver-platform-hdmi-develop.md) - [I2C](driver-platform-i2c-develop.md) + - [I3C](driver-platform-i3c-develop.md) + - [MIPI CSI](driver-platform-mipicsi-develop.md) - [MIPI DSI](driver-platform-mipidsi-develop.md) - [MMC](driver-platform-mmc-develop.md) + - [PIN](driver-platform-pin-develop.md) - [PWM](driver-platform-pwm-develop.md) + - [Regulator](driver-platform-regulator-develop.md) - [RTC](driver-platform-rtc-develop.md) - [SDIO](driver-platform-sdio-develop.md) - [SPI](driver-platform-spi-develop.md) - [UART](driver-platform-uart-develop.md) - [Watchdog](driver-platform-watchdog-develop.md) - [Platform Driver Usage](driver-platform.md) + - [ADC](driver-platform-adc-des.md) - [GPIO](driver-platform-gpio-des.md) + - [HDMI](driver-platform-hdmi-des.md) - [I2C](driver-platform-i2c-des.md) - - [MIPI DSI](driver-platform-mipidsi-develop.md) + - [I3C](driver-platform-i3c-des.md) + - [MIPI CSI](driver-platform-mipicsi-des.md) + - [MIPI DSI](driver-platform-mipidsi-des.md) - [PWM](driver-platform-pwm-des.md) + - [Regulator](driver-platform-regulator-des.md) - [RTC](driver-platform-rtc-des.md) - [SDIO](driver-platform-sdio-des.md) - [SPI](driver-platform-spi-des.md) - [UART](driver-platform-uart-des.md) - - [Watchdog](driver-platform-watchdog-des.md) + - [Watchdog](driver-platform-watchdog-des.md) - [Peripheral Driver Usage](driver-peripherals.md) - [LCD](driver-peripherals-lcd-des.md) - [Touchscreen](driver-peripherals-touch-des.md) diff --git a/en/device-dev/driver/driver-develop.md b/en/device-dev/driver/driver-develop.md index 7967bb405068886414ca2f3195b8465973ce69b3..e3effaeb8ea3bdfc1dd4276c188de0127ad20a83 100644 --- a/en/device-dev/driver/driver-develop.md +++ b/en/device-dev/driver/driver-develop.md @@ -4,9 +4,15 @@ - **[GPIO](driver-platform-gpio-develop.md)** +- **[HDMI](driver-platform-hdmi-develop.md)** + - **[I2C](driver-platform-i2c-develop.md)** -- **[MIPI-DSI](driver-platform-mipidsi-develop.md)** +- **[I3C](driver-platform-i3c-develop.md)** + +- **[MIPI CSI](driver-platform-mipicsi-develop.md)** + +- **[MIPI DSI](driver-platform-mipidsi-develop.md)** - **[MMC](driver-platform-mmc-develop.md)** diff --git a/en/device-dev/driver/driver-platform-adc-des.md b/en/device-dev/driver/driver-platform-adc-des.md new file mode 100644 index 0000000000000000000000000000000000000000..63da8cd7e0fc7b6a6024b42e4d1e7be260ecdd4c --- /dev/null +++ b/en/device-dev/driver/driver-platform-adc-des.md @@ -0,0 +1,256 @@ +# ADC + +## Overview + +- An analog-to-digital converter (ADC) is a device that converts analog signals into digital signals. + +- The ADC APIs provide a set of common functions for ADC data transfer, including: + - Opening or closing an ADC device + - Obtaining the analog-to-digital (AD) conversion result + + **Figure 1** ADC physical connection + + ![](figures/ADC_physical_connection.png "ADC_physical_connection") + +## Available APIs + +**Table 1** APIs of the ADC driver + + + +
Category + |
+API + |
+Description + |
+
---|---|---|
Managing ADC devices + |
+AdcOpen + |
+Opens an ADC device. + | +
AdcClose + |
+Closes an ADC device. + |
+|
Obtaining the conversion result + |
+AdcRead + |
+Reads the AD conversion result. + |
+
Parameter + |
+Description + |
+
---|---|
number + |
+ADC device number. + |
+
Return Value + |
+Description + |
+
NULL + |
+Failed to open the ADC device. + |
+
Device handle + |
+Handle of the ADC device opened. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+ADC device handle. + |
+
channel + |
+ADC device channel number. + |
+
val + |
+AD conversion result. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+Failed to obtain the AC conversion result. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+ADC device handle. + |
+
Return Value + |
+Description + |
+
None + |
+No value is returned if the ADC device is closed. + |
+
Category + |
+API + |
+Description + |
+
---|---|---|
Managing HDMI controllers + |
+HdmiOpen + |
+Opens an HDMI controller. + | +
HdmiClose + |
+Closes an HDMI controller. + |
+|
Starting or stopping HDMI transmission + |
+HdmiStart + |
+Starts HDMI transmission. + | +
HdmiStop + |
+Stops HDMI transmission. + |
+|
Setting an HDMI controller + |
+HdmiAvmuteSet + |
+Sets the AV mute feature. + | +
HdmiDeepColorSet + |
+Sets the color depth. + |
+|
HdmiDeepColorGet + |
+Obtains the color depth. + |
+|
HdmiSetVideoAttribute + |
+Sets video attributes. + |
+|
HdmiSetAudioAttribute + |
+Sets audio attributes. + |
+|
HdmiSetHdrAttribute + |
+Sets HDR attributes. + |
+|
Reading EDID + |
+HdmiReadSinkEdid + |
+Reads the raw EDID from a sink. + | +
Registering or unregistering a callback for HDMI hot plug detect + |
+HdmiRegisterHpdCallbackFunc + |
+Registers a callback for HDMI hot plug detect. + | +
HdmiUnregisterHpdCallbackFunc + |
+Unregisters the callback for HDMI hot plug detect. + |
+
Parameter + |
+Description + |
+
---|---|
number + |
+HDMI controller ID. + |
+
Return Value + |
+Description + |
+
NULL + |
+Failed to open the HDMI controller. + |
+
Controller handle + |
+Handle of the HDMI controller opened. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
callback + |
+Callback invoked to return the hot plug detect result. + |
+
Return Value + |
+Description + |
+
0 + |
+The callback is registered successfully. + |
+
Negative number + |
+Failed to register the callback. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
buffer + |
+Data buffer. + |
+
len + |
+Data length. + |
+
Return Value + |
+Description + |
+
Positive integer + |
+Raw EDID read. + |
+
Negative number or **0** + |
+Failed to read the EDID. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
attr + |
+Audio attributes. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
attr + |
+Video attributes. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
attr + |
+HDR attributes. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
enable + |
+Whether the AV mute feature is enabled. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
color + |
+Color depth to set. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
color + |
+Color depth. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+HDMI controller handle. + |
+
Category + |
+API + |
+Description + |
+
---|---|---|
I3C controller management + |
+I3cOpen + |
+Opens an I3C controller. + | +
I3cClose + |
+Closes an I3C controller. + |
+|
I3C transfer + |
+I3cTransfer + |
+Customizes an I3C transfer. + |
+
I3C controller configuration + |
+I3cSetConfig + |
+Sets an I3C controller. + | +
I3cGetConfig + |
+Obtains the I3C controller configuration. + |
+|
I3C IBI + |
+I3cRequestIbi + |
+Requests an IBI. + | +
I3cFreeIbi + |
+Releases an IBI. + |
+
Parameter + |
+Description + |
+
---|---|
number + |
+I3C controller ID. + |
+
Return Value + |
+Description + |
+
NULL + |
+Failed to open the I3C controller. + |
+
Controller handle + |
+Handle of the I3C controller opened. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+I3C controller handle. + |
+
msgs + |
+Message structure array of the data to be transmitted. + |
+
count + |
+Length of the message array. + |
+
mode + |
+Transmission mode, where the value 0 indicates the I2C mode, 1 indicates the I3C mode, and 2 indicates transmission of the Common Command Code (CCC). + |
+
Return Value + |
+Description + |
+
Positive integer + |
+Number of message structures successfully transferred. + |
+
Negative number + |
+The operation failed. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+I3C controller handle. + |
+
config + |
+I3C controller configuration. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+Failed to obtain the I3C controller configuration. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+I3C controller handle. + |
+
config + |
+I3C controller configuration. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+Failed to configure the I3C controller. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+I3C controller handle. + |
+
addr + |
+I3C device address. + |
+
func + |
+Callback used to return the IBI. + |
+
payload + |
+IBI payload. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+Failed to request the IBI. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+I3C controller handle. + |
+
addr + |
+I3C device address. + |
+
Return Value + |
+Description + |
+
0 + |
+The operation is successful. + |
+
Negative number + |
+Failed to release the IBI. + |
+
Parameter + |
+Description + |
+
---|---|
handle + |
+I3C controller handle. + |
+