---
title: HwProgramUART
framework: serialdriverkit
role: symbol
role_heading: Instance Method
path: serialdriverkit/iouserserial/hwprogramuart
---

# HwProgramUART

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

## Declaration

```occ
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

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

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

## See Also

### Programming the Modem

- [HwGetModemStatus](serialdriverkit/iouserserial/hwgetmodemstatus.md)
- [SetModemStatus](serialdriverkit/iouserserial/setmodemstatus.md)
- [HwResetFIFO](serialdriverkit/iouserserial/hwresetfifo.md)
- [HwSendBreak](serialdriverkit/iouserserial/hwsendbreak.md)
- [HwProgramBaudRate](serialdriverkit/iouserserial/hwprogrambaudrate.md)
- [HwProgramLatencyTimer](serialdriverkit/iouserserial/hwprogramlatencytimer.md)
- [HwProgramMCR](serialdriverkit/iouserserial/hwprogrammcr.md)
- [Hardware Constants](serialdriverkit/hardware-constants.md)
