|
|
|
@ -440,6 +440,18 @@ int32_t sx127x_rand(sx127x_t *sx127x)
@@ -440,6 +440,18 @@ int32_t sx127x_rand(sx127x_t *sx127x)
|
|
|
|
|
return tmp; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int32_t sx127x_txdone(sx127x_t *sx127x) |
|
|
|
|
{ |
|
|
|
|
uint8_t irq; |
|
|
|
|
|
|
|
|
|
/* read IRQ flags */ |
|
|
|
|
return_val_if_fail(sx127x_readbyte(sx127x, SX127X_REG_IRQFLAGS, &irq) == 0, -1); |
|
|
|
|
/* clear the TXDONE flag */ |
|
|
|
|
return_val_if_fail(sx127x_writebyte(sx127x, SX127X_REG_IRQFLAGS, irq & ~SX127X_IRQFLAGS_TXDONE) == 0, -1); |
|
|
|
|
|
|
|
|
|
return irq & SX127X_IRQFLAGS_TXDONE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static int32_t sx127x_writebyte(sx127x_t *sx127x, uint8_t reg, uint8_t byte) |
|
|
|
|
{ |
|
|
|
|
uint8_t txdata[2] = { WREG(reg), byte }; |
|
|
|
|