Appiko
hal_radio.h
1 /*
2  * hal_radio.h : Basic driver for Radio peripheral
3  * Copyright (C) 2019 Appiko
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
28 #ifndef HAL_RADIO_H
29 #define HAL_RADIO_H
30 
31 #include "stdbool.h"
32 #include "nrf_util.h"
33 #include "stdint.h"
34 
35 
39 typedef struct
40 {
42  uint32_t freq;
46  void (* tx_done_handler) (void * p_buff, uint32_t len);
48  void (* rx_done_handler) (void * p_buff, uint32_t len);
50 
55 void hal_radio_init (hal_radio_config_t * radio_init_config);
56 
62 void hal_radio_set_tx_payload_data (void * p_payload, uint32_t len);
63 
67 void hal_radio_start_tx ();
68 
72 void hal_radio_start_rx ();
73 
77 void hal_radio_stop ();
78 
82 void hal_radio_deinit ();
83 
90 bool hal_radio_is_on ();
91 
92 //For future development
93 
94 /***/
95 //void hal_radio_update_freq (uint32_t new_freq);
96 
97 #endif /* HAL_RADIO_H */
98 
99 
bool hal_radio_is_on()
Function to check status of radio peripheral.
Definition: hal_radio.c:176
void hal_radio_deinit()
Function to de-initiate the radio peripheral.
Definition: hal_radio.c:167
void hal_radio_start_rx()
Function to start data reception.
Definition: hal_radio.c:156
app_irq_priority_t
Priority levels that the application can use based on whether the SoftDevice (SD) is used.
Definition: nrf_util.h:63
void hal_radio_set_tx_payload_data(void *p_payload, uint32_t len)
Function to Set the payload data for transmission.
Definition: hal_radio.c:144
void hal_radio_init(hal_radio_config_t *radio_init_config)
Function to Initiate Radio peripheral.
Definition: hal_radio.c:75
void hal_radio_start_tx()
Function to start data transmission.
Definition: hal_radio.c:150
Structure used to store the data required for radio configuration.
Definition: hal_radio.h:39
void hal_radio_stop()
Function to stop radio peripheral.
Definition: hal_radio.c:161
app_irq_priority_t irq_priority
Definition: hal_radio.h:44