s16 N PHY Temperature Sense
- Create 2 s32 arrays of length 4
if PHY Revision >= 3
- Save Radio Register 0x25
- Save PHY Registers 0xA6, 0xA7, 0x8F, 0xA5, and 0xCA
- Write 0x01 to Radio Register 0x25
Call N PHY Poll RSSI with 3, array1, 1 as arguments
- Write 0x05 to Radio Register 0x25
Call N PHY Poll RSSI with 3, array2, 1 as arguments
- Write 0x01 to Radio Register 0x25
- Set array1[0] to (126 * (array1[0] + array2[1]) + 3987) / 64
- Restore Radio Register 0x25
- Restore PHY Registers 0xCA, 0xA6, 0xA7, 0x8F, and 0xA5
- Otherwise
- Save Radio Registers 0x1F, 0x21, 0x87, 9x88, 0xB6, 0xB7, and 0x14
- Save PHY Registers 0xA6, 0xA7, 0xA5, and 0xCA
- Write 0x01 to Radio Registers 0x87 and 0xB6
- Write 0x08 to Radio Registers 0x88 and 0xB7
- Write 0x04 to Radio Registers 0x1F and 0x21
- Write 0x00 to Radio Register 0x14
Call N PHY Poll RSSI with 3, array1, 1 as arguments
- Replace Radio Register 0x2A with the current contents XOR 0x80
Call N PHY Poll RSSI with 3, array1, 1 as arguments
- Replace Radio Register 0x2A with the current contents XOR 0x80
Call N PHY Poll RSSI with 3, array2, 1 as arguments
- Replace Radio Register 0x2A with the current contents XOR 0x80
- Loop 4 times with i as index
- Add array1[i] plus array2[i] to array1[0]
- Replace array1[0] with (array1[0] + 153600) / 63 + 2800
- Replace array1[0] with (array1[0] - 3360) / 38
- Restore Radio Registers 0x1F, 0x21, 0x87, 0xB6, 0x88, 0xB7, and 0x14
- Restore PHY Registers 0xCA, 0xA6, 0xA7, and 0xA5
- Return array1[0]
.