1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup mpc55xx_dspi |
---|
5 | * |
---|
6 | * @brief Header file for the LibI2C bus driver for the Deserial Serial Peripheral Interface (DSPI). |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2008 |
---|
11 | * Embedded Brains GmbH |
---|
12 | * Obere Lagerstr. 30 |
---|
13 | * D-82178 Puchheim |
---|
14 | * Germany |
---|
15 | * rtems@embedded-brains.de |
---|
16 | * |
---|
17 | * The license and distribution terms for this file may be found in the file |
---|
18 | * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE. |
---|
19 | */ |
---|
20 | |
---|
21 | /** |
---|
22 | * @defgroup mpc55xx_dspi Deserial Serial Peripheral Interface (DSPI) |
---|
23 | * |
---|
24 | * @ingroup mpc55xx |
---|
25 | */ |
---|
26 | |
---|
27 | #ifndef LIBCPU_POWERPC_MPC55XX_DSPI_H |
---|
28 | #define LIBCPU_POWERPC_MPC55XX_DSPI_H |
---|
29 | |
---|
30 | #include <rtems/libi2c.h> |
---|
31 | |
---|
32 | #include <mpc55xx/edma.h> |
---|
33 | |
---|
34 | #ifdef __cplusplus |
---|
35 | extern "C" { |
---|
36 | #endif /* __cplusplus */ |
---|
37 | |
---|
38 | struct DSPI_tag; |
---|
39 | |
---|
40 | /** |
---|
41 | * @brief LibI2C bus driver entry. |
---|
42 | */ |
---|
43 | typedef struct { |
---|
44 | /** |
---|
45 | * @brief Standard bus driver fields. |
---|
46 | */ |
---|
47 | rtems_libi2c_bus_t bus; |
---|
48 | |
---|
49 | /** |
---|
50 | * @brief Index in the bus table: @ref mpc55xx_dspi_bus_table. |
---|
51 | */ |
---|
52 | unsigned table_index; |
---|
53 | |
---|
54 | /** |
---|
55 | * @brief Bus number (available after rtems_libi2c_register_bus()). |
---|
56 | * |
---|
57 | * @note You must set it in the initialization code after the bus registration. |
---|
58 | */ |
---|
59 | unsigned bus_number; |
---|
60 | |
---|
61 | /** |
---|
62 | * @brief Hardware registers. |
---|
63 | */ |
---|
64 | volatile struct DSPI_tag *regs; |
---|
65 | |
---|
66 | /** |
---|
67 | * @brief Selects SPI master or slave mode. |
---|
68 | */ |
---|
69 | bool master; |
---|
70 | |
---|
71 | /** |
---|
72 | * @brief Data for the Push Register. |
---|
73 | */ |
---|
74 | union DSPI_PUSHR_tag push_data; |
---|
75 | |
---|
76 | /** |
---|
77 | * @brief eDMA entry for transmission. |
---|
78 | * |
---|
79 | * The channel is fixed to a particular DSPI. |
---|
80 | */ |
---|
81 | mpc55xx_edma_channel_entry edma_transmit; |
---|
82 | |
---|
83 | /** |
---|
84 | * @brief eDMA entry for push data generation. |
---|
85 | * |
---|
86 | * You can choose every available channel. |
---|
87 | */ |
---|
88 | mpc55xx_edma_channel_entry edma_push; |
---|
89 | |
---|
90 | /** |
---|
91 | * @brief eDMA entry for receiving. |
---|
92 | * |
---|
93 | * The channel is fixed to a particular DSPI. |
---|
94 | */ |
---|
95 | mpc55xx_edma_channel_entry edma_receive; |
---|
96 | |
---|
97 | /** |
---|
98 | * @brief Idle character transmitted in read only mode. |
---|
99 | */ |
---|
100 | uint32_t idle_char; |
---|
101 | |
---|
102 | /** |
---|
103 | * @brief Current baud. |
---|
104 | */ |
---|
105 | uint32_t baud; |
---|
106 | } mpc55xx_dspi_bus_entry; |
---|
107 | |
---|
108 | /** |
---|
109 | * @brief Number of DSPIs. |
---|
110 | */ |
---|
111 | #define MPC55XX_DSPI_NUMBER 4 |
---|
112 | |
---|
113 | /** |
---|
114 | * @brief Table with bus driver entries. |
---|
115 | */ |
---|
116 | extern mpc55xx_dspi_bus_entry mpc55xx_dspi_bus_table [ /* MPC55XX_DSPI_NUMBER */ ]; |
---|
117 | |
---|
118 | #ifdef __cplusplus |
---|
119 | } |
---|
120 | #endif /* __cplusplus */ |
---|
121 | |
---|
122 | #endif /* LIBCPU_POWERPC_MPC55XX_DSPI_H */ |
---|