-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3964de
commit 2bd4690
Showing
6 changed files
with
47 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
# Define the source and include directories | ||
set(INCLUDE_DIRS Inc Inc/unit_tests) | ||
set(SRC_DIR Src) | ||
# Define the base source and include directories relative to the component directory | ||
set(INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/Inc") | ||
set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/Src") | ||
|
||
# Automatically include all .c files in Core/Src and Core/Src/unit_tests | ||
file(GLOB SRC_FILES "${SRC_DIR}/*.c" "${SRC_DIR}/unit_tests/*.c") | ||
# Recursively include all .c files in Src and its subdirectories | ||
file(GLOB_RECURSE SRC_FILES "${SRC_DIR}/*.c") | ||
|
||
# Gather all directories in Inc, excluding files | ||
file(GLOB INCLUDE_DIR_PATHS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "${INCLUDE_DIRS}/*") | ||
list(FILTER INCLUDE_DIR_PATHS INCLUDE REGEX ".*[^\\.h]$") | ||
set(FINAL_INCLUDE_DIRS ${INCLUDE_DIRS} ${INCLUDE_DIR_PATHS}) | ||
|
||
# Register the component with ESP-IDF | ||
idf_component_register(SRCS ${SRC_FILES} | ||
INCLUDE_DIRS ${INCLUDE_DIRS} | ||
REQUIRES driver esp_timer) | ||
INCLUDE_DIRS ${FINAL_INCLUDE_DIRS} | ||
REQUIRES driver esp_timer freertos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,30 @@ | ||
#include "IO.h" | ||
#include "main.h" | ||
|
||
#include "driver/gpio.h" | ||
#include "driver/i2c_master.h" | ||
#include <stdio.h> | ||
|
||
/// @brief GPIO Pin Initialization | ||
/// @param None | ||
/// TODO: Set up pins that will be used as input and outputs for current monitoring | ||
void GPIO_init(void){ | ||
void GPIO_init(void) | ||
{ | ||
|
||
// Initializing GPIO0 as an input with a pulldown | ||
// TODO: Update with appropriate pins that will be used | ||
gpio_set_direction(GPIO_NUM_0,GPIO_MODE_OUTPUT); | ||
gpio_set_pull_mode(GPIO_NUM_0,GPIO_PULLDOWN_ONLY); | ||
gpio_set_direction(GPIO_NUM_0, GPIO_MODE_OUTPUT); | ||
gpio_set_pull_mode(GPIO_NUM_0, GPIO_PULLDOWN_ONLY); | ||
} | ||
|
||
/// @brief I2C Initialization | ||
/// @param None | ||
/// TODO: Set up pins that will be used as input and outputs for current monitoring | ||
void i2c_init(void) | ||
{ | ||
|
||
// Initializing GPIO0 as an input with a pulldown | ||
// TODO: Update with appropriate pins that will be used | ||
gpio_set_direction(GPIO_NUM_0, GPIO_MODE_OUTPUT); | ||
gpio_set_pull_mode(GPIO_NUM_0, GPIO_PULLDOWN_ONLY); | ||
} |
Empty file.