You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
137 lines
5.0 KiB
137 lines
5.0 KiB
3 months ago
|
/*
|
||
|
______ _
|
||
|
/ _____) _ | |
|
||
|
( (____ _____ ____ _| |_ _____ ____| |__
|
||
|
\____ \| ___ | (_ _) ___ |/ ___) _ \
|
||
|
_____) ) ____| | | || |_| ____( (___| | | |
|
||
|
(______/|_____)_|_|_| \__)_____)\____)_| |_|
|
||
|
(C)2015 Semtech
|
||
|
|
||
|
Description: Handling of the node configuration protocol // �ڵ�����Э���Ĵ���
|
||
|
|
||
|
License: Revised BSD License, see LICENSE.TXT file include in the project
|
||
|
|
||
|
Maintainer: Miguel Luis, Matthieu Verdy and Benjamin Boulet
|
||
|
*/
|
||
|
#ifndef __SX1280_HAL_H__
|
||
|
#define __SX1280_HAL_H__
|
||
|
|
||
|
//#include "hw.h"
|
||
|
#include "stdint.h"
|
||
|
|
||
|
#include "sx1280.h"
|
||
|
/*!
|
||
|
* * \brief Define which DIOs are connected
|
||
|
*/
|
||
|
#define RADIO_DIO1_ENABLE 1
|
||
|
#define RADIO_DIO2_ENABLE 0
|
||
|
#define RADIO_DIO3_ENABLE 0
|
||
|
|
||
|
void SX1280HalWaitOnBusy( void );
|
||
|
|
||
|
void SX1280HalInit( DioIrqHandler **irqHandlers );
|
||
|
|
||
|
void SX1280HalIoInit( void );
|
||
|
|
||
|
/*!
|
||
|
* \brief Soft resets the radio ������λ ��Ƶģ��
|
||
|
*/
|
||
|
void SX1280HalReset( void );
|
||
|
|
||
|
/*!
|
||
|
* \brief Clears the instruction ram memory block ����ָ��RAM�ڴ���
|
||
|
*/
|
||
|
void SX1280HalClearInstructionRam( void );
|
||
|
|
||
|
/*!
|
||
|
* \brief Wakes up the radio ��Ƶģ�黽��
|
||
|
*/
|
||
|
void SX1280HalWakeup( void );
|
||
|
|
||
|
/*!
|
||
|
* \brief Send a command that write data to the radio
|
||
|
* ���� дָ�� ����Ƶģ��
|
||
|
* \param [in] opcode Opcode of the command ��Ҫд����ָ��
|
||
|
* \param [in] buffer Buffer to be send to the radio ������Ƶģ����������
|
||
|
* \param [in] size Size of the buffer to send Ҫ���͵����ݴ�С
|
||
|
*/
|
||
|
void SX1280HalWriteCommand( RadioCommands_t opcode, uint8_t *buffer, uint16_t size );
|
||
|
|
||
|
/*!
|
||
|
* \brief Send a command that read data from the radio
|
||
|
* ���ʹ���Ƶ ģ����ȡ�������� ����
|
||
|
* \param [in] opcode Opcode of the command �����IJ�����
|
||
|
* \param [out] buffer Buffer holding data from the radio ���������ߵ���ȡ�����ݵĻ�����
|
||
|
* \param [in] size Size of the buffer �������Ĵ�С
|
||
|
*/
|
||
|
void SX1280HalReadCommand( RadioCommands_t opcode, uint8_t *buffer, uint16_t size );
|
||
|
|
||
|
/*!
|
||
|
* \brief Write data to the radio memory �� ����д�����ߵ��ڴ�
|
||
|
*
|
||
|
* \param [in] address The address of the first byte to write in the radio Ҫд�����ߵ��ĵ�һ���ֽڵĵ�ַ
|
||
|
* \param [in] buffer The data to be written in radio's memory Ҫд�����ߵ��ڴ�������
|
||
|
* \param [in] size The number of bytes to write in radio's memoryҪд�����ߵ��ڴ����ֽ���
|
||
|
*/
|
||
|
void SX1280HalWriteRegisters( uint16_t address, uint8_t *buffer, uint16_t size );
|
||
|
|
||
|
/*!
|
||
|
* \brief Write a single byte of data to the radio memory �������ֽڵ�����д�����ߵ��ڴ�
|
||
|
*
|
||
|
* \param [in] address The address of the first byte to write in the radioҪд�����ߵ��ĵ�һ���ֽڵĵ�ַ
|
||
|
* \param [in] value The data to be written in radio's memory Ҫд�����ߵ��ڴ�������
|
||
|
*/
|
||
|
void SX1280HalWriteRegister( uint16_t address, uint8_t value );
|
||
|
|
||
|
/*!
|
||
|
* \brief Read data from the radio memory �����ߵ��ڴ���ȡ����
|
||
|
*
|
||
|
* \param [in] address The address of the first byte to read from the radioҪ�����ߵ���ȡ�ĵ�һ���ֽڵĵ�ַ
|
||
|
* \param [out] buffer The buffer that holds data read from radio���������ߵ���ȡ�����ݵĻ�����
|
||
|
* \param [in] size The number of bytes to read from radio's memory Ҫ�����ߵ��ڴ���ȡ���ֽ���
|
||
|
*/
|
||
|
void SX1280HalReadRegisters( uint16_t address, uint8_t *buffer, uint16_t size );
|
||
|
|
||
|
/*!
|
||
|
* \brief Read a single byte of data from the radio memory �����ߵ��ڴ���ȡ�����ֽڵ�����
|
||
|
*
|
||
|
* \param [in] address The address of the first byte to write in the
|
||
|
* radio Ҫд�����ߵ��ĵ�һ���ֽڵĵ�ַ
|
||
|
*
|
||
|
*
|
||
|
* \retval value The value of the byte at the given address in
|
||
|
* radio's memory ���ߵ��ڴ��и�����ַ���ֽڵ�ֵ
|
||
|
*/
|
||
|
uint8_t SX1280HalReadRegister( uint16_t address );
|
||
|
|
||
|
/*!
|
||
|
* \brief Write data to the buffer holding the payload in the radio ������д�����ߵ绺���������غ�
|
||
|
*
|
||
|
* \param [in] offset The offset to start writing the payload ��ʼд���غɵ�ƫ����
|
||
|
* \param [in] buffer The data to be written (the payload)Ҫд�������ݣ��غɣ�
|
||
|
* \param [in] size The number of byte to be writtenҪд�����ֽ���
|
||
|
*/
|
||
|
void SX1280HalWriteBuffer( uint8_t offset, uint8_t *buffer, uint8_t size );
|
||
|
|
||
|
/*!
|
||
|
* \brief Read data from the buffer holding the payload in the radio �����ߵ绺������ȡ���ݣ�
|
||
|
*
|
||
|
* \param [in] offset The offset to start reading the payload ��ʼ��ȡ�غɵ�ƫ����
|
||
|
* \param [out] buffer A pointer to a buffer holding the data from the radioָ�������ߵ���ȡ�����ݵĻ�������ָ��
|
||
|
* \param [in] size The number of byte to be read Ҫ��ȡ���ֽ���
|
||
|
*/
|
||
|
void SX1280HalReadBuffer( uint8_t offset, uint8_t *buffer, uint8_t size );
|
||
|
|
||
|
/*!
|
||
|
* \brief Returns the status of DIOs pins ����DIOs���ŵ�״̬
|
||
|
*
|
||
|
* \retval dioStatus A byte where each bit represents a DIO state:
|
||
|
* [ DIOx | BUSY ]
|
||
|
*/
|
||
|
uint8_t SX1280HalGetDioStatus( void );
|
||
|
|
||
|
void SX1280HalIoIrqInit( DioIrqHandler **irqHandlers );
|
||
|
void SX1280HalWriteCommand2( RadioCommands_t command, uint8_t *buffer, uint16_t size ) ;
|
||
|
|
||
|
#endif // __SX1280_HAL_H__
|