Landfall

Annotated pkg/landfall-examples/hw_info/defs.h

254:a437381bd5f4
9 months ago Paul Boddie Employed get_channel to eliminate redundant code. cpm-library-improvements
paul@218 1
/*
paul@218 2
 * Common declarations for chip-specific definitions.
paul@218 3
 *
paul@253 4
 * Copyright (C) 2023, 2024 Paul Boddie <paul@boddie.org.uk>
paul@218 5
 *
paul@218 6
 * This program is free software; you can redistribute it and/or
paul@218 7
 * modify it under the terms of the GNU General Public License as
paul@218 8
 * published by the Free Software Foundation; either version 2 of
paul@218 9
 * the License, or (at your option) any later version.
paul@218 10
 *
paul@218 11
 * This program is distributed in the hope that it will be useful,
paul@218 12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
paul@218 13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
paul@218 14
 * GNU General Public License for more details.
paul@218 15
 *
paul@218 16
 * You should have received a copy of the GNU General Public License
paul@218 17
 * along with this program; if not, write to the Free Software
paul@218 18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
paul@218 19
 * Boston, MA  02110-1301, USA
paul@218 20
 */
paul@218 21
paul@218 22
#pragma once
paul@218 23
paul@218 24
#include "common.h"
paul@218 25
paul@218 26
paul@218 27
paul@218 28
/* Memory regions. */
paul@218 29
paul@236 30
extern const char *io_memory_regions[];
paul@218 31
paul@218 32
paul@218 33
paul@218 34
/* AIC definitions. */
paul@218 35
paul@218 36
extern void *aic_channels[];
paul@218 37
paul@218 38
extern const unsigned int num_aic_channels;
paul@218 39
paul@218 40
extern l4_cap_idx_t aic_irqs[];
paul@218 41
paul@218 42
paul@218 43
paul@218 44
/* CPM definitions. */
paul@218 45
paul@218 46
extern struct clock_info clocks[];
paul@218 47
paul@218 48
paul@218 49
paul@218 50
/* DMA definitions. */
paul@218 51
paul@218 52
extern void *dma_channels[];
paul@218 53
paul@218 54
extern const unsigned int num_dma_channels;
paul@218 55
paul@218 56
extern struct dma_region dma_regions[];
paul@218 57
paul@218 58
extern const unsigned int num_dma_regions;
paul@218 59
paul@218 60
extern l4_cap_idx_t dma_irq;
paul@218 61
paul@218 62
paul@218 63
paul@218 64
/* GPIO definitions. */
paul@218 65
paul@218 66
extern const unsigned int num_gpio_ports;
paul@218 67
paul@218 68
extern struct gpio_port gpio_ports[];
paul@218 69
paul@218 70
extern const char gpio_port_labels[];
paul@218 71
paul@218 72
paul@218 73
paul@218 74
/* I2C definitions. */
paul@218 75
paul@218 76
extern void *i2c_channels[];
paul@218 77
paul@218 78
extern const unsigned int num_i2c_channels;
paul@218 79
paul@218 80
extern l4_cap_idx_t i2c_irqs[];
paul@218 81
paul@218 82
paul@218 83
paul@218 84
/* SPI definitions. */
paul@218 85
paul@218 86
extern void *spi_channels[];
paul@218 87
paul@218 88
extern const unsigned int num_spi_channels;
paul@253 89
paul@253 90
paul@253 91
paul@253 92
/* TCU definitions. */
paul@253 93
paul@253 94
extern void *tcu_channels[];
paul@253 95
paul@253 96
extern const unsigned int num_tcu_channels;
paul@253 97
paul@253 98
extern l4_cap_idx_t tcu_irq;