Waveshare NRF52840 User Manual page 42

Eval kit
Table of Contents

Advertisement

NRF52840 Eval Kit User Manual
In main.c file, the process to start NFC are that:
1. Set interrupt callback function and initialize NFC:
2. Encode NFC information
3. Load NFC information to NFC end
4. Start NRF
int
main(void)
{
uint32_t
len;
uint32_t
err_code;
//Init log
log_init();
//Init led
bsp_board_init(BSP_INIT_LEDS);
//set NFC with a callback
err_code
= nfc_t2t_setup(nfc_callback, NULL);
APP_ERROR_CHECK(err_code);
//provide available buffer size for encoding function
len
= sizeof(m_ndef_msg_buf);
//Encode launchapp message into buffer
err_code
= nfc_launchapp_msg_encode(m_android_package_name,
APP_ERROR_CHECK(err_code);
//Set created message as the NFC payload
err_code
= nfc_t2t_payload_set(m_ndef_msg_buf, len);
APP_ERROR_CHECK(err_code);
//Start sensing NFC field
err_code
= nfc_t2t_emulation_start();
APP_ERROR_CHECK(err_code);
while
(1)
{
NRF_LOG_FLUSH();
__WFE();
}
}
Vision: V1.0.1 Date: 2019.01.19
sizeof(m_android_package_name),
m_windows_application_id,
sizeof(m_windows_application_id),
m_ndef_msg_buf,
&len);
42 / 72

Advertisement

Table of Contents
loading

Table of Contents