uart.h (120378) | uart.h (120452) |
---|---|
1/* 2 * Copyright (c) 2003 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/* 2 * Copyright (c) 2003 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/uart/uart.h 120378 2003-09-23 09:25:38Z nyan $ | 26 * $FreeBSD: head/sys/dev/uart/uart.h 120452 2003-09-26 05:14:56Z marcel $ |
27 */ 28 29#ifndef _DEV_UART_H_ 30#define _DEV_UART_H_ 31 32/* 33 * Bus access structure. This structure holds the minimum information needed 34 * to access the UART. The rclk field, although not important to actually 35 * access the UART, is important for baudrate programming, delay loops and 36 * other timing related computations. 37 */ 38struct uart_bas { | 27 */ 28 29#ifndef _DEV_UART_H_ 30#define _DEV_UART_H_ 31 32/* 33 * Bus access structure. This structure holds the minimum information needed 34 * to access the UART. The rclk field, although not important to actually 35 * access the UART, is important for baudrate programming, delay loops and 36 * other timing related computations. 37 */ 38struct uart_bas { |
39 bus_addr_t iobase; | |
40 bus_space_tag_t bst; 41 bus_space_handle_t bsh; | 39 bus_space_tag_t bst; 40 bus_space_handle_t bsh; |
42 u_int regshft; | 41 u_int chan; |
43 u_int rclk; | 42 u_int rclk; |
43 u_int regshft; |
|
44}; 45 46#define uart_regofs(bas, reg) ((reg) << (bas)->regshft) 47 48#define uart_getreg(bas, reg) \ 49 bus_space_read_1((bas)->bst, (bas)->bsh, uart_regofs(bas, reg)) 50#define uart_setreg(bas, reg, value) \ 51 bus_space_write_1((bas)->bst, (bas)->bsh, uart_regofs(bas, reg), value) --- 32 unchanged lines hidden --- | 44}; 45 46#define uart_regofs(bas, reg) ((reg) << (bas)->regshft) 47 48#define uart_getreg(bas, reg) \ 49 bus_space_read_1((bas)->bst, (bas)->bsh, uart_regofs(bas, reg)) 50#define uart_setreg(bas, reg, value) \ 51 bus_space_write_1((bas)->bst, (bas)->bsh, uart_regofs(bas, reg), value) --- 32 unchanged lines hidden --- |