123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- #ifndef NRFX_PRS_H__
- #define NRFX_PRS_H__
- #include <nrfx.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #if defined(NRF51)
-
- #define NRFX_PRS_BOX_0_ADDR NRF_SPI0
-
- #define NRFX_PRS_BOX_1_ADDR NRF_SPI1
- #elif defined(NRF52810_XXAA)
-
- #define NRFX_PRS_BOX_0_ADDR NRF_TWIM0
-
- #define NRFX_PRS_BOX_1_ADDR NRF_SPIM0
-
- #define NRFX_PRS_BOX_2_ADDR NRF_UARTE0
- #elif defined(NRF52811_XXAA)
-
- #define NRFX_PRS_BOX_0_ADDR NRF_TWIM0
-
- #define NRFX_PRS_BOX_1_ADDR NRF_SPIM0
-
- #define NRFX_PRS_BOX_2_ADDR NRF_UART0
- #elif defined(NRF52820_XXAA)
-
- #define NRFX_PRS_BOX_0_ADDR NRF_SPIM0
-
- #define NRFX_PRS_BOX_1_ADDR NRF_SPIM1
-
- #define NRFX_PRS_BOX_2_ADDR NRF_UARTE0
- #elif defined(NRF52832_XXAA) || defined(NRF52832_XXAB) || \
- defined(NRF52833_XXAA) || defined(NRF52840_XXAA)
-
- #define NRFX_PRS_BOX_0_ADDR NRF_SPIM0
-
- #define NRFX_PRS_BOX_1_ADDR NRF_SPIM1
-
- #define NRFX_PRS_BOX_2_ADDR NRF_SPIM2
-
- #define NRFX_PRS_BOX_3_ADDR NRF_COMP
-
- #define NRFX_PRS_BOX_4_ADDR NRF_UARTE0
- #elif defined(NRF9160_XXAA)
-
- #define NRFX_PRS_BOX_0_ADDR NRF_UARTE0
-
- #define NRFX_PRS_BOX_1_ADDR NRF_UARTE1
-
- #define NRFX_PRS_BOX_2_ADDR NRF_UARTE2
-
- #define NRFX_PRS_BOX_3_ADDR NRF_UARTE3
- #else
- #error "Unknown device."
- #endif
- nrfx_err_t nrfx_prs_acquire(void const * p_base_addr,
- nrfx_irq_handler_t irq_handler);
- void nrfx_prs_release(void const * p_base_addr);
- void nrfx_prs_box_0_irq_handler(void);
- void nrfx_prs_box_1_irq_handler(void);
- void nrfx_prs_box_2_irq_handler(void);
- void nrfx_prs_box_3_irq_handler(void);
- void nrfx_prs_box_4_irq_handler(void);
- #ifdef __cplusplus
- }
- #endif
- #endif
|