-
Notifications
You must be signed in to change notification settings - Fork 0
Add embedded sharepoint, MCP23S17 driver and basic tests #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
531fe9e
rename software folder to firmware
changxu-liu c2729b9
set up embedded sharepoint
changxu-liu d847496
fix makefile showing flash successful even when not (fix in Embedded-…
changxu-liu 0273a31
MCP23S17 GPIO expander driver
changxu-liu 23f06cb
update makefile to give build failure message, remove madefile when r…
changxu-liu f1067b1
add blank line to nix_thing.sh
changxu-liu 72e8923
fix TEST capitalization in makefile, change formatting
changxu-liu f50f21d
add MCP23S17 datasheet
changxu-liu 5b82495
change pin type to uint16_t because HAL convention
changxu-liu 9d4e8af
add register descriptions
changxu-liu 92ac175
add enum comments
changxu-liu 3ffdfe0
address addressing double left-shift, comments
changxu-liu 7994c8b
move defines out of c file to header file
changxu-liu d17c3b5
update function documentation comments, add comments for static funct…
changxu-liu c0c8f16
remove unnecessary comment
changxu-liu 74c2594
function comment update
changxu-liu ac404d7
change functions to return status
changxu-liu 42ed81a
make more functions return status
changxu-liu 454a561
update documentation returning status, other things
changxu-liu 191f4fa
improve addressing comment
changxu-liu d494a91
move uint8_to_binary_str to utilities file
changxu-liu 9e15fbf
add pin defines to file
changxu-liu acb3c0a
add descriptions to tests
changxu-liu a62ba02
add blank lines
changxu-liu 38f02fe
add todo
changxu-liu fcd25b8
add _t to type names for enums and structs
changxu-liu f210241
RTOSify MCP23S17 driver
changxu-liu 2b61d4e
update constant names, update comments, clean up
changxu-liu ac748de
update MCP23S17 init function for less arguments, change configuratio…
changxu-liu da3d30f
updated MCP23S17 test for RTOS - untested as don't have TestBoard_TPS…
changxu-liu 6ec641c
add github build action
changxu-liu 513e7b6
add github build action (attempt 2)
changxu-liu b470d51
add github build action (attempt 3)
changxu-liu 014a6b4
add github build action (attempt 4)
changxu-liu 254f5c3
add github build action (attempt 5)
changxu-liu a231b80
add github build action (attempt 6)
changxu-liu 9aaf389
add units to SPI delay names
changxu-liu 2045a89
fix tests
changxu-liu 212da27
change Pins, SPI, and UART files structure
changxu-liu c2149ce
add device and data null check
changxu-liu fdd8b82
move encoding of data before taking SPI mutex
changxu-liu e24da2b
move CS stuff to static inline function
changxu-liu 637bdbd
lakshay being picky picky picky
changxu-liu 9ecf93c
fix spi cs and mutex not returning to original state if spi transmiss…
changxu-liu ed9f7fb
fix discarding status return if not 🙂 (as now there's more statuses)
changxu-liu ab3dcf1
fix spi cs and mutex not returning to original state if HAL spi funct…
changxu-liu 2d54ef9
lakshay lies
changxu-liu 6258117
put SPI message length into variable
changxu-liu b19b3a8
add checks for spi mutex and sempahore null
changxu-liu 28ad4b6
move SPI interrupt functions ot SPI file
changxu-liu 19e3f9b
move SPI mutex and done semaphore setup to function in SPI file
changxu-liu 2a20d58
make SPI interrupt priority a define
changxu-liu 09a9835
move private functions to c file
changxu-liu 9edfb8f
fix dummy send failures potential to lock up SPI mutex
changxu-liu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Submodule Embedded-Sharepoint
added at
2bdaa5
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| # CRAZY COLORS ---------------------------------------------------------------- | ||
| RED=\033[0;31m | ||
| GREEN=\033[0;32m | ||
| ORANGE=\033[0;33m | ||
| BLUE=\033[0;34m | ||
| PURPLE=\033[0;35m | ||
| CYAN=\033[0;36m | ||
| LIGHTGRAY=\033[0;37m | ||
| DARKGRAY=\033[1;30m | ||
| YELLOW=\033[0;33m | ||
| NC=\033[0m # No Color | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
| # generate paths | ||
| MAKEFILE_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
|
||
| # PROJECT CONFIGURATION ------------------------------------------------------- | ||
| TEST ?= main | ||
|
|
||
| # COMMON TARGETS | ||
| # LSOM: stm32g473xx | ||
| # PSOM: stm32l431cbt | ||
| # FAT NUCLEO: stm32g474xx | ||
| # BAD NUCLEO: stm32l432kcu | ||
| PROJECT_TARGET ?= stm32l432kcu | ||
|
|
||
| # SOURCE AND INCLUDE DIRECTORIES | ||
| PROJECT_C_INCLUDES = $(wildcard core/inc) $(wildcard ../driver/inc) | ||
| PROJECT_C_SOURCES = $(wildcard core/src/*.c) $(wildcard ../driver/src/*.c) | ||
| PROJECT_MAIN_DIR ?= core/src | ||
|
|
||
| # BUILD DIRECTORIES | ||
| PROJECT_BUILD_DIR = build | ||
| BUILD_MAKEFILE_DIR ?= ../Embedded-Sharepoint | ||
|
|
||
| MADEFILE ?= true | ||
| MADEFILE_DIR = ${MAKEFILE_DIR} | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| # remove main and add test folders if running test | ||
| ifneq ($(TEST), "main") | ||
| PROJECT_C_SOURCES := $(filter-out $(PROJECT_MAIN_DIR)/main.c, $(PROJECT_C_SOURCES)) | ||
| PROJECT_C_SOURCES += $(wildcard test/src/${test}.c) | ||
|
|
||
| PROJECT_C_INCLUDES += $(wildcard /test/inc) | ||
| endif | ||
|
|
||
| # Convert relative paths to absolute paths for passing to Embedded-Sharepoint build | ||
| PROJECT_C_SOURCES := $(addprefix $(MAKEFILE_DIR)/, $(PROJECT_C_SOURCES)) | ||
| PROJECT_C_INCLUDES := $(addprefix $(MAKEFILE_DIR)/, $(PROJECT_C_INCLUDES)) | ||
|
|
||
| # Debug | ||
| PRINT_DEBUG ?= true | ||
|
|
||
| ifeq ($(PRINT_DEBUG), true) | ||
| $(info SOURCES: $(PROJECT_C_SOURCES)) | ||
| $(info INCLUDES: $(PROJECT_C_INCLUDES)) | ||
| endif | ||
|
|
||
| # generate paths (cont.d) | ||
| PROJECT_BUILD_DIR := $(addprefix $(MAKEFILE_DIR)/, $(PROJECT_BUILD_DIR)) | ||
|
|
||
| # export variables | ||
| export PROJECT_TARGET | ||
| export PROJECT_C_SOURCES | ||
| export PROJECT_C_INCLUDES | ||
| export PROJECT_BUILD_DIR | ||
|
|
||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # Clang | ||
| BEAR_PREFIX := | ||
| # check if bear is installed | ||
| BEAR_INSTALLED := $(shell command -v bear >/dev/null 2>&1 && echo yes || echo no) | ||
|
|
||
| # define path of .vscode (create if missing) | ||
| VS_CODE_DIR := $(MAKEFILE_DIR)/.vscode | ||
| $(shell mkdir -p $(VS_CODE_DIR)) | ||
|
|
||
| ifeq ($(BEAR_INSTALLED),yes) | ||
| BEAR_PREFIX := bear --output $(VS_CODE_DIR)/compile_commands.json --append -- | ||
| endif | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| # BUILD ----------------------------------------------------------------------- | ||
| ifeq ($(MAKECMDGOALS),) | ||
| default: build_code | ||
| else ifeq ($(MAKECMDGOALS), all) | ||
| all: build_code | ||
| else | ||
| %: | ||
| $(BEAR_PREFIX) $(MAKE) -C $(BUILD_MAKEFILE_DIR) $(MAKECMDGOALS) | ||
| endif | ||
|
|
||
|
|
||
| build_code: | ||
| ifeq ($(MADEFILE), true) | ||
| @echo -e "Make initiated at $(shell date)\n" > ${MADEFILE_DIR}/Madefile | ||
| endif | ||
|
|
||
| ifneq ($(TEST), main) | ||
| @echo -e "Making ${PURPLE}$(PROJECT_TARGET)${NC}build for ${BLUE}TEST=${PURPLE} ${TEST}${NC}" | ||
| ifeq ($(MADEFILE), true) | ||
| @echo -e "Making $(PROJECT_TARGET) build for TEST=${TEST}\n" >> ${MADEFILE_DIR}/Madefile | ||
| endif | ||
|
changxu-liu marked this conversation as resolved.
|
||
| else | ||
| @echo -e "Making ${PURPLE}$(PROJECT_TARGET)${NC}build with ${ORANGE}main.${NC}" | ||
| ifeq ($(MADEFILE), true) | ||
| @echo -e "Making $(PROJECT_TARGET) build with main.\n" >> ${MADEFILE_DIR}/Madefile | ||
| endif | ||
| endif | ||
|
|
||
| ifeq ($(MADEFILE), true) | ||
| @set -o pipefail; if $(BEAR_PREFIX) $(MAKE) -C $(BUILD_MAKEFILE_DIR) all -j | tee -a ${MADEFILE_DIR}/Madefile; then \ | ||
| echo -e "${GREEN}Compiled! Splendid! Jolly Good!!!\n${NC}"; \ | ||
| echo -e "\nCompiled! Splendid! Jolly Good!!\n" >> ${MADEFILE_DIR}/Madefile; \ | ||
| else \ | ||
| echo -e "${RED}Build failure.\n${NC}"; \ | ||
| echo -e "\nBuild failure.\n" >> ${MADEFILE_DIR}/Madefile; \ | ||
| exit 1; \ | ||
| fi | ||
| else | ||
| @set -o pipefail; if $(BEAR_PREFIX) $(MAKE) -C $(BUILD_MAKEFILE_DIR) all -j; then \ | ||
| echo -e "${GREEN}Compiled! Splendid! Jolly Good!!!\n${NC}"; \ | ||
| else \ | ||
| echo -e "${RED}Build failure.\n${NC}"; \ | ||
| exit 1; \ | ||
| fi | ||
| endif | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| # FLASH ----------------------------------------------------------------------- | ||
| flash: | ||
| @set -o pipefail; if $(MAKE) -C $(BUILD_MAKEFILE_DIR) flash; then \ | ||
| echo -e "${GREEN}Flash successful.\n${NC}"; \ | ||
| else \ | ||
| echo -e "${RED}Flash failure.\n${NC}"; \ | ||
| exit 1; \ | ||
| fi | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| # CLEAN ----------------------------------------------------------------------- | ||
| clean: | ||
| $(MAKE) -C $(BUILD_MAKEFILE_DIR) clean | ||
| -rm -fR $(MADEFILE_DIR)/Madefile | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| # DOCUMENTATION --------------------------------------------------------------- | ||
| # .PHONY: docs | ||
| # docs: | ||
| # cd $(BUILD_MAKEFILE_DIR) && mkdocs serve | ||
| # ----------------------------------------------------------------------------- | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // main.c | ||
|
|
||
| // INCLUDES ------------------------------------------------------------------- | ||
|
|
||
|
|
||
| // DEFINES -------------------------------------------------------------------- | ||
|
|
||
|
|
||
| // CONFIGURATION HANDLES/STRUCTS ---------------------------------------------- | ||
|
|
||
|
|
||
| // FUNCTION DECLARATIONS ------------------------------------------------------ | ||
|
|
||
|
|
||
| // GLOBAL VARIABLES ----------------------------------------------------------- | ||
|
|
||
|
|
||
| int main() | ||
| { | ||
| return 0; | ||
| } | ||
|
changxu-liu marked this conversation as resolved.
|
||
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.