Skip to contentSkip to conversation

staging: pi433: add docs to packet_format and tx_start_condition enum

PATCH New Paulo Miguel Almeida 1 participant 1 message Dec 31, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 staging: pi433: add docs to packet_format and tx_start_condition enum

While pi433 driver deals with the nuances of the different possible config combinations, it's hard (at first) to understand the rationale for some of the tx/rx-related source code unless you're fairly familiar with the rf69's inner workings.

This patch documents the expected behaviour and limits of both packet_format and tx_start_condition enum fields.

---
v3: fix formatting issue (Req Greg k-h bot)
v2: remove comments pointed out during v1 review (Req Greg k-h)
v1: https://lore.kernel.org/lkml/[email protected]/

---
 drivers/staging/pi433/rf69_enum.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/staging/pi433/rf69_enum.h +12 -0
index fbf56fcf5fe8..b33a33a85d3b 100644
@@ -110,12 +110,24 @@ enum fifo_fill_condition {
 };
 
 enum packet_format {
+	/*
+	 * Used when the size of payload is fixed in advance. This mode of
+	 * operation may be of interest to minimize RF overhead by 1 byte as
+	 * no length byte field is required
+	 */
 	packet_length_fix,
+	/*
+	 * Used when the size of payload isn't known in advance. It requires the
+	 * transmitter to send the length byte in each packet so the receiver
+	 * would know how to operate properly
+	 */
 	packet_length_var
 };
 
 enum tx_start_condition {
+	/* the number of bytes in the FIFO exceeds FIFO_THRESHOLD */
 	fifo_level,
+	/* at least one byte in the FIFO */
 	fifo_not_empty
 };
 
Signature · 1 line
2.25.4