#include <stdlib.h>
#include <string.h>
#include "mcu.h"
#define EXECUTION_TIME_US 500
#define GET_TEMPERATURE_EP 12
#define SEND_TEMPERATURE_EP 13
static uint32_t m_temperature = 0;
uint32_t send_temperature(void)
{
.
bytes = (
const uint8_t *) &m_temperature,
.num_bytes = sizeof(m_temperature),
.src_endpoint = SEND_TEMPERATURE_EP,
.dest_endpoint = SEND_TEMPERATURE_EP,
};
}
static void temp_interrupt_handler(void)
{
NRF_TEMP->INTENCLR = 1;
if (NRF_TEMP->EVENTS_DATARDY != 0)
{
m_temperature = NRF_TEMP->TEMP;
}
else
{
m_temperature = 0;
}
EXECUTION_TIME_US);
}
const shared_data_item_t * item,
{
(void) item;
(void) data;
m_temperature = 0;
NRF_TEMP->TASKS_START = 1;
NRF_TEMP->INTENSET = 1;
}
static shared_data_item_t unicast_packets_filter =
{
.cb = unicastDataReceivedCb,
.filter = {
.src_endpoint = -1,
.dest_endpoint = GET_TEMPERATURE_EP,
.multicast_cb = NULL
}
};
{
(void) functions;
{
return;
}
lib_state->startStack();
}
app_scheduler_res_e App_Scheduler_addTask_execTime(task_cb_f cb, uint32_t delay_ms, uint32_t exec_time_us)
Add a task.
#define APP_SCHEDULER_SCHEDULE_ASAP
Value to return from task or as initial time to be executed ASAP.
__STATIC_INLINE app_res_e configureNodeFromBuildParameters()
Wrapper on top of configureNode to get parameters from build system and hardcoded values from chip (f...
@ SHARED_DATA_NET_MODE_UNICAST
app_lib_data_send_res_e Shared_Data_sendData(app_lib_data_to_send_t *data, app_lib_data_data_sent_cb_f sent_cb)
Send data. The packet to send is represented as a app_lib_data_to_send_t struct.
app_res_e Shared_Data_addDataReceivedCb(shared_data_item_t *item)
Add a new packet received item to the list. If the item is already in the list it is only updated.
List of global functions, passed to App_entrypoint()
app_lib_data_receive_res_e
Return value of data reception callback.
@ APP_LIB_DATA_RECEIVE_RES_HANDLED
A struct for lib_data->sendData().
Struct passed to data reception callback functions.
#define APP_LIB_SYSTEM_STOP_PERIODIC
Constant to stop periodic callback.
#define APP_LIB_SYSTEM_IRQ_PRIO_LO