RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
arm
atsam
include
bsp
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
37
extern
"C"
{
38
#endif
/* __cplusplus */
39
45
typedef
struct
{
46
sc16is752_spi_context
base;
47
Pin irq_pin;
48
rtems_interrupt_server_entry
irqs_entry;
49
rtems_interrupt_server_action
irqs_action;
50
uint32_t irqs_index;
51
}
atsam_sc16is752_spi_context
;
52
58
typedef
struct
{
62
const
char
*
device_path
;
63
67
sc16is752_mode
mode
;
68
73
uint32_t
input_frequency
;
74
78
const
char
*
spi_path
;
79
84
uint8_t
spi_chip_select
;
85
89
uint32_t
spi_speed_hz
;
90
95
const
Pin
irq_pin
;
96
101
uint32_t
server_index
;
102
}
atsam_sc16is752_spi_config
;
103
116
int
atsam_sc16is752_spi_create(
117
atsam_sc16is752_spi_context
*ctx,
118
const
atsam_sc16is752_spi_config
*config
119
);
120
121
#ifdef __cplusplus
122
}
123
#endif
/* __cplusplus */
124
125
#endif
/* LIBBSP_ARM_ATSAM_SC16IS752_H */
irq-extension.h
This header file is provided for backward compatiblility.
atsam_sc16is752_spi_config
The SC16IS752 device configuration.
Definition
sc16is752.h:58
atsam_sc16is752_spi_config::spi_speed_hz
uint32_t spi_speed_hz
The SPI bus speed in Hertz.
Definition
sc16is752.h:89
atsam_sc16is752_spi_config::spi_path
const char * spi_path
The SPI bus device path.
Definition
sc16is752.h:78
atsam_sc16is752_spi_config::input_frequency
uint32_t input_frequency
The input frequency in Hertz of the SC16IS752 chip. See XTAL1 and XTAL2 pins.
Definition
sc16is752.h:73
atsam_sc16is752_spi_config::mode
sc16is752_mode mode
The SC16IS752 mode.
Definition
sc16is752.h:67
atsam_sc16is752_spi_config::server_index
uint32_t server_index
The index to identify the interrupt server used for interrupt processing.
Definition
sc16is752.h:101
atsam_sc16is752_spi_config::spi_chip_select
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
atsam_sc16is752_spi_config::device_path
const char * device_path
The device file path for the new device.
Definition
sc16is752.h:62
atsam_sc16is752_spi_config::irq_pin
const Pin irq_pin
The interrupt pin, e.g. { PIO_PD28, PIOD, ID_PIOD, PIO_INPUT, PIO_IT_LOW_LEVEL }.
Definition
sc16is752.h:95
atsam_sc16is752_spi_context
The SC16IS752 device context.
Definition
sc16is752.h:45
rtems_interrupt_server_action
This structure represents an interrupt server action.
Definition
intr.h:2989
rtems_interrupt_server_entry
This structure represents an interrupt server entry.
Definition
intr.h:3028
sc16is752_spi_context
SC16IS752 SPI context.
Definition
sc16is752.h:194
Generated by
1.18.0