RasPi Direct Hardware Access
Integrated peripheral access without operating system drivers.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions
uart.h File Reference

This file contains the whole API as static inline functions, since all functions are very short. More...

#include "raspi/hw.h"
#include <stdint.h>

Go to the source code of this file.

Functions

static void uart_init (unsigned int bitrate)
 Configure UART hardware for given bit rate. 115200 bit/s is the fastest speed available.
 
static int uart_poll (int num)
 Return true if at least num bytes are available in the receive FIFO. Only guaranteed to work correctly with num == 1. Larger values may return true even if less bytes (but at least one) are available.
 
static uint8_t uart_read (void)
 Read a single byte received via UART. Block if FIFO is currently empty.
 
static void uart_write (uint8_t data)
 Send data via UART. Block if FIFO is currently full.
 
static void uart_flush ()
 Block until transmit FIFO is empty.
 

Detailed Description

This file contains the whole API as static inline functions, since all functions are very short.

There is no accompanying C file.

License

Copyright (c) 2013 OFFIS e.V.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.