Skip to content

Commit

Permalink
esp_hap_platform: Add support for ESP32C3
Browse files Browse the repository at this point in the history
  • Loading branch information
lhespress authored and shahpiyushv committed Mar 18, 2021
1 parent 389189a commit ff1e21a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
## Introduction

[HomeKit](https://developer.apple.com/homekit/) is a framework developed by Apple for communicating with and controlling connected accessories in a user’s home using iOS devices.
ESP HomeKit SDK has been developed in-house by Espressif to build Apple HomeKit compatible accessories using ESP32/ESP32-S2/ESP8266 SoCs.
ESP HomeKit SDK has been developed in-house by Espressif to build Apple HomeKit compatible accessories using ESP32/ESP32-S2/ESP32-C3/ESP8266 SoCs.

> Note: If you want to use HomeKit for commercial products, please check [here](https://www.espressif.com/en/products/sdks/esp-homekit-sdk) for access to the MFi variant of this SDK. It has the exact same APIs as this and so, moving to it should be easy. However, commercial HomeKit products can be built only with ESP32/ESP32-S2 since ESP8266 cannot meet all the HomeKit Certification requirements.
> Note: If you want to use HomeKit for commercial products, please check [here](https://www.espressif.com/en/products/sdks/esp-homekit-sdk) for access to the MFi variant of this SDK. It has the exact same APIs as this and so, moving to it should be easy. However, commercial HomeKit products can be built only with ESP32/ESP32-S2/ESP32-C3 since ESP8266 cannot meet all the HomeKit Certification requirements.
> If you want to use a port of Apple's ADK instead, please check [here](https://github.com/espressif/esp-apple-homekit-adk)
Expand Down Expand Up @@ -39,14 +39,14 @@ git clone --recursive https://github.com/espressif/esp-homekit-sdk.git

### Compile and Flash

You can use esp-homekit-sdk with any ESP32, ESP32-S2 or ESP8266 board (though we have tested only with the ESP32-DevKit-C, ESP32-S2-Saola-1 and ESP8266-DevKit-C). We have provided multiple examples for reference. Compile and flash as below (fan used as example):
You can use esp-homekit-sdk with any ESP32, ESP32-S2, ESP32-C3 or ESP8266 board (though we have tested only with the ESP32-DevKit-C, ESP32-S2-Saola-1, ESP32-C3-DevKit-M-1, ESP8266-DevKit-C). We have provided multiple examples for reference. Compile and flash as below (fan used as example):

**For ESP32/ESP32-S2**
**For ESP32/ESP32-S2/ESP32-C3**

```text
$ cd /path/to/esp-homekit-sdk/examples/fan
$ export ESPPORT=/dev/tty.SLAB_USBtoUART #Set your board's serial port here
$ idf.py set-target <esp32/esp32s2>
$ idf.py set-target <esp32/esp32s2/esp32c3>
$ idf.py flash monitor
```

Expand Down
2 changes: 2 additions & 0 deletions components/homekit/esp_hap_platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ menu "MFi I2C Setup"
int "SDA GPIO"
default 26 if IDF_TARGET_ESP32
default 4 if IDF_TARGET_ESP32S2
default 5 if IDF_TARGET_ESP32C3
default 2 if IDF_TARGET_ESP8266
help
GPIO for SDA - please check schematic carefully
Expand All @@ -29,6 +30,7 @@ menu "MFi I2C Setup"
int "SCL GPIO"
default 27 if IDF_TARGET_ESP32
default 5 if IDF_TARGET_ESP32S2
default 6 if IDF_TARGET_ESP32C3
default 14 if IDF_TARGET_ESP8266
help
GPIO for SCL - please check schematic carefully
Expand Down
4 changes: 4 additions & 0 deletions components/homekit/esp_hap_platform/src/esp_mfi_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
#ifdef CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/ets_sys.h"
#else
#ifdef CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/ets_sys.h"
#else
#include "esp32/rom/ets_sys.h"
#endif
#endif

#ifdef CONFIG_I2C_SOFTWARE
#include "driver/gpio.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/common/app_wifi/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ menu "App Wi-Fi"
config APP_WIFI_PROV_TRANSPORT_BLE
bool "BLE"
select BT_ENABLED
depends on IDF_TARGET_ESP32
depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32C3
endchoice

config APP_WIFI_PROV_TRANSPORT
Expand Down

0 comments on commit ff1e21a

Please sign in to comment.