@@ -703,6 +703,24 @@ NRF_STATIC_INLINE void nrf_uarte_configure(NRF_UARTE_Type * p_reg,
703
703
NRF_STATIC_INLINE void nrf_uarte_baudrate_set (NRF_UARTE_Type * p_reg ,
704
704
nrf_uarte_baudrate_t baudrate );
705
705
706
+ /**
707
+ * @brief Function for setting the transmit buffer length.
708
+ *
709
+ * @param[in] p_reg Pointer to the structure of registers of the peripheral.
710
+ * @param[in] length Maximum number of data bytes to receive.
711
+ */
712
+ NRF_STATIC_INLINE void nrf_uarte_tx_maxcnt_set (NRF_UARTE_Type * p_reg ,
713
+ size_t length );
714
+
715
+ /**
716
+ * @brief Function for setting the transmit buffer pointer.
717
+ *
718
+ * @param[in] p_reg Pointer to the structure of registers of the peripheral.
719
+ * @param[in] p_buffer Pointer to the buffer for received data.
720
+ */
721
+ NRF_STATIC_INLINE void nrf_uarte_tx_ptr_set (NRF_UARTE_Type * p_reg ,
722
+ uint8_t const * p_buffer );
723
+
706
724
/**
707
725
* @brief Function for setting the transmit buffer.
708
726
*
@@ -732,6 +750,24 @@ NRF_STATIC_INLINE uint8_t const * nrf_uarte_tx_buffer_get(NRF_UARTE_Type * p_reg
732
750
*/
733
751
NRF_STATIC_INLINE uint32_t nrf_uarte_tx_amount_get (NRF_UARTE_Type const * p_reg );
734
752
753
+ /**
754
+ * @brief Function for setting the receive buffer length.
755
+ *
756
+ * @param[in] p_reg Pointer to the structure of registers of the peripheral.
757
+ * @param[in] length Maximum number of data bytes to receive.
758
+ */
759
+ NRF_STATIC_INLINE void nrf_uarte_rx_maxcnt_set (NRF_UARTE_Type * p_reg ,
760
+ size_t length );
761
+
762
+ /**
763
+ * @brief Function for setting the receive buffer pointer.
764
+ *
765
+ * @param[in] p_reg Pointer to the structure of registers of the peripheral.
766
+ * @param[in] p_buffer Pointer to the buffer for received data.
767
+ */
768
+ NRF_STATIC_INLINE void nrf_uarte_rx_ptr_set (NRF_UARTE_Type * p_reg ,
769
+ uint8_t * p_buffer );
770
+
735
771
/**
736
772
* @brief Function for setting the receive buffer.
737
773
*
@@ -1020,19 +1056,34 @@ NRF_STATIC_INLINE void nrf_uarte_baudrate_set(NRF_UARTE_Type * p_reg, nrf_uarte_
1020
1056
p_reg -> BAUDRATE = baudrate ;
1021
1057
}
1022
1058
1023
- NRF_STATIC_INLINE void nrf_uarte_tx_buffer_set (NRF_UARTE_Type * p_reg ,
1024
- uint8_t const * p_buffer ,
1059
+ NRF_STATIC_INLINE void nrf_uarte_tx_maxcnt_set (NRF_UARTE_Type * p_reg ,
1025
1060
size_t length )
1026
1061
{
1027
1062
#if NRF_UARTE_HAS_DMA_REG
1028
- p_reg -> DMA .TX .PTR = (uint32_t )p_buffer ;
1029
1063
p_reg -> DMA .TX .MAXCNT = length ;
1030
1064
#else
1031
- p_reg -> TXD .PTR = (uint32_t )p_buffer ;
1032
1065
p_reg -> TXD .MAXCNT = length ;
1033
1066
#endif
1034
1067
}
1035
1068
1069
+ NRF_STATIC_INLINE void nrf_uarte_tx_ptr_set (NRF_UARTE_Type * p_reg ,
1070
+ uint8_t const * p_buffer )
1071
+ {
1072
+ #if NRF_UARTE_HAS_DMA_REG
1073
+ p_reg -> DMA .TX .PTR = (uint32_t )p_buffer ;
1074
+ #else
1075
+ p_reg -> TXD .PTR = (uint32_t )p_buffer ;
1076
+ #endif
1077
+ }
1078
+
1079
+ NRF_STATIC_INLINE void nrf_uarte_tx_buffer_set (NRF_UARTE_Type * p_reg ,
1080
+ uint8_t const * p_buffer ,
1081
+ size_t length )
1082
+ {
1083
+ nrf_uarte_tx_ptr_set (p_reg , p_buffer );
1084
+ nrf_uarte_tx_maxcnt_set (p_reg , length );
1085
+ }
1086
+
1036
1087
NRF_STATIC_INLINE uint8_t const * nrf_uarte_tx_buffer_get (NRF_UARTE_Type * p_reg )
1037
1088
{
1038
1089
#if NRF_UARTE_HAS_DMA_REG
@@ -1051,19 +1102,34 @@ NRF_STATIC_INLINE uint32_t nrf_uarte_tx_amount_get(NRF_UARTE_Type const * p_reg)
1051
1102
#endif
1052
1103
}
1053
1104
1054
- NRF_STATIC_INLINE void nrf_uarte_rx_buffer_set (NRF_UARTE_Type * p_reg ,
1055
- uint8_t * p_buffer ,
1105
+ NRF_STATIC_INLINE void nrf_uarte_rx_maxcnt_set (NRF_UARTE_Type * p_reg ,
1056
1106
size_t length )
1057
1107
{
1058
1108
#if NRF_UARTE_HAS_DMA_REG
1059
- p_reg -> DMA .RX .PTR = (uint32_t )p_buffer ;
1060
1109
p_reg -> DMA .RX .MAXCNT = length ;
1061
1110
#else
1062
- p_reg -> RXD .PTR = (uint32_t )p_buffer ;
1063
1111
p_reg -> RXD .MAXCNT = length ;
1064
1112
#endif
1065
1113
}
1066
1114
1115
+ NRF_STATIC_INLINE void nrf_uarte_rx_ptr_set (NRF_UARTE_Type * p_reg ,
1116
+ uint8_t * p_buffer )
1117
+ {
1118
+ #if NRF_UARTE_HAS_DMA_REG
1119
+ p_reg -> DMA .RX .PTR = (uint32_t )p_buffer ;
1120
+ #else
1121
+ p_reg -> RXD .PTR = (uint32_t )p_buffer ;
1122
+ #endif
1123
+ }
1124
+
1125
+ NRF_STATIC_INLINE void nrf_uarte_rx_buffer_set (NRF_UARTE_Type * p_reg ,
1126
+ uint8_t * p_buffer ,
1127
+ size_t length )
1128
+ {
1129
+ nrf_uarte_rx_ptr_set (p_reg , p_buffer );
1130
+ nrf_uarte_rx_maxcnt_set (p_reg , length );
1131
+ }
1132
+
1067
1133
NRF_STATIC_INLINE uint8_t * nrf_uarte_rx_buffer_get (NRF_UARTE_Type * p_reg )
1068
1134
{
1069
1135
#if NRF_UARTE_HAS_DMA_REG
0 commit comments