-
Notifications
You must be signed in to change notification settings - Fork 203
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
Showing
10 changed files
with
521 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# The following lines of boilerplate have to be in your project's CMakeLists | ||
# in this exact order for cmake to work correctly | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
set(EXTRA_COMPONENTS_DIRS "./components") | ||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
|
||
project(lcd) | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# This is a project Makefile. It is assumed the directory this Makefile resides in is a | ||
# project subdirectory. | ||
# | ||
|
||
PROJECT_NAME := lcd | ||
|
||
include $(IDF_PATH)/make/project.mk | ||
|
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# RFID-RC522 ESP32示范 | ||
|
||
此工程展示了 ESP32 驱动 RFID-RC522 的驱动示范! | ||
|
||
IDF工程:`origin/release/v4.2` | ||
|
||
commit:`cd4fa46f5372a552a67452313d246d4d09d2b39f` | ||
|
||
* ESP32 -- RC522连接 | ||
|
||
RC522|MISO|MOSI|SCK|SDA | ||
---|---| ---|---| --- | ||
ESP32 |GPIO25|GPIO23|GPIO19|GPIO22 |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(COMPONENT_SRCS "rc522.c") | ||
set(COMPONENT_ADD_INCLUDEDIRS "include") | ||
|
||
register_component() |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# | ||
# "main" pseudo-component makefile. | ||
# | ||
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) | ||
|
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#pragma once | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include "driver/spi_master.h" | ||
#include "driver/spi_common_internal.h" | ||
|
||
typedef void(*rc522_tag_callback_t)(uint8_t*); | ||
|
||
typedef struct { | ||
int miso_io; | ||
int mosi_io; | ||
int sck_io; | ||
int sda_io; | ||
rc522_tag_callback_t callback; | ||
} rc522_start_args_t; | ||
|
||
esp_err_t rc522_spi_init(int miso_io, int mosi_io, int sck_io, int sda_io); | ||
esp_err_t rc522_write_n(uint8_t addr, uint8_t n, uint8_t *data); | ||
esp_err_t rc522_write(uint8_t addr , uint8_t val); | ||
uint8_t* rc522_read_n(uint8_t addr, uint8_t n) ; | ||
uint8_t rc522_read(uint8_t addr); | ||
#define rc522_fw_version() rc522_read(0x37) | ||
esp_err_t rc522_init(); | ||
|
||
esp_err_t rc522_set_bitmask(uint8_t addr, uint8_t mask); | ||
esp_err_t rc522_clear_bitmask(uint8_t addr, uint8_t mask); | ||
esp_err_t rc522_antenna_on(); | ||
uint8_t* rc522_calculate_crc(uint8_t *data, uint8_t n); | ||
uint8_t* rc522_card_write(uint8_t cmd, uint8_t *data, uint8_t n, uint8_t* res_n); | ||
uint8_t* rc522_request(uint8_t* res_n); | ||
uint8_t* rc522_anticoll(); | ||
uint8_t* rc522_get_tag(); | ||
esp_err_t rc522_start(rc522_start_args_t start_args); | ||
esp_err_t rc522_resume(); | ||
esp_err_t rc522_pause(); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Oops, something went wrong.