<!--
{
  "availability" : [
    "DriverKit: 19.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SerialDriverKit",
  "identifier" : "/documentation/SerialDriverKit/IOUserSerial/HwProgramUART",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SerialDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserSerial@F@HwProgramUART#i#c#c#c#"
  },
  "title" : "HwProgramUART"
}
-->

# HwProgramUART

Configure the settings for the device’s universal asynchronous receiver/transmitter (UART).

```
virtual kern_return_t HwProgramUART(uint32_t baudRate, uint8_t nDataBits, uint8_t nHalfStopBits, uint8_t parity);
```

## Parameters

`baudRate`

The baud rate requested by the system.

`nDataBits`

The number of data bits to transmit.

`nHalfStopBits`

The number of half stop bits. For example, specify `3` to generate `1.5` stop bits.

`parity`

The parity setting to use during communication. For a list of possible values, see Parity Options.

## Return Value

<doc://com.apple.documentation/documentation/DriverKit/kIOReturnSuccess> on success, or another value if an error occurs. See <doc://com.apple.documentation/documentation/DriverKit/error-codes>.

## Discussion

Override this method and use it to program your hardware with the specified information.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)