Lora-net / SWDR001

Driver for LR11xx chip (LR1110 / LR1120 / LR1121)
Other
18 stars 6 forks source link

differences between the user-manuel and header file defination #1

Closed zafersn closed 1 year ago

zafersn commented 1 year ago

I was testing spi comms and just wanted to read/write basic commands and used the lr11xx_system_get_version func. so I realised that according to the UserManual_LR1120_v1-1.Public.pdf, the getversion response package size is 5. but the package size definition in lr11xx_system_types.h file is 4. Can you please verify what the reason for this difference is?

/*!
 * @brief Length in byte of the LR11XX version blob
 */
#define LR11XX_SYSTEM_VERSION_LENGTH ( 4 )

image

and here below, rbbuffer parsing in the lr11xx_system.c is totally wrong if the UserManual_LR1120_v1-1.Public.pdf is still valid. Because rbuffer[0] is not hw version. it is Stat1 value.

if( status == LR11XX_STATUS_OK )
    {
        version->hw   = rbuffer[0];
        version->type = rbuffer[1];
        version->fw   = ( ( uint16_t ) rbuffer[2] << 8 ) + ( uint16_t ) rbuffer[3];
    }

    return status;

Cheers!

matthieuantoine commented 1 year ago

Hi @zafersn,

Stat1 is always returned by the transceiver when issuing a READ command (see LR1110 User Manual v1.5 - §3.2) and is not specific to a command in particular. In our driver implementation (see here for instance), we made the choice to discard this first byte when getting data from lr11xx_hal_read().

Our documentation in lr11xx_hal.h should be updated to make this behavior explicit. I'll report that internally to integrate this change for the next release.

zafersn commented 1 year ago

Hi @matthieuantoine Ok, now it makes sense. thanks for the quick reply. But I think, in this repository, the size definition of it should be 5 instead of 4. Because this repo seems the driver of the LR1120 and I just tough and wanted to use bare driver files which are reflecting the datasheet/user-manual.

Thanks.