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.
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