RTEMS: bsps/arm/atsam/include/bsp/sc16is752.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
sc16is752.h
1/*
2 * Copyright (c) 2016 embedded brains GmbH. All rights reserved.
3 *
4 * embedded brains GmbH
5 * Dornierstr. 4
6 * 82178 Puchheim
7 * Germany
8 * <info@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifndef LIBBSP_ARM_ATSAM_SC16IS752_H
16#define LIBBSP_ARM_ATSAM_SC16IS752_H
17
18#include <rtems/irq-extension.h>
19#include <libchip/chip.h>
20
21#include <dev/serial/sc16is752.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif /* __cplusplus */
26
32 typedef struct {
33 sc16is752_spi_context base;
34 Pin irq_pin;
35 rtems_interrupt_server_entry irqs_entry;
36 rtems_interrupt_server_action irqs_action;
37 uint32_t irqs_index;
38} atsam_sc16is752_spi_context;
39
45 typedef struct {
49 const char *device_path;
50
54 sc16is752_mode mode;
55
60 uint32_t input_frequency;
61
65 const char *spi_path;
66
71 uint8_t spi_chip_select;
72
76 uint32_t spi_speed_hz;
77
82 const Pin irq_pin;
83
88 uint32_t server_index;
89} atsam_sc16is752_spi_config;
90
103int atsam_sc16is752_spi_create(
104 atsam_sc16is752_spi_context *ctx,
105 const atsam_sc16is752_spi_config *config
106);
107
108#ifdef __cplusplus
109}
110#endif /* __cplusplus */
111
112#endif /* LIBBSP_ARM_ATSAM_SC16IS752_H */
irq-extension.h
Header file for the Interrupt Manager Extension.
_Pin
Definition: pio.h:172
atsam_sc16is752_spi_config
The SC16IS752 device configuration.
Definition: sc16is752.h:45
atsam_sc16is752_spi_config::spi_speed_hz
uint32_t spi_speed_hz
The SPI bus speed in Hertz.
Definition: sc16is752.h:76
atsam_sc16is752_spi_config::spi_path
const char * spi_path
The SPI bus device path.
Definition: sc16is752.h:65
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:60
atsam_sc16is752_spi_config::mode
sc16is752_mode mode
The SC16IS752 mode.
Definition: sc16is752.h:54
atsam_sc16is752_spi_config::server_index
uint32_t server_index
The index to identify the interrupt server used for interrupt processing.
Definition: sc16is752.h:88
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:71
atsam_sc16is752_spi_config::device_path
const char * device_path
The device file path for the new device.
Definition: sc16is752.h:49
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:82
atsam_sc16is752_spi_context
The SC16IS752 device context.
Definition: sc16is752.h:32
config_s
Definition: deflate.c:115
rtems_interrupt_server_action
An interrupt server action.
Definition: irq-extension.h:245
rtems_interrupt_server_entry
An interrupt server entry.
Definition: irq-extension.h:337
sc16is752_spi_context
SC16IS752 SPI context.
Definition: sc16is752.h:181