提交 | 用户 | age
|
483170
|
1 |
/* |
Q |
2 |
______ _ |
|
3 |
/ _____) _ | | |
|
4 |
( (____ _____ ____ _| |_ _____ ____| |__ |
|
5 |
\____ \| ___ | (_ _) ___ |/ ___) _ \ |
|
6 |
_____) ) ____| | | || |_| ____( (___| | | | |
|
7 |
(______/|_____)_|_|_| \__)_____)\____)_| |_| |
|
8 |
(C)2013 Semtech |
|
9 |
|
|
10 |
Description: SX126x driver specific target board functions implementation |
|
11 |
|
|
12 |
License: Revised BSD License, see LICENSE.TXT file include in the project |
|
13 |
|
|
14 |
Maintainer: Miguel Luis and Gregory Cristian |
|
15 |
*/ |
|
16 |
#ifndef __SX126x_ARCH_H__ |
|
17 |
#define __SX126x_ARCH_H__ |
|
18 |
|
|
19 |
#include "sx126x.h" |
|
20 |
/*! |
|
21 |
* \brief Initializes the radio I/Os pins interface |
|
22 |
*/ |
|
23 |
//void SX126xIoInit( void ); |
|
24 |
|
|
25 |
/*! |
|
26 |
* \brief Initializes DIO IRQ handlers |
|
27 |
* |
|
28 |
* \param [IN] irqHandlers Array containing the IRQ callback functions |
|
29 |
*/ |
|
30 |
//void SX126xIoIrqInit( DioIrqHandler dioIrq ); |
|
31 |
|
|
32 |
/*! |
|
33 |
* \brief De-initializes the radio I/Os pins interface. |
|
34 |
* |
|
35 |
* \remark Useful when going in MCU low power modes |
|
36 |
*/ |
|
37 |
//void SX126xIoDeInit( void ); |
|
38 |
|
|
39 |
/*! |
|
40 |
* \brief HW Reset of the radio |
|
41 |
*/ |
|
42 |
void SX126xReset( void ); |
|
43 |
|
|
44 |
/*! |
|
45 |
* \brief Blocking loop to wait while the Busy pin in high |
|
46 |
*/ |
|
47 |
void SX126xWaitOnBusy( void ); |
|
48 |
|
|
49 |
/*! |
|
50 |
* \brief Wakes up the radio |
|
51 |
*/ |
|
52 |
void SX126xWakeup( void ); |
|
53 |
|
|
54 |
/*! |
|
55 |
* \brief Send a command that write data to the radio |
|
56 |
* |
|
57 |
* \param [in] opcode Opcode of the command |
|
58 |
* \param [in] buffer Buffer to be send to the radio |
|
59 |
* \param [in] size Size of the buffer to send |
|
60 |
*/ |
|
61 |
void SX126xWriteCommand( RadioCommands_t opcode, uint8_t *buffer, uint16_t size ); |
|
62 |
|
|
63 |
/*! |
|
64 |
* \brief Send a command that read data from the radio |
|
65 |
* |
|
66 |
* \param [in] opcode Opcode of the command |
|
67 |
* \param [out] buffer Buffer holding data from the radio |
|
68 |
* \param [in] size Size of the buffer |
|
69 |
*/ |
|
70 |
void SX126xReadCommand( RadioCommands_t opcode, uint8_t *buffer, uint16_t size ); |
|
71 |
|
|
72 |
/*! |
|
73 |
* \brief Write a single byte of data to the radio memory |
|
74 |
* |
|
75 |
* \param [in] address The address of the first byte to write in the radio |
|
76 |
* \param [in] value The data to be written in radio's memory |
|
77 |
*/ |
|
78 |
void SX126xWriteRegister( uint16_t address, uint8_t value ); |
|
79 |
|
|
80 |
/*! |
|
81 |
* \brief Read a single byte of data from the radio memory |
|
82 |
* |
|
83 |
* \param [in] address The address of the first byte to write in the radio |
|
84 |
* |
|
85 |
* \retval value The value of the byte at the given address in radio's memory |
|
86 |
*/ |
|
87 |
uint8_t SX126xReadRegister( uint16_t address ); |
|
88 |
|
|
89 |
/*! |
|
90 |
* \brief Sets the radio output power. |
|
91 |
* |
|
92 |
* \param [IN] power Sets the RF output power |
|
93 |
*/ |
|
94 |
void SX126xSetRfTxPower( int8_t power ); |
|
95 |
|
|
96 |
/*! |
|
97 |
* \brief Gets the board PA selection configuration |
|
98 |
* |
|
99 |
* \param [IN] channel Channel frequency in Hz |
|
100 |
* \retval PaSelect RegPaConfig PaSelect value |
|
101 |
*/ |
|
102 |
uint8_t SX126xGetPaSelect( uint32_t channel ); |
|
103 |
|
|
104 |
/*! |
|
105 |
* \brief Initializes the RF Switch I/Os pins interface |
|
106 |
*/ |
|
107 |
void SX126xAntSwOn( void ); |
|
108 |
|
|
109 |
/*! |
|
110 |
* \brief De-initializes the RF Switch I/Os pins interface |
|
111 |
* |
|
112 |
* \remark Needed to decrease the power consumption in MCU low power modes |
|
113 |
*/ |
|
114 |
void SX126xAntSwOff( void ); |
|
115 |
|
|
116 |
/*! |
|
117 |
* \brief Checks if the given RF frequency is supported by the hardware |
|
118 |
* |
|
119 |
* \param [IN] frequency RF frequency to be checked |
|
120 |
* \retval isSupported [true: supported, false: unsupported] |
|
121 |
*/ |
|
122 |
bool SX126xCheckRfFrequency( uint32_t frequency ); |
|
123 |
|
|
124 |
/*! |
|
125 |
* Radio hardware and global parameters |
|
126 |
*/ |
|
127 |
extern SX126x_t SX126x; |
|
128 |
|
|
129 |
#endif // __SX126x_ARCH_H__ |