libnx
v4.7.0
|
UART service IPC wrapper. More...
Go to the source code of this file.
Data Structures | |
struct | UartPortSession |
PortSession. More... | |
Enumerations | |
enum | UartPort { UartPort_Bluetooth = 1 , UartPort_JoyConR = 2 , UartPort_JoyConL = 3 , UartPort_MCU = 4 } |
UartPort. More... | |
enum | UartPortForDev { UartPortForDev_JoyConR = 1 , UartPortForDev_JoyConL = 2 , UartPortForDev_Bluetooth = 3 } |
UartPortForDev. More... | |
enum | UartFlowControlMode { UartFlowControlMode_None = 0 , UartFlowControlMode_Hardware = 1 } |
FlowControlMode. More... | |
enum | UartPortEventType { UartPortEventType_SendBufferEmpty = 0 , UartPortEventType_SendBufferReady = 1 , UartPortEventType_ReceiveBufferReady = 2 , UartPortEventType_ReceiveEnd = 3 } |
PortEventType. More... | |
Functions | |
Result | uartInitialize (void) |
Initialize uart. | |
void | uartExit (void) |
Exit uart. | |
Service * | uartGetServiceSession (void) |
Gets the Service object for the actual uart service session. | |
Result | uartHasPort (UartPort port, bool *out) |
HasPort. More... | |
Result | uartHasPortForDev (UartPortForDev port, bool *out) |
HasPortForDev. More... | |
Result | uartIsSupportedBaudRate (UartPort port, u32 baud_rate, bool *out) |
IsSupportedBaudRate. More... | |
Result | uartIsSupportedBaudRateForDev (UartPortForDev port, u32 baud_rate, bool *out) |
IsSupportedBaudRateForDev. More... | |
Result | uartIsSupportedFlowControlMode (UartPort port, UartFlowControlMode flow_control_mode, bool *out) |
IsSupportedFlowControlMode. More... | |
Result | uartIsSupportedFlowControlModeForDev (UartPortForDev port, UartFlowControlMode flow_control_mode, bool *out) |
IsSupportedFlowControlModeForDev. More... | |
Result | uartCreatePortSession (UartPortSession *s) |
Creates an UartPortSession. More... | |
Result | uartIsSupportedPortEvent (UartPort port, UartPortEventType port_event_type, bool *out) |
IsSupportedPortEvent. More... | |
Result | uartIsSupportedPortEventForDev (UartPortForDev port, UartPortEventType port_event_type, bool *out) |
IsSupportedPortEventForDev. More... | |
Result | uartIsSupportedDeviceVariation (UartPort port, u32 device_variation, bool *out) |
IsSupportedDeviceVariation. More... | |
Result | uartIsSupportedDeviceVariationForDev (UartPortForDev port, u32 device_variation, bool *out) |
IsSupportedDeviceVariationForDev. More... | |
IPortSession | |
void | uartPortSessionClose (UartPortSession *s) |
Close an UartPortSession. More... | |
Result | uartPortSessionOpenPort (UartPortSession *s, bool *out, UartPort port, u32 baud_rate, UartFlowControlMode flow_control_mode, u32 device_variation, bool is_invert_tx, bool is_invert_rx, bool is_invert_rts, bool is_invert_cts, void *send_buffer, u64 send_buffer_length, void *receive_buffer, u64 receive_buffer_length) |
OpenPort. More... | |
Result | uartPortSessionOpenPortForDev (UartPortSession *s, bool *out, UartPortForDev port, u32 baud_rate, UartFlowControlMode flow_control_mode, u32 device_variation, bool is_invert_tx, bool is_invert_rx, bool is_invert_rts, bool is_invert_cts, void *send_buffer, u64 send_buffer_length, void *receive_buffer, u64 receive_buffer_length) |
OpenPortForDev. More... | |
Result | uartPortSessionGetWritableLength (UartPortSession *s, u64 *out) |
GetWritableLength. More... | |
Result | uartPortSessionSend (UartPortSession *s, const void *in_data, size_t size, u64 *out) |
Send. More... | |
Result | uartPortSessionGetReadableLength (UartPortSession *s, u64 *out) |
GetReadableLength. More... | |
Result | uartPortSessionReceive (UartPortSession *s, void *out_data, size_t size, u64 *out) |
Receive. More... | |
Result | uartPortSessionBindPortEvent (UartPortSession *s, UartPortEventType port_event_type, s64 threshold, bool *out, Event *out_event) |
BindPortEvent. More... | |
Result | uartPortSessionUnbindPortEvent (UartPortSession *s, UartPortEventType port_event_type, bool *out) |
UnbindPortEvent. More... | |
UART service IPC wrapper.
enum UartFlowControlMode |
enum UartPort |
enum UartPortEventType |
enum UartPortForDev |
Result uartCreatePortSession | ( | UartPortSession * | s | ) |
Creates an UartPortSession.
[out] | s | UartPortSession |
HasPort.
[in] | port | UartPort |
[out] | out | Output success flag. |
Result uartHasPortForDev | ( | UartPortForDev | port, |
bool * | out | ||
) |
HasPortForDev.
[in] | port | UartPortForDev |
[out] | out | Output success flag. |
IsSupportedBaudRate.
[in] | port | UartPort |
[in] | baud_rate | BaudRate |
[out] | out | Output success flag. |
Result uartIsSupportedBaudRateForDev | ( | UartPortForDev | port, |
u32 | baud_rate, | ||
bool * | out | ||
) |
IsSupportedBaudRateForDev.
[in] | port | UartPortForDev |
[in] | baud_rate | BaudRate |
[out] | out | Output success flag. |
IsSupportedDeviceVariation.
[in] | port | UartPort |
[in] | device_variation | DeviceVariation |
[out] | out | Output success flag. |
Result uartIsSupportedDeviceVariationForDev | ( | UartPortForDev | port, |
u32 | device_variation, | ||
bool * | out | ||
) |
IsSupportedDeviceVariationForDev.
[in] | port | UartPortForDev |
[in] | device_variation | DeviceVariation |
[out] | out | Output success flag. |
Result uartIsSupportedFlowControlMode | ( | UartPort | port, |
UartFlowControlMode | flow_control_mode, | ||
bool * | out | ||
) |
IsSupportedFlowControlMode.
[in] | port | UartPort |
[in] | flow_control_mode | UartFlowControlMode |
[out] | out | Output success flag. |
Result uartIsSupportedFlowControlModeForDev | ( | UartPortForDev | port, |
UartFlowControlMode | flow_control_mode, | ||
bool * | out | ||
) |
IsSupportedFlowControlModeForDev.
[in] | port | UartPortForDev |
[in] | flow_control_mode | UartFlowControlMode |
[out] | out | Output success flag. |
Result uartIsSupportedPortEvent | ( | UartPort | port, |
UartPortEventType | port_event_type, | ||
bool * | out | ||
) |
IsSupportedPortEvent.
[in] | port | UartPort |
[in] | port_event_type | UartPortEventType |
[out] | out | Output success flag. |
Result uartIsSupportedPortEventForDev | ( | UartPortForDev | port, |
UartPortEventType | port_event_type, | ||
bool * | out | ||
) |
IsSupportedPortEventForDev.
[in] | port | UartPortForDev |
[in] | port_event_type | UartPortEventType |
[out] | out | Output success flag. |
Result uartPortSessionBindPortEvent | ( | UartPortSession * | s, |
UartPortEventType | port_event_type, | ||
s64 | threshold, | ||
bool * | out, | ||
Event * | out_event | ||
) |
BindPortEvent.
s | UartPortSession | |
[in] | port_event_type | UartPortEventType |
[in] | threshold | Threshold |
[out] | out | Output success flag. |
[out] | out_event | Output Event with autoclear=false. |
void uartPortSessionClose | ( | UartPortSession * | s | ) |
Close an UartPortSession.
s | UartPortSession |
Result uartPortSessionGetReadableLength | ( | UartPortSession * | s, |
u64 * | out | ||
) |
GetReadableLength.
s | UartPortSession | |
[out] | out | Output ReadableLength. |
Result uartPortSessionGetWritableLength | ( | UartPortSession * | s, |
u64 * | out | ||
) |
GetWritableLength.
s | UartPortSession | |
[out] | out | Output WritableLength. |
Result uartPortSessionOpenPort | ( | UartPortSession * | s, |
bool * | out, | ||
UartPort | port, | ||
u32 | baud_rate, | ||
UartFlowControlMode | flow_control_mode, | ||
u32 | device_variation, | ||
bool | is_invert_tx, | ||
bool | is_invert_rx, | ||
bool | is_invert_rts, | ||
bool | is_invert_cts, | ||
void * | send_buffer, | ||
u64 | send_buffer_length, | ||
void * | receive_buffer, | ||
u64 | receive_buffer_length | ||
) |
OpenPort.
s | UartPortSession | |
[out] | out | Output success flag. |
[in] | port | UartPort |
[in] | baud_rate | BaudRate |
[in] | flow_control_mode | UartFlowControlMode |
[in] | device_variation | [7.0.0+] DeviceVariation |
[in] | is_invert_tx | [6.0.0+] IsInvertTx |
[in] | is_invert_rx | [6.0.0+] IsInvertRx |
[in] | is_invert_rts | [6.0.0+] IsInvertRts |
[in] | is_invert_cts | [6.0.0+] IsInvertCts |
[in] | send_buffer | Send buffer, must be 0x1000-byte aligned. |
[in] | send_buffer_length | Send buffer size, must be 0x1000-byte aligned. |
[in] | receive_buffer | Receive buffer, must be 0x1000-byte aligned. |
[in] | receive_buffer_length | Receive buffer size, must be 0x1000-byte aligned. |
Result uartPortSessionOpenPortForDev | ( | UartPortSession * | s, |
bool * | out, | ||
UartPortForDev | port, | ||
u32 | baud_rate, | ||
UartFlowControlMode | flow_control_mode, | ||
u32 | device_variation, | ||
bool | is_invert_tx, | ||
bool | is_invert_rx, | ||
bool | is_invert_rts, | ||
bool | is_invert_cts, | ||
void * | send_buffer, | ||
u64 | send_buffer_length, | ||
void * | receive_buffer, | ||
u64 | receive_buffer_length | ||
) |
OpenPortForDev.
s | UartPortSession | |
[out] | out | Output success flag. |
[in] | port | UartPortForDev |
[in] | baud_rate | BaudRate |
[in] | flow_control_mode | UartFlowControlMode |
[in] | device_variation | [7.0.0+] DeviceVariation |
[in] | is_invert_tx | [6.0.0+] IsInvertTx |
[in] | is_invert_rx | [6.0.0+] IsInvertRx |
[in] | is_invert_rts | [6.0.0+] IsInvertRts |
[in] | is_invert_cts | [6.0.0+] IsInvertCts |
[in] | send_buffer | Send buffer, must be 0x1000-byte aligned. |
[in] | send_buffer_length | Send buffer size, must be 0x1000-byte aligned. |
[in] | receive_buffer | Receive buffer, must be 0x1000-byte aligned. |
[in] | receive_buffer_length | Receive buffer size, must be 0x1000-byte aligned. |
Result uartPortSessionReceive | ( | UartPortSession * | s, |
void * | out_data, | ||
size_t | size, | ||
u64 * | out | ||
) |
Receive.
s | UartPortSession | |
[out] | out_data | Output data buffer. |
[in] | size | Output data buffer size. |
[out] | out | Output size. |
Result uartPortSessionSend | ( | UartPortSession * | s, |
const void * | in_data, | ||
size_t | size, | ||
u64 * | out | ||
) |
Send.
s | UartPortSession | |
[in] | in_data | Input data buffer. |
[in] | size | Input data buffer size. |
[out] | out | Output size. |
Result uartPortSessionUnbindPortEvent | ( | UartPortSession * | s, |
UartPortEventType | port_event_type, | ||
bool * | out | ||
) |
UnbindPortEvent.
s | UartPortSession | |
[in] | port_event_type | UartPortEventType |
[out] | out | Output success flag. |