|
smartnfc 2.2.0
|
API for configuring and manipulating Smart NFC Click driver. More...
Topics | |
| Smart NFC Device Settings | |
| Settings for registers of Smart NFC Click driver. | |
| Smart NFC MikroBUS Map | |
| MikroBUS pin mapping of Smart NFC Click driver. | |
Functions | |
| void | smartnfc_cfg_setup (smartnfc_cfg_t *cfg) |
| Smart NFC configuration object setup function. | |
| err_t | smartnfc_init (smartnfc_t *ctx, smartnfc_cfg_t *cfg) |
| Smart NFC initialization function. | |
| err_t | smartnfc_generic_write (smartnfc_t *ctx, uint8_t *data_in, uint16_t len) |
| Smart NFC data writing function. | |
| err_t | smartnfc_generic_read (smartnfc_t *ctx, uint8_t *data_out, uint16_t len) |
| Smart NFC data reading function. | |
| void | smartnfc_set_rst_pin (smartnfc_t *ctx, uint8_t state) |
| Smart NFC set RST pin function. | |
| err_t | smartnfc_reset_device (smartnfc_t *ctx) |
| Smart NFC reset device function. | |
| err_t | smartnfc_send_frame (smartnfc_t *ctx) |
| Smart NFC send frame function. | |
| err_t | smartnfc_read_frame (smartnfc_t *ctx) |
| Smart NFC read frame function. | |
| err_t | smartnfc_read_ack_frame (smartnfc_t *ctx, uint8_t cmd) |
| Smart NFC read ack frame function. | |
| void | smartnfc_clear_buffers (smartnfc_t *ctx) |
| Smart NFC clear buffers function. | |
API for configuring and manipulating Smart NFC Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void smartnfc_cfg_setup | ( | smartnfc_cfg_t * | cfg | ) |
Smart NFC configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See smartnfc_cfg_t object definition for detailed explanation. |
| void smartnfc_clear_buffers | ( | smartnfc_t * | ctx | ) |
Smart NFC clear buffers function.
This function clears the ring buffers and the response frame object.
| [in] | ctx | : Click context object. See smartnfc_t object definition for detailed explanation. |
| err_t smartnfc_generic_read | ( | smartnfc_t * | ctx, |
| uint8_t * | data_out, | ||
| uint16_t | len ) |
Smart NFC data reading function.
This function reads a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See smartnfc_t object definition for detailed explanation. |
| [out] | data_out | : Output read data. |
| [in] | len | : Number of bytes to be read. |
>0 - Number of data bytes read, <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation. | err_t smartnfc_generic_write | ( | smartnfc_t * | ctx, |
| uint8_t * | data_in, | ||
| uint16_t | len ) |
Smart NFC data writing function.
This function writes a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See smartnfc_t object definition for detailed explanation. |
| [in] | data_in | : Data buffer for sending. |
| [in] | len | : Number of bytes for sending. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | err_t smartnfc_init | ( | smartnfc_t * | ctx, |
| smartnfc_cfg_t * | cfg ) |
Smart NFC initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See smartnfc_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See smartnfc_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t smartnfc_read_ack_frame | ( | smartnfc_t * | ctx, |
| uint8_t | cmd ) |
Smart NFC read ack frame function.
This function waits for the desired acknowledge frame to arrive and stores it in the Click context object.
| [in] | ctx | : Click context object. See smartnfc_t object definition for detailed explanation. |
| [in] | cmd | : Expected frame command byte. |
0 - Correct frame received, -1 - Error. | err_t smartnfc_read_frame | ( | smartnfc_t * | ctx | ) |
Smart NFC read frame function.
This function reads response frame from the ring buffer and stores it in the Click context object. It waits up to 1 second for a frame, and if there's no frame received it returns an error.
| [in] | ctx | : Click context object. See smartnfc_t object definition for detailed explanation. |
0 - Correct frame received, -1 - Error. See #err_t definition for detailed explanation. | err_t smartnfc_reset_device | ( | smartnfc_t * | ctx | ) |
Smart NFC reset device function.
This function resets the device by toggling the reset pin logic state.
| [in] | ctx | : Click context object. See smartnfc_t object definition for detailed explanation. |
0 - Correct frame received, -1 - Error. | err_t smartnfc_send_frame | ( | smartnfc_t * | ctx | ) |
Smart NFC send frame function.
This function sends a desired command frame from the Click context object.
| [in] | ctx | : Click context object. See smartnfc_t object definition for detailed explanation. |
0 - Frame is sent, -1 - Timeout error. | void smartnfc_set_rst_pin | ( | smartnfc_t * | ctx, |
| uint8_t | state ) |
Smart NFC set RST pin function.
This function sets the RESET pin logic state.
| [in] | ctx | : Click context object. See smartnfc_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |