Lines Matching refs:p_reg

183 NRF_STATIC_INLINE void nrf_twis_task_trigger(NRF_TWIS_Type * p_reg, nrf_twis_task_t task);
193 NRF_STATIC_INLINE uint32_t nrf_twis_task_address_get(NRF_TWIS_Type const * p_reg,
202 NRF_STATIC_INLINE void nrf_twis_event_clear(NRF_TWIS_Type * p_reg, nrf_twis_event_t event);
213 NRF_STATIC_INLINE bool nrf_twis_event_check(NRF_TWIS_Type const * p_reg, nrf_twis_event_t event);
226 NRF_STATIC_INLINE bool nrf_twis_event_get_and_clear(NRF_TWIS_Type * p_reg, nrf_twis_event_t event);
236 NRF_STATIC_INLINE uint32_t nrf_twis_event_address_get(NRF_TWIS_Type const * p_reg,
245 NRF_STATIC_INLINE void nrf_twis_shorts_enable(NRF_TWIS_Type * p_reg, uint32_t mask);
253 NRF_STATIC_INLINE void nrf_twis_shorts_disable(NRF_TWIS_Type * p_reg, uint32_t mask);
264 NRF_STATIC_INLINE uint32_t nrf_twis_shorts_get(NRF_TWIS_Type const * p_reg);
273 NRF_STATIC_INLINE void nrf_twis_int_enable(NRF_TWIS_Type * p_reg, uint32_t mask);
284 NRF_STATIC_INLINE uint32_t nrf_twis_int_enable_check(NRF_TWIS_Type const * p_reg, uint32_t mask);
293 NRF_STATIC_INLINE void nrf_twis_int_disable(NRF_TWIS_Type * p_reg, uint32_t mask);
303 NRF_STATIC_INLINE void nrf_twis_subscribe_set(NRF_TWIS_Type * p_reg,
314 NRF_STATIC_INLINE void nrf_twis_subscribe_clear(NRF_TWIS_Type * p_reg, nrf_twis_task_t task);
323 NRF_STATIC_INLINE void nrf_twis_publish_set(NRF_TWIS_Type * p_reg,
333 NRF_STATIC_INLINE void nrf_twis_publish_clear(NRF_TWIS_Type * p_reg, nrf_twis_event_t event);
345 NRF_STATIC_INLINE uint32_t nrf_twis_error_source_get_and_clear(NRF_TWIS_Type * p_reg);
357 NRF_STATIC_INLINE uint_fast8_t nrf_twis_match_get(NRF_TWIS_Type const * p_reg);
364 NRF_STATIC_INLINE void nrf_twis_enable(NRF_TWIS_Type * p_reg);
371 NRF_STATIC_INLINE void nrf_twis_disable(NRF_TWIS_Type * p_reg);
381 NRF_STATIC_INLINE bool nrf_twis_enable_check(NRF_TWIS_Type const * p_reg);
390 NRF_STATIC_INLINE void nrf_twis_pins_set(NRF_TWIS_Type * p_reg, uint32_t scl, uint32_t sda);
398 NRF_STATIC_INLINE void nrf_twis_scl_pin_set(NRF_TWIS_Type * p_reg, uint32_t pin);
407 NRF_STATIC_INLINE uint32_t nrf_twis_scl_pin_get(NRF_TWIS_Type const * p_reg);
415 NRF_STATIC_INLINE void nrf_twis_sda_pin_set(NRF_TWIS_Type * p_reg, uint32_t pin);
424 NRF_STATIC_INLINE uint32_t nrf_twis_sda_pin_get(NRF_TWIS_Type const * p_reg);
433 NRF_STATIC_INLINE void nrf_twis_rx_buffer_set(NRF_TWIS_Type * p_reg,
444 NRF_STATIC_INLINE uint8_t * nrf_twis_rx_buffer_get(NRF_TWIS_Type const * p_reg);
455 NRF_STATIC_INLINE void nrf_twis_rx_prepare(NRF_TWIS_Type * p_reg, uint8_t * p_buf, size_t length);
464 NRF_STATIC_INLINE size_t nrf_twis_rx_amount_get(NRF_TWIS_Type const * p_reg);
473 NRF_STATIC_INLINE void nrf_twis_tx_buffer_set(NRF_TWIS_Type * p_reg,
484 NRF_STATIC_INLINE uint8_t * nrf_twis_tx_buffer_get(NRF_TWIS_Type const * p_reg);
495 NRF_STATIC_INLINE void nrf_twis_tx_prepare(NRF_TWIS_Type * p_reg,
506 NRF_STATIC_INLINE size_t nrf_twis_tx_amount_get(NRF_TWIS_Type const * p_reg);
520 NRF_STATIC_INLINE void nrf_twis_address_set(NRF_TWIS_Type * p_reg,
534 NRF_STATIC_INLINE nrf_twis_address_t nrf_twis_address_get(NRF_TWIS_Type const * p_reg,
545 NRF_STATIC_INLINE void nrf_twis_config_address_set(NRF_TWIS_Type * p_reg,
556 nrf_twis_config_addr_mask_t nrf_twis_config_address_get(NRF_TWIS_Type const * p_reg);
565 NRF_STATIC_INLINE void nrf_twis_orc_set(NRF_TWIS_Type * p_reg, uint8_t orc);
574 NRF_STATIC_INLINE uint8_t nrf_twis_orc_get(NRF_TWIS_Type const * p_reg);
582 NRF_STATIC_INLINE void nrf_twis_tx_list_enable(NRF_TWIS_Type * p_reg);
589 NRF_STATIC_INLINE void nrf_twis_tx_list_disable(NRF_TWIS_Type * p_reg);
596 NRF_STATIC_INLINE void nrf_twis_rx_list_enable(NRF_TWIS_Type * p_reg);
603 NRF_STATIC_INLINE void nrf_twis_rx_list_disable(NRF_TWIS_Type * p_reg);
624 NRF_STATIC_INLINE volatile uint32_t* nrf_twis_getRegPtr(NRF_TWIS_Type * p_reg, uint32_t offset) in nrf_twis_getRegPtr() argument
626 return (volatile uint32_t*)((uint8_t *)p_reg + (uint32_t)offset); in nrf_twis_getRegPtr()
639 NRF_STATIC_INLINE volatile const uint32_t* nrf_twis_getRegPtr_c(NRF_TWIS_Type const * p_reg, in nrf_twis_getRegPtr_c() argument
642 return (volatile const uint32_t*)((uint8_t const *)p_reg + (uint32_t)offset); in nrf_twis_getRegPtr_c()
651 NRF_STATIC_INLINE void nrf_twis_task_trigger(NRF_TWIS_Type * p_reg, nrf_twis_task_t task) in nrf_twis_task_trigger() argument
653 *(nrf_twis_getRegPtr(p_reg, (uint32_t)task)) = 1UL; in nrf_twis_task_trigger()
656 NRF_STATIC_INLINE uint32_t nrf_twis_task_address_get(NRF_TWIS_Type const * p_reg, in nrf_twis_task_address_get() argument
659 return (uint32_t)nrf_twis_getRegPtr_c(p_reg, (uint32_t)task); in nrf_twis_task_address_get()
662 NRF_STATIC_INLINE void nrf_twis_event_clear(NRF_TWIS_Type * p_reg, nrf_twis_event_t event) in nrf_twis_event_clear() argument
664 *(nrf_twis_getRegPtr(p_reg, (uint32_t)event)) = 0UL; in nrf_twis_event_clear()
665 nrf_event_readback((uint8_t *)p_reg + (uint32_t)event); in nrf_twis_event_clear()
668 NRF_STATIC_INLINE bool nrf_twis_event_check(NRF_TWIS_Type const * p_reg, nrf_twis_event_t event) in nrf_twis_event_check() argument
670 return (bool)*nrf_twis_getRegPtr_c(p_reg, (uint32_t)event); in nrf_twis_event_check()
673 NRF_STATIC_INLINE bool nrf_twis_event_get_and_clear(NRF_TWIS_Type * p_reg, nrf_twis_event_t event) in nrf_twis_event_get_and_clear() argument
675 bool ret = nrf_twis_event_check(p_reg, event); in nrf_twis_event_get_and_clear()
678 nrf_twis_event_clear(p_reg, event); in nrf_twis_event_get_and_clear()
683 NRF_STATIC_INLINE uint32_t nrf_twis_event_address_get(NRF_TWIS_Type const * p_reg, in nrf_twis_event_address_get() argument
686 return (uint32_t)nrf_twis_getRegPtr_c(p_reg, (uint32_t)event); in nrf_twis_event_address_get()
689 NRF_STATIC_INLINE void nrf_twis_shorts_enable(NRF_TWIS_Type * p_reg, uint32_t mask) in nrf_twis_shorts_enable() argument
691 p_reg->SHORTS |= mask; in nrf_twis_shorts_enable()
694 NRF_STATIC_INLINE void nrf_twis_shorts_disable(NRF_TWIS_Type * p_reg, uint32_t mask) in nrf_twis_shorts_disable() argument
699 p_reg->SHORTS = 0; in nrf_twis_shorts_disable()
703 p_reg->SHORTS &= ~mask; in nrf_twis_shorts_disable()
707 NRF_STATIC_INLINE uint32_t nrf_twis_shorts_get(NRF_TWIS_Type const * p_reg) in nrf_twis_shorts_get() argument
709 return p_reg->SHORTS; in nrf_twis_shorts_get()
712 NRF_STATIC_INLINE void nrf_twis_int_enable(NRF_TWIS_Type * p_reg, uint32_t mask) in nrf_twis_int_enable() argument
714 p_reg->INTENSET = mask; in nrf_twis_int_enable()
717 NRF_STATIC_INLINE uint32_t nrf_twis_int_enable_check(NRF_TWIS_Type const * p_reg, uint32_t mask) in nrf_twis_int_enable_check() argument
719 return p_reg->INTENSET & mask; in nrf_twis_int_enable_check()
722 NRF_STATIC_INLINE void nrf_twis_int_disable(NRF_TWIS_Type * p_reg, uint32_t mask) in nrf_twis_int_disable() argument
724 p_reg->INTENCLR = mask; in nrf_twis_int_disable()
728 NRF_STATIC_INLINE void nrf_twis_subscribe_set(NRF_TWIS_Type * p_reg, in nrf_twis_subscribe_set() argument
732 *((volatile uint32_t *) ((uint8_t *) p_reg + (uint32_t) task + 0x80uL)) = in nrf_twis_subscribe_set()
736 NRF_STATIC_INLINE void nrf_twis_subscribe_clear(NRF_TWIS_Type * p_reg, nrf_twis_task_t task) in nrf_twis_subscribe_clear() argument
738 *((volatile uint32_t *) ((uint8_t *) p_reg + (uint32_t) task + 0x80uL)) = 0; in nrf_twis_subscribe_clear()
741 NRF_STATIC_INLINE void nrf_twis_publish_set(NRF_TWIS_Type * p_reg, in nrf_twis_publish_set() argument
745 *((volatile uint32_t *) ((uint8_t *) p_reg + (uint32_t) event + 0x80uL)) = in nrf_twis_publish_set()
749 NRF_STATIC_INLINE void nrf_twis_publish_clear(NRF_TWIS_Type * p_reg, nrf_twis_event_t event) in nrf_twis_publish_clear() argument
751 *((volatile uint32_t *) ((uint8_t *) p_reg + (uint32_t) event + 0x80uL)) = 0; in nrf_twis_publish_clear()
755 NRF_STATIC_INLINE uint32_t nrf_twis_error_source_get_and_clear(NRF_TWIS_Type * p_reg) in nrf_twis_error_source_get_and_clear() argument
757 uint32_t ret = p_reg->ERRORSRC; in nrf_twis_error_source_get_and_clear()
758 p_reg->ERRORSRC = ret; in nrf_twis_error_source_get_and_clear()
762 NRF_STATIC_INLINE uint_fast8_t nrf_twis_match_get(NRF_TWIS_Type const * p_reg) in nrf_twis_match_get() argument
764 return (uint_fast8_t)p_reg->MATCH; in nrf_twis_match_get()
767 NRF_STATIC_INLINE void nrf_twis_enable(NRF_TWIS_Type * p_reg) in nrf_twis_enable() argument
769 p_reg->ENABLE = (TWIS_ENABLE_ENABLE_Enabled << TWIS_ENABLE_ENABLE_Pos); in nrf_twis_enable()
772 NRF_STATIC_INLINE void nrf_twis_disable(NRF_TWIS_Type * p_reg) in nrf_twis_disable() argument
774 p_reg->ENABLE = (TWIS_ENABLE_ENABLE_Disabled << TWIS_ENABLE_ENABLE_Pos); in nrf_twis_disable()
777 NRF_STATIC_INLINE bool nrf_twis_enable_check(NRF_TWIS_Type const * p_reg) in nrf_twis_enable_check() argument
779 return (p_reg->ENABLE == (TWIS_ENABLE_ENABLE_Enabled << TWIS_ENABLE_ENABLE_Pos)); in nrf_twis_enable_check()
782 NRF_STATIC_INLINE void nrf_twis_pins_set(NRF_TWIS_Type * p_reg, uint32_t scl, uint32_t sda) in nrf_twis_pins_set() argument
784 p_reg->PSEL.SCL = scl; in nrf_twis_pins_set()
785 p_reg->PSEL.SDA = sda; in nrf_twis_pins_set()
788 NRF_STATIC_INLINE void nrf_twis_scl_pin_set(NRF_TWIS_Type * p_reg, uint32_t pin) in nrf_twis_scl_pin_set() argument
790 p_reg->PSEL.SCL = pin; in nrf_twis_scl_pin_set()
793 NRF_STATIC_INLINE uint32_t nrf_twis_scl_pin_get(NRF_TWIS_Type const * p_reg) in nrf_twis_scl_pin_get() argument
795 return p_reg->PSEL.SCL; in nrf_twis_scl_pin_get()
798 NRF_STATIC_INLINE void nrf_twis_sda_pin_set(NRF_TWIS_Type * p_reg, uint32_t pin) in nrf_twis_sda_pin_set() argument
800 p_reg->PSEL.SDA = pin; in nrf_twis_sda_pin_set()
803 NRF_STATIC_INLINE uint32_t nrf_twis_sda_pin_get(NRF_TWIS_Type const * p_reg) in nrf_twis_sda_pin_get() argument
805 return p_reg->PSEL.SDA; in nrf_twis_sda_pin_get()
808 NRF_STATIC_INLINE void nrf_twis_rx_buffer_set(NRF_TWIS_Type * p_reg, uint8_t * p_buf, size_t length) in nrf_twis_rx_buffer_set() argument
811 p_reg->DMA.RX.PTR = (uint32_t)p_buf; in nrf_twis_rx_buffer_set()
812 p_reg->DMA.RX.MAXCNT = (uint32_t)length; in nrf_twis_rx_buffer_set()
814 p_reg->RXD.PTR = (uint32_t)p_buf; in nrf_twis_rx_buffer_set()
815 p_reg->RXD.MAXCNT = length; in nrf_twis_rx_buffer_set()
819 NRF_STATIC_INLINE uint8_t * nrf_twis_rx_buffer_get(NRF_TWIS_Type const * p_reg) in nrf_twis_rx_buffer_get() argument
822 return (uint8_t *)p_reg->DMA.RX.PTR; in nrf_twis_rx_buffer_get()
824 return (uint8_t *)p_reg->RXD.PTR; in nrf_twis_rx_buffer_get()
828 NRF_STATIC_INLINE void nrf_twis_rx_prepare(NRF_TWIS_Type * p_reg, uint8_t * p_buf, size_t length) in nrf_twis_rx_prepare() argument
830 nrf_twis_rx_buffer_set(p_reg, p_buf, length); in nrf_twis_rx_prepare()
831 nrf_twis_task_trigger(p_reg, NRF_TWIS_TASK_PREPARERX); in nrf_twis_rx_prepare()
834 NRF_STATIC_INLINE size_t nrf_twis_rx_amount_get(NRF_TWIS_Type const * p_reg) in nrf_twis_rx_amount_get() argument
837 return p_reg->DMA.RX.AMOUNT; in nrf_twis_rx_amount_get()
839 return p_reg->RXD.AMOUNT; in nrf_twis_rx_amount_get()
843 NRF_STATIC_INLINE void nrf_twis_tx_buffer_set(NRF_TWIS_Type * p_reg, in nrf_twis_tx_buffer_set() argument
848 p_reg->DMA.TX.PTR = (uint32_t)p_buf; in nrf_twis_tx_buffer_set()
849 p_reg->DMA.TX.MAXCNT = (uint32_t)length; in nrf_twis_tx_buffer_set()
851 p_reg->TXD.PTR = (uint32_t)p_buf; in nrf_twis_tx_buffer_set()
852 p_reg->TXD.MAXCNT = length; in nrf_twis_tx_buffer_set()
856 NRF_STATIC_INLINE uint8_t * nrf_twis_tx_buffer_get(NRF_TWIS_Type const * p_reg) in nrf_twis_tx_buffer_get() argument
859 return (uint8_t *)p_reg->DMA.TX.PTR; in nrf_twis_tx_buffer_get()
861 return (uint8_t *)p_reg->TXD.PTR; in nrf_twis_tx_buffer_get()
865 NRF_STATIC_INLINE void nrf_twis_tx_prepare(NRF_TWIS_Type * p_reg, in nrf_twis_tx_prepare() argument
869 nrf_twis_tx_buffer_set(p_reg, p_buf, length); in nrf_twis_tx_prepare()
870 nrf_twis_task_trigger(p_reg, NRF_TWIS_TASK_PREPARETX); in nrf_twis_tx_prepare()
873 NRF_STATIC_INLINE size_t nrf_twis_tx_amount_get(NRF_TWIS_Type const * p_reg) in nrf_twis_tx_amount_get() argument
876 return p_reg->DMA.TX.AMOUNT; in nrf_twis_tx_amount_get()
878 return p_reg->TXD.AMOUNT; in nrf_twis_tx_amount_get()
882 NRF_STATIC_INLINE void nrf_twis_address_set(NRF_TWIS_Type * p_reg, in nrf_twis_address_set() argument
887 p_reg->ADDRESS[n] = (uint32_t)addr; in nrf_twis_address_set()
890 NRF_STATIC_INLINE nrf_twis_address_t nrf_twis_address_get(NRF_TWIS_Type const * p_reg, in nrf_twis_address_get() argument
893 return (nrf_twis_address_t)p_reg->ADDRESS[n]; in nrf_twis_address_get()
896 NRF_STATIC_INLINE void nrf_twis_config_address_set(NRF_TWIS_Type * p_reg, in nrf_twis_config_address_set() argument
900 p_reg->CONFIG = (uint32_t)addr_mask; in nrf_twis_config_address_set()
904 nrf_twis_config_addr_mask_t nrf_twis_config_address_get(NRF_TWIS_Type const * p_reg) in nrf_twis_config_address_get() argument
906 return (nrf_twis_config_addr_mask_t)(p_reg->CONFIG & NRF_TWIS_CONFIG_ADDRESS01_MASK); in nrf_twis_config_address_get()
909 NRF_STATIC_INLINE void nrf_twis_orc_set(NRF_TWIS_Type * p_reg, uint8_t orc) in nrf_twis_orc_set() argument
911 p_reg->ORC = orc; in nrf_twis_orc_set()
914 NRF_STATIC_INLINE uint8_t nrf_twis_orc_get(NRF_TWIS_Type const * p_reg) in nrf_twis_orc_get() argument
916 return (uint8_t)p_reg->ORC; in nrf_twis_orc_get()
920 NRF_STATIC_INLINE void nrf_twis_tx_list_enable(NRF_TWIS_Type * p_reg) in nrf_twis_tx_list_enable() argument
922 p_reg->TXD.LIST = TWIS_TXD_LIST_LIST_ArrayList << TWIS_TXD_LIST_LIST_Pos; in nrf_twis_tx_list_enable()
925 NRF_STATIC_INLINE void nrf_twis_tx_list_disable(NRF_TWIS_Type * p_reg) in nrf_twis_tx_list_disable() argument
927 p_reg->TXD.LIST = TWIS_TXD_LIST_LIST_Disabled << TWIS_TXD_LIST_LIST_Pos; in nrf_twis_tx_list_disable()
930 NRF_STATIC_INLINE void nrf_twis_rx_list_enable(NRF_TWIS_Type * p_reg) in nrf_twis_rx_list_enable() argument
932 p_reg->RXD.LIST = TWIS_RXD_LIST_LIST_ArrayList << TWIS_RXD_LIST_LIST_Pos; in nrf_twis_rx_list_enable()
935 NRF_STATIC_INLINE void nrf_twis_rx_list_disable(NRF_TWIS_Type * p_reg) in nrf_twis_rx_list_disable() argument
937 p_reg->RXD.LIST = TWIS_RXD_LIST_LIST_Disabled << TWIS_RXD_LIST_LIST_Pos; in nrf_twis_rx_list_disable()