Skip to content

Commit 5df8bf6

Browse files
committed
cpu/nrfxx: move uart_conf_t struct to periph_cpu_common.h
Signed-off-by: Dylan Laduranty <[email protected]>
1 parent aadb19e commit 5df8bf6

File tree

3 files changed

+25
-39
lines changed

3 files changed

+25
-39
lines changed

cpu/nrf52/include/periph_cpu.h

-17
Original file line numberDiff line numberDiff line change
@@ -201,23 +201,6 @@ typedef struct {
201201
} pwm_conf_t;
202202
#endif
203203

204-
#if !defined(CPU_MODEL_NRF52832XXAA)
205-
/**
206-
* @brief Structure for UART configuration data
207-
*/
208-
typedef struct {
209-
NRF_UARTE_Type *dev; /**< UART with EasyDMA device base
210-
* register address */
211-
gpio_t rx_pin; /**< RX pin */
212-
gpio_t tx_pin; /**< TX pin */
213-
#ifdef MODULE_PERIPH_UART_HW_FC
214-
gpio_t rts_pin; /**< RTS pin */
215-
gpio_t cts_pin; /**< CTS pin */
216-
#endif
217-
uint8_t irqn; /**< IRQ channel */
218-
} uart_conf_t;
219-
#endif
220-
221204
/**
222205
* @brief Size of the UART TX buffer for non-blocking mode.
223206
*/

cpu/nrf5x_common/include/periph_cpu_common.h

+25
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,31 @@ typedef struct {
277277
*/
278278
uint8_t gpio_int_get_exti(gpio_t pin);
279279

280+
#if !defined(CPU_MODEL_NRF52832XXAA) && !defined(CPU_FAM_NRF51)
281+
/**
282+
* @brief Structure for UART configuration data
283+
*/
284+
typedef struct {
285+
NRF_UARTE_Type *dev; /**< UART with EasyDMA device base
286+
* register address */
287+
gpio_t rx_pin; /**< RX pin */
288+
gpio_t tx_pin; /**< TX pin */
289+
#ifdef MODULE_PERIPH_UART_HW_FC
290+
gpio_t rts_pin; /**< RTS pin */
291+
gpio_t cts_pin; /**< CTS pin */
292+
#endif
293+
uint8_t irqn; /**< IRQ channel */
294+
} uart_conf_t;
295+
296+
/**
297+
* @brief Size of the UART TX buffer for non-blocking mode.
298+
*/
299+
#ifndef UART_TXBUF_SIZE
300+
#define UART_TXBUF_SIZE (64)
301+
#endif
302+
303+
#endif /* ndef CPU_MODEL_NRF52832XXAA && ndef CPU_FAM_NRF51 */
304+
280305
#ifdef __cplusplus
281306
}
282307
#endif

cpu/nrf9160/include/periph_cpu.h

-22
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,6 @@ extern "C" {
3636
*/
3737
#define PERIPH_CLOCK MHZ(16)
3838

39-
/**
40-
* @brief Structure for UART configuration data
41-
*/
42-
typedef struct {
43-
NRF_UARTE_Type *dev; /**< UART with EasyDMA device base
44-
* register address */
45-
gpio_t rx_pin; /**< RX pin */
46-
gpio_t tx_pin; /**< TX pin */
47-
#ifdef MODULE_PERIPH_UART_HW_FC
48-
gpio_t rts_pin; /**< RTS pin */
49-
gpio_t cts_pin; /**< CTS pin */
50-
#endif
51-
uint8_t irqn; /**< IRQ channel */
52-
} uart_conf_t;
53-
54-
/**
55-
* @brief Size of the UART TX buffer for non-blocking mode.
56-
*/
57-
#ifndef UART_TXBUF_SIZE
58-
#define UART_TXBUF_SIZE (64)
59-
#endif
60-
6139
#ifndef DOXYGEN
6240
/**
6341
* @brief Wrapper to fix differences between nRF9160 and

0 commit comments

Comments
 (0)