Skip to content

Commit

Permalink
initial gpio for nfc and reader
Browse files Browse the repository at this point in the history
  • Loading branch information
solosky committed Feb 25, 2024
1 parent a268db4 commit 9ceda3b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ fw/.settings
fw/_build
fw/.idea


fw/application/.settings
fw/application/_build
fw/application/.idea

fw/src/amiibo_private.c
fw/src/version.inc.h
fw/src/version.json
Expand Down
2 changes: 1 addition & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"DEBUG_NRF",
"M_USE_THREAD_BACKEND=0"
],
"compilerPath": "D:/dev/SDKs/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc.exe",
"compilerPath": "arm-none-eabi-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "windows-gcc-arm"
Expand Down
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "Pixl.js JLink Debug",
"cwd": "${workspaceRoot}",
"executable": "fw/_build/pixljs.out",
"armToolchainPath": "D:/dev/SDKs/gcc-arm-none-eabi-10-2020-q4-major/bin",
"armToolchainPath": "",
"request": "launch",
"type": "cortex-debug",
"servertype": "jlink",
Expand All @@ -22,7 +22,7 @@
"name": "Pixl.js Pyocd Debug",
"cwd": "${workspaceRoot}",
"executable": "fw/_build/pixljs.out",
"armToolchainPath": "D:/dev/SDKs/gcc-arm-none-eabi-10-2020-q4-major/bin",
"armToolchainPath": "",
"request": "launch",
"type": "cortex-debug",
"servertype": "pyocd",
Expand Down Expand Up @@ -52,7 +52,7 @@
"name": "Pixl.js BL JLink Debug",
"cwd": "${workspaceRoot}",
"executable": "fw/_build/bootloader.out",
"armToolchainPath": "D:/dev/SDKs/gcc-arm-none-eabi-10-2020-q4-major/bin",
"armToolchainPath": "",
"request": "launch",
"type": "cortex-debug",
"servertype": "jlink",
Expand Down
2 changes: 1 addition & 1 deletion fw/application/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ U8G2_ROOT := ../components/u8g2/csrc
CHAMELEON_ROOT :=$(COMP_DIR)/chameleon-ultra/firmware

APP_VERSION ?= 1
RELEASE ?= 1
RELEASE ?= 0
BOARD ?= NEO


Expand Down
8 changes: 8 additions & 0 deletions fw/application/src/app/reader/nfc/nfc_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "rc522.h"

void nfc_reader_enter() {

nrf_gpio_pin_set(HF_ANT_SEL);
nrf_gpio_pin_set(RD_PWR);
bsp_timer_init();
Expand All @@ -26,6 +27,13 @@ void nfc_reader_exit() {
bsp_timer_uninit();
pcd_14a_reader_uninit();

nrf_gpio_pin_clear(HF_ANT_SEL);
nrf_gpio_pin_clear(RD_PWR);
}

void nfc_reader_init(){
nrf_gpio_cfg_output(HF_ANT_SEL);
nrf_gpio_cfg_output(RD_PWR);
nrf_gpio_pin_clear(HF_ANT_SEL);
nrf_gpio_pin_clear(RD_PWR);
}
1 change: 1 addition & 0 deletions fw/application/src/app/reader/nfc/nfc_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "app_status.h"


void nfc_reader_init();
void nfc_reader_enter();
void nfc_reader_exit();

Expand Down
2 changes: 1 addition & 1 deletion fw/application/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ int main(void) {

#ifdef RC522
//nfc initialized as emulator mode
//nfc_reader_exit();
nfc_reader_init();
#endif

chrg_init();
Expand Down

0 comments on commit 9ceda3b

Please sign in to comment.