Skip to content

Commit

Permalink
Merge pull request #10 from ThundeRatz/develop
Browse files Browse the repository at this point in the history
Release v1.1
  • Loading branch information
LucasHaug authored Mar 14, 2022
2 parents 7e38733 + 1edcf95 commit c22bd80
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
48 changes: 24 additions & 24 deletions inc/rf24_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ rf24_platform_status_t rf24_platform_disable(rf24_platform_t* p_setup);
/**
* @brief Send SPI command.
*
* @param p_setup Pointer to rf24 insta setup.nce
* @param command SPI command @ref nrf24l01_spi_commands
* @param p_setup Pointer to rf24 instance setup.
* @param command SPI command @ref nrf24l01_spi_commands
*
* @return @ref rf24_platform_status.
*/
Expand All @@ -94,8 +94,8 @@ rf24_platform_status_t rf24_platform_send_command(rf24_platform_t* p_setup, nrf2
/**
* @brief Gets status register value.
*
* @param p_setup Pointer to rf24 setup.instance
* @param p_status_reg Pointer to a variable to store the status.
* @param p_setup Pointer to rf24 instance setup.
* @param p_status_reg Pointer to a variable to store the status.
*
* @return @ref rf24_platform_status.
*/
Expand All @@ -104,10 +104,10 @@ rf24_platform_status_t rf24_platform_get_status(rf24_platform_t* p_setup, nrf24l
/**
* @brief Read register from device.
*
* @param p_setup Pointer to rf24 insta setup.nce
* @param reg Register to be read
* @param buff Buffer to store register value
* @param len Buffer lenght
* @param p_setup Pointer to rf24 instance setup.
* @param reg Register to be read
* @param buff Buffer to store register value
* @param len Buffer lenght
*
* @return @ref rf24_platform_status.
*/
Expand All @@ -117,8 +117,8 @@ rf24_platform_status_t rf24_platform_read_register(rf24_platform_t* p_setup, nrf
/**
* @brief Read a 8 bit register from device.
*
* @param p_setup Pointer to rf24 ins setup.tance
* @param reg Register to be read
* @param p_setup Pointer to rf24 instance setup.
* @param reg Register to be read
* @param p_reg_value Pointer to a variable to store the value from the register.
*
* @return Register value.
Expand All @@ -129,10 +129,10 @@ rf24_platform_status_t rf24_platform_read_reg8(rf24_platform_t* p_setup, nrf24l0
/**
* @brief Write device register.
*
* @param p_setup Pointer to rf24 insta setup.nce
* @param reg Register to be written
* @param buff Buffer to store register value
* @param len Buffer lenght
* @param p_setup Pointer to rf24 instance setup.
* @param reg Register to be written
* @param buff Buffer to store register value
* @param len Buffer lenght
*
* @return @ref rf24_platform_status.
*/
Expand All @@ -142,9 +142,9 @@ rf24_platform_status_t rf24_platform_write_register(rf24_platform_t* p_setup, nr
/**
* @brief Write a 8 bit device register.
*
* @param p_setup Pointer to rf24 insta setup.nce
* @param reg Register to be written
* @param value Value to writein theregister
* @param p_setup Pointer to rf24 instance setup.
* @param reg Register to be written
* @param value Value to be written in the register
*
* @return @ref rf24_platform_status.
*/
Expand All @@ -153,9 +153,9 @@ rf24_platform_status_t rf24_platform_write_reg8(rf24_platform_t* p_setup, nrf24l
/**
* @brief Read a payload from device Rx FIFO.
*
* @param p_setup Pointer to rf24 insta setup.nce
* @param buff Buffer to store the payload data
* @param len Payload lenght
* @param p_setup Pointer to rf24 instance setup.
* @param buff Buffer to store the payload data
* @param len Payload lenght
*
* @return @ref rf24_platform_status.
*/
Expand All @@ -164,10 +164,10 @@ rf24_platform_status_t rf24_platform_read_payload(rf24_platform_t* p_setup, uint
/**
* @brief Write payload in device Tx FIFO.
*
* @param p_setup Pointer to rf setup.24 instance
* @param buff Buffer to store the payload data
* @param len Payload lenght
* @param enable_auto_ack Tells the receiver if a acknowledgement packet is expected
* @param p_setup Pointer to rf24 instance setup.
* @param buff Buffer to store the payload data
* @param len Payload lenght
* @param enable_auto_ack Tells the receiver if a acknowledgement packet is expected
*
* @note To use the enable_auto_ack feature, the user must set the EN_DYN_ACK bit
* from the FEATURE register. This will allow to control which payload
Expand Down
5 changes: 4 additions & 1 deletion src/rf24.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ nrf24l01_reg_status_t rf24_get_status(rf24_dev_t* p_dev) {
}

rf24_status_t rf24_set_irq_configuration(rf24_dev_t* p_dev, rf24_irq_t irq_config) {
rf24_status_t dev_status = RF24_SUCCESS;
nrf24l01_reg_config_t config_reg;

rf24_platform_status_t platform_status =
Expand All @@ -750,7 +751,9 @@ rf24_status_t rf24_set_irq_configuration(rf24_dev_t* p_dev, rf24_irq_t irq_confi
platform_status = rf24_platform_write_reg8(&(p_dev->platform_setup), NRF24L01_REG_CONFIG, config_reg.value);
}

return platform_status;
dev_status = (platform_status == RF24_PLATFORM_SUCCESS) ? (RF24_SUCCESS) : (RF24_ERROR_CONTROL_INTERFACE);

return dev_status;
}

rf24_irq_t rf24_irq_callback(rf24_dev_t* p_dev) {
Expand Down

0 comments on commit c22bd80

Please sign in to comment.