CC2538 RF Driver Data Types

Hi All,

According to the CC2538 user manual, some of the register values from the radio are signed. The current RF driver uses uint_fast8_t as the return type of rfcore_read_byte(). Is it generally safe to typecast the return value to a signed integer? If not, what’s the best way to handle this?

Best Regards, Jason Tran

Hi Jason,

According to the CC2538 user manual, some of the register values from the radio are signed

Are you referring to the RSSI bit here? Typecasting this value should be fine, so long as you are casting to an 8-bit signed integer. Strictly speaking I think this behaviour is implementation-defined, but in practice it should be safe so long as the two types are the same width.

Cheers Aaron