Contiki-NG
sched.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 /**
31  * \addtogroup cc13xx-cc26xx-rf
32  * @{
33  *
34  * \defgroup cc13xx-cc26xx-rf-sched RF Scheduler for CC13xx/CC26xx
35  *
36  * @{
37  *
38  * \file
39  * Header file of the CC13xx/CC26xx RF scheduler.
40  * \author
41  * Edvard Pettersen <e.pettersen@ti.com>
42  */
43 /*---------------------------------------------------------------------------*/
44 #ifndef RF_SCHED_H_
45 #define RF_SCHED_H_
46 /*---------------------------------------------------------------------------*/
47 #include "contiki.h"
48 #include "sys/process.h"
49 /*---------------------------------------------------------------------------*/
50 #include <ti/drivers/rf/RF.h>
51 /*---------------------------------------------------------------------------*/
52 #include <stdbool.h>
53 /*---------------------------------------------------------------------------*/
54 PROCESS_NAME(rf_sched_process);
55 /*---------------------------------------------------------------------------*/
56 typedef enum {
57  RF_RESULT_OK = 0,
58  RF_RESULT_ERROR,
59 } rf_result_t;
60 /*---------------------------------------------------------------------------*/
61 /**
62  * \name Common RF scheduler functionality.
63  *
64  * @{
65  */
66 rf_result_t rf_yield(void);
67 rf_result_t rf_set_tx_power(RF_Handle handle, RF_TxPowerTable_Entry *table, int8_t dbm);
68 rf_result_t rf_get_tx_power(RF_Handle handle, RF_TxPowerTable_Entry *table, int8_t *dbm);
69 /** @} */
70 /*---------------------------------------------------------------------------*/
71 /**
72  * \name Nestack Radio scheduler functionality.
73  *
74  * Either for Prop-mode or IEEE-mode Radio driver.
75  *
76  * @{
77  */
78 RF_Handle netstack_open(RF_Params *params);
79 rf_result_t netstack_sched_fs(void);
80 rf_result_t netstack_sched_ieee_tx(bool ack_request);
81 rf_result_t netstack_sched_prop_tx(void);
82 rf_result_t netstack_sched_rx(bool start);
83 rf_result_t netstack_stop_rx(void);
84 /** @} */
85 /*---------------------------------------------------------------------------*/
86 /**
87  * \name BLE Radio scheduler functionality.
88  *
89  * Only for the BLE Beacon Daemon.
90  *
91  * @{
92  */
93 RF_Handle ble_open(RF_Params *params);
94 rf_result_t ble_sched_beacon(RF_Callback cb, RF_EventMask bm_event);
95 /** @} */
96 /*---------------------------------------------------------------------------*/
97 #endif /* RF_SCHED_H_ */
98 /*---------------------------------------------------------------------------*/
99 /**
100  * @}
101  * @}
102  */
static bool start(void)
Start measurement.
#define PROCESS_NAME(name)
Declare the name of a process.
Definition: process.h:286
Header file for the Contiki process interface.