lriot 2.1.0.0
lr1110_modem_hal.h File Reference

Hardware Abstraction Layer (HAL) interface for LR1110 modem. More...

#include <stdint.h>
#include <stdbool.h>
#include "modem/lr1110_modem_common.h"
#include "lriot.h"

Go to the source code of this file.

Typedefs

typedef enum lr1110_modem_hal_status_e lr1110_modem_hal_status_t
 Status reported by the HAL layer.
 

Enumerations

enum  lr1110_modem_hal_status_e { LR1110_MODEM_HAL_STATUS_OK = 0x00 , LR1110_MODEM_HAL_STATUS_ERROR = 0x01 , LR1110_MODEM_HAL_STATUS_BAD_FRAME = 0x0F , LR1110_MODEM_HAL_STATUS_BUSY_TIMEOUT = 0xFF }
 Status reported by the HAL layer. More...
 

Functions

err_t lr1110_modem_hal_write (lriot_t *ctx, uint8_t *command, uint16_t command_length, uint8_t *data_buf, uint16_t data_length)
 
err_t lr1110_modem_hal_read (lriot_t *ctx, uint8_t *command, uint16_t command_length, uint8_t *data_buf, uint16_t data_length)
 
err_t lr1110_modem_hal_write_read (lriot_t *ctx, uint8_t *command, uint8_t *data_buf, uint16_t data_length)
 Radio data transfer - write & read in single operation.
 
err_t lr1110_modem_hal_write_without_rc (lriot_t *ctx, uint8_t *command, uint16_t command_length, uint8_t *data_buf, uint16_t data_length)
 
err_t lr1110_modem_hal_reset (lriot_t *ctx)
 
err_t lr1110_modem_hal_wakeup (lriot_t *ctx)
 

Detailed Description

Hardware Abstraction Layer (HAL) interface for LR1110 modem.

Revised BSD License Copyright Semtech Corporation 2020. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the Semtech corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Typedef Documentation

◆ lr1110_modem_hal_status_t

Status reported by the HAL layer.

Enumeration Type Documentation

◆ lr1110_modem_hal_status_e

Status reported by the HAL layer.

Enumerator
LR1110_MODEM_HAL_STATUS_OK 

Operation terminated successfully.

LR1110_MODEM_HAL_STATUS_ERROR 

Operation terminated with error.

LR1110_MODEM_HAL_STATUS_BAD_FRAME 

Bad frame detected in the exchange.

LR1110_MODEM_HAL_STATUS_BUSY_TIMEOUT 

Timeout occured while waiting for Busy line state.

Function Documentation

◆ lr1110_modem_hal_read()

err_t lr1110_modem_hal_read ( lriot_t * ctx,
uint8_t * command,
uint16_t command_length,
uint8_t * data_buf,
uint16_t data_length )

Radio data transfer - read

Remarks
Must be implemented by the upper layer
Parameters
[in]ctxRadio implementation parameters
[in]commandPointer to the buffer to be transmitted
[in]command_lengthBuffer size to be transmitted
[out]data_bufPointer to the buffer to be received
[in]data_lengthBuffer size to be received
Returns
Operation status

◆ lr1110_modem_hal_reset()

err_t lr1110_modem_hal_reset ( lriot_t * ctx)

Reset the chip

Remarks
Must be implemented by the upper layer
Parameters
[in]ctxChip implementation parameters
Returns
Operation status

◆ lr1110_modem_hal_wakeup()

err_t lr1110_modem_hal_wakeup ( lriot_t * ctx)

Wake the chip up.

Remarks
Must be implemented by the upper layer
Parameters
[in]ctxchip implementation parameters
Returns
Operation status

◆ lr1110_modem_hal_write()

err_t lr1110_modem_hal_write ( lriot_t * ctx,
uint8_t * command,
uint16_t command_length,
uint8_t * data_buf,
uint16_t data_length )

Radio data transfer - write

Remarks
Must be implemented by the upper layer
Parameters
[in]ctxRadio implementation parameters
[in]commandPointer to the buffer to be transmitted
[in]command_lengthBuffer size to be transmitted
[in]data_bufPointer to the buffer to be transmitted
[in]data_lengthBuffer size to be transmitted
Returns
Operation status

◆ lr1110_modem_hal_write_read()

err_t lr1110_modem_hal_write_read ( lriot_t * ctx,
uint8_t * command,
uint8_t * data_buf,
uint16_t data_length )

Radio data transfer - write & read in single operation.

Remarks
Must be implemented by the upper layer
Only required by lr1110_system_get_status command
Parameters
[in]ctxRadio implementation parameters
[in]commandPointer to the buffer to be transmitted
[out]data_bufPointer to the buffer to be received
[in]data_lengthBuffer size to be received
Returns
Operation status

◆ lr1110_modem_hal_write_without_rc()

err_t lr1110_modem_hal_write_without_rc ( lriot_t * ctx,
uint8_t * command,
uint16_t command_length,
uint8_t * data_buf,
uint16_t data_length )

Radio data transfer - write without wait the return code - this API is dedicated to the functions which reset the Modem-E

Remarks
Must be implemented by the upper layer
Parameters
[in]ctxRadio implementation parameters
[in]commandPointer to the buffer to be transmitted
[in]command_lengthBuffer size to be transmitted
[in]data_bufPointer to the buffer to be transmitted
[in]data_lengthBuffer size to be transmitted
Returns
Operation status