RTEMS 6.1-rc7
Loading...
Searching...
No Matches
sc16is752.h
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*
4 * Copyright (c) 2016 embedded brains GmbH & Co. KG
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#ifndef LIBBSP_ARM_ATSAM_SC16IS752_H
29#define LIBBSP_ARM_ATSAM_SC16IS752_H
30
31#include <rtems/irq-extension.h>
32#include <libchip/chip.h>
33
34#include <dev/serial/sc16is752.h>
35
36#ifdef __cplusplus
37extern "C" {
38#endif /* __cplusplus */
39
45typedef struct {
47 Pin irq_pin;
50 uint32_t irqs_index;
52
58typedef struct {
62 const char *device_path;
63
67 sc16is752_mode mode;
68
74
78 const char *spi_path;
79
85
89 uint32_t spi_speed_hz;
90
95 const Pin irq_pin;
96
101 uint32_t server_index;
103
116int atsam_sc16is752_spi_create(
119);
120
121#ifdef __cplusplus
122}
123#endif /* __cplusplus */
124
125#endif /* LIBBSP_ARM_ATSAM_SC16IS752_H */
This header file is provided for backward compatiblility.
Definition: pio.h:172
The SC16IS752 device configuration.
Definition: sc16is752.h:58
uint32_t spi_speed_hz
The SPI bus speed in Hertz.
Definition: sc16is752.h:89
const char * spi_path
The SPI bus device path.
Definition: sc16is752.h:78
uint32_t input_frequency
The input frequency in Hertz of the SC16IS752 chip. See XTAL1 and XTAL2 pins.
Definition: sc16is752.h:73
sc16is752_mode mode
The SC16IS752 mode.
Definition: sc16is752.h:67
uint32_t server_index
The index to identify the interrupt server used for interrupt processing.
Definition: sc16is752.h:101
uint8_t spi_chip_select
The SPI chip select (starts with 0, the SPI driver uses SPI_ChipSelect(1 << spi_chip_select)).
Definition: sc16is752.h:84
const char * device_path
The device file path for the new device.
Definition: sc16is752.h:62
const Pin irq_pin
The interrupt pin, e.g. { PIO_PD28, PIOD, ID_PIOD, PIO_INPUT, PIO_IT_LOW_LEVEL }.
Definition: sc16is752.h:95
The SC16IS752 device context.
Definition: sc16is752.h:45
Definition: deflate.c:114
This structure represents an interrupt server action.
Definition: intr.h:2989
This structure represents an interrupt server entry.
Definition: intr.h:3028
SC16IS752 SPI context.
Definition: sc16is752.h:194