drivers: pinctrl: nrf: fix nordic,nrf-twi handling on nRF51/52
The NRF_TWI_Type struct doesn't have an homogeneous layout between nRF51/52 series. This patch tries to select the right layout based on selected SoC. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
49edd8558b
commit
c1ad91405d
1 changed files with 4 additions and 0 deletions
|
@ -48,7 +48,11 @@ BUILD_ASSERT(((NRF_DRIVE_S0S1 == NRF_GPIO_PIN_S0S1) &&
|
|||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spis) */
|
||||
|
||||
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_twi)
|
||||
#if !defined(TWI_PSEL_SCL_CONNECT_Pos)
|
||||
#define NRF_PSEL_TWIM(reg, line) ((NRF_TWI_Type *)reg)->PSEL##line
|
||||
#else
|
||||
#define NRF_PSEL_TWIM(reg, line) ((NRF_TWI_Type *)reg)->PSEL.line
|
||||
#endif
|
||||
#elif DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_twim)
|
||||
#define NRF_PSEL_TWIM(reg, line) ((NRF_TWIM_Type *)reg)->PSEL.line
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue