Add .gitignore file and refactor llcc68 component

- Added a comprehensive .gitignore file to exclude unnecessary files and directories for various platforms and tools.
- Removed the llcc68.cpp source file as part of the refactoring process.
- Updated llcc68.hpp to replace the `init_exti` function declaration with inline interrupt configuration logic.
- Changed `EXTI_PIN` to `EXTI_PINS` for clarity and consistency.
- Refactored the handling of CAD parameters and improved type safety by using `enum class` for `CAD_EXIT_MODE` and `CAD_SYMB`.
This commit is contained in:
2025-05-15 11:20:50 +08:00
parent 162dbad6e1
commit b99d063bd8
6 changed files with 1163 additions and 148 deletions

View File

@ -1,42 +0,0 @@
//
// Created by Kurosu Chan on 2024/1/17.
//
#include "llcc68.hpp"
#include "driver/gpio.h"
#include "app_const_llcc68.hpp"
constexpr auto ESP_INTR_FLAG_DEFAULT = 0;
namespace app::driver::llcc68 {
namespace details {
uint32_t __tcxo_delay__;
transmit_state_t __tx_state__;
// TODO: use freeRTOS queue to handle received data
bool __dio_flag__ = false;
}
void init_exti() {
constexpr auto isr = [](void *param) {
details::__dio_flag__ = true;
};
uint64_t pin_bit_mask = 0;
for (const auto pin : EXTI_PIN) {
pin_bit_mask |= (1ULL << pin);
}
gpio_config_t io_conf = {
.pin_bit_mask = pin_bit_mask,
.mode = GPIO_MODE_INPUT,
.pull_up_en = GPIO_PULLUP_DISABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.intr_type = GPIO_INTR_POSEDGE,
};
// https://github.com/espressif/esp-idf/blob/v5.3.2/examples/peripherals/gpio/generic_gpio/main/gpio_example_main.c
ESP_ERROR_CHECK(gpio_config(&io_conf));
gpio_install_isr_service(ESP_INTR_FLAG_DEFAULT);
for (const auto pin : EXTI_PIN) {
gpio_isr_handler_add(pin, isr, nullptr);
}
}
}