Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
ptu.h
Go to the documentation of this file.
1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
2  *
3  * The information contained herein is property of Nordic Semiconductor ASA.
4  * Terms and conditions of usage are described in detail in NORDIC
5  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6  *
7  * Licensees are granted free, non-transferable use of the information. NO
8  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9  * the file.
10  *
11  */
12 
20 #ifndef __PTU_H__
21 #define __PTU_H__
22 
23 #include <stdint.h>
24 
25 #include "wpt.h"
26 #include "ble.h"
27 #include "app_timer.h"
28 #include "ptu_sm.h"
29 
30 typedef void (* ptu_sm_handler_t)(ptu_sm_signal_type_t signal);
31 typedef void (*app_sm_evt_handler_t) (ptu_sm_signal_type_t signal, const ptu_sm_state_vars_t * p_state_vars);
33 #define APP_TIMER_PRESCALER 0
34 #define APP_TIMER_OP_QUEUE_SIZE 19
36 #define PTU_SM_CURRENT_STATE() ptu_sm_execute((ptu_sm_signal_type_t)NULL, NULL)
38 /******************************************************************************/
39 
41 /******************************************************************************/
42 
47 void ptu_init(app_sm_evt_handler_t sm_evt_handler);
48 
53 void ptu_on_ble_evt(ble_evt_t * p_ble_evt);
54 
58 void ptu_start(void);
59 
62 #endif /* __PTU_H__ */
63 
void(* ptu_sm_handler_t)(ptu_sm_signal_type_t signal)
Definition: ptu.h:30
void(* app_sm_evt_handler_t)(ptu_sm_signal_type_t signal, const ptu_sm_state_vars_t *p_state_vars)
Definition: ptu.h:31
State machine state variables.
Definition: ptu_sm.h:67
ptu_sm_signal_type_t
PTU signal type.
Definition: ptu_sm.h:48
void ptu_start(void)
Start ptu profile. Here "start" means that profile can start generating events through ptu_evt_handle...
Definition: ptu.c:364
void ptu_on_ble_evt(ble_evt_t *p_ble_evt)
Dispatches a BLE stack event to PTU.
Definition: ptu.c:319
void ptu_init(app_sm_evt_handler_t sm_evt_handler)
Initialize PTU. This function must be called before any other PTU function can be called...
Definition: ptu.c:331