Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4140

SDK • Re: struct uart_inst

$
0
0
Correct - it's a deliberately opaque type to avoid application code messing with it.

As it happens, in the current implemntation, a struct uart_inst * is the same thing as a uart_hw_t * so if you want to access the UART directly you could just cast it - but you shouldn't! Instead, use the SDK function uart_get_hw() to convert your uart_inst pointer into a uart_hw_t pointer. In the current version, the compiler will optimise that away to exactly the same code as if you had used a cast, but you keep yourself compatible with possible future SDK changes.

Statistics: Posted by arg001 — Fri Nov 15, 2024 12:56 pm



Viewing all articles
Browse latest Browse all 4140

Trending Articles