Hamid-R-Tanhaei / RFID-MIFARE-RC522-ARM-STM32

A demo project of driving RC522 RFID module through STM32

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RC522_CS_GPIO_Port not found

maxstain opened this issue · comments

Hello, where can I find RC522_CS_GPIO_Port ?

Hello, where can I find RC522_CS_GPIO_Port ?

Hi, the RC522_CS pin on the sensor board is marked as SDA:

sensorBoard

You can just assign a random GPIO pin as an output and add the "RC522_CS" label onto it. This will ensure that you don't have to change the library:

mxSetup

Just in case you don't know about labeling pins in CubeMX, here is a quick explanation:

You can assign custom labels to pins in the System Core > GPIO section. Just pick a pin that you have already configured as a GPIO pin and go to its settings. You can see that there is a text input for User Label.

Once you have labeled a pin, you can refer to it using your label like so:

Instead of writing:

HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET);

You will be able to write:

HAL_GPIO_WritePin(RC522_CS_GPIO_Port, RC522_CS_Pin, GPIO_PIN_RESET);