@@ -47,7 +47,7 @@ int lan8670_reset(lan8670_t *lan); // Performs a software reset of the LAN8670 E
4747 *
4848 * @param lan Pointer to the lan8670_t instance.
4949 * @param setting true to enable loopback mode, false to disable it.
50- * @return 0 on success, or a non-zero error code from the read/write operations .
50+ * @return 0 on success, or a non-zero error code.
5151 */
5252int lan8670_loopback (lan8670_t * lan , bool setting ); // Enables or disables loopback mode on the LAN8670.
5353
@@ -59,15 +59,15 @@ int lan8670_loopback(lan8670_t *lan, bool setting); // Enables or disables loopb
5959 *
6060 * @param lan Pointer to the lan8670_t instance.
6161 * @param setting true to enable low power mode, false to disable it.
62- * @return 0 on success, or a non-zero error code from the read/write operations .
62+ * @return 0 on success, or a non-zero error code.
6363 */
6464int lan8670_low_power_mode (lan8670_t * lan , bool setting ); // Enables or disables the LAN8670's low power mode.
6565
6666/**
6767 * @brief Electrically isolates the LAN8670 from MII/RMII.
6868 * @param lan Pointer to the lan8670_t instance.
6969 * @param setting true to isolate the device, false for normal operation.
70- * @return 0 on success, or a non-zero error code from the read/write operations .
70+ * @return 0 on success, or a non-zero error code.
7171 */
7272int lan8670_isolate (lan8670_t * lan , bool setting ); // Electrically isolates the LAN8670 from MII/RMII.
7373
@@ -80,28 +80,69 @@ int lan8670_isolate(lan8670_t *lan, bool setting); // Electrically isolates the
8080 *
8181 * @param lan Pointer to the lan8670_t instance.
8282 * @param setting true to enable collision test mode, false to disable it.
83- * @return 0 on success, or a non-zero error code from the read/write operations .
83+ * @return 0 on success, or a non-zero error code.
8484 */
8585int lan8670_collision_test (lan8670_t * lan , bool setting ); // Enables or disables the LAN8670's collision test mode.
8686
8787/**
8888 * @brief Detects jabber condition on the LAN8670.
8989 * @param lan Pointer to the lan8670_t instance.
9090 * @param jabber_status Pointer to a boolean variable to store the jabber status.
91- * @return 0 on success, or a non-zero error code from the read operation .
91+ * @return 0 on success, or a non-zero error code.
9292 */
9393int lan8670_detect_jabber (lan8670_t * lan , bool * jabber_status ); // Detects jabber condition on the LAN8670.
9494
95+ /**
96+ * @brief Enables or disables collision detection on the LAN8670.
97+ * @param lan Pointer to the lan8670_t instance.
98+ * @param setting true to enable collision detection, false to disable it.
99+ * @return 0 on success, or a non-zero error code.
100+ */
101+ int lan8670_collision_detection (lan8670_t * lan , bool setting );
102+
95103/**
96104 * @brief Enables or disables Physical Layer Collision Avoidence (PLCA).
97105 *
98- * Note: When PLCA is enabled on a properly configured mixing segment, no collisions should occur
99- * on the physical layer. It is therefore recommended to disable physical layer collision detection to
100- * achieve a higher level of noise tolerance.
106+ * Note: When PLCA is enabled, collision detection should be disabled.
107+ * This can be done using the lan8670_collision_detection() function.
108+ * (See page 141 of the datasheet for more information.)
101109 *
102110 * @param lan Pointer to the lan8670_t instance.
103111 * @param setting true to enable PLCA, false to disable it.
104- * @return 0 on success, or a non-zero error code from the read/write operations .
112+ * @return 0 on success, or a non-zero error code.
105113 */
106- int lan8670_plca (lan8670_t * lan , bool setting );
114+ int lan8670_plca_on (lan8670_t * lan , bool setting );
115+
116+ /**
117+ * @brief Resets the PLCA reconciliation sublayer.
118+ *
119+ * @param lan Pointer to the lan8670_t instance.
120+ * @return 0 on success, or a non-zero error code.
121+ */
122+ int lan8670_plca_reset (lan8670_t * lan );
123+
124+ /**
125+ * @brief Configures the maximum number of nodes supported on the multidrop network.
126+ *
127+ * Proper operation requires that this field be set to at least the
128+ * number of nodes that may exist on the network.
129+ *
130+ * @param lan Pointer to the lan8670_t instance.
131+ * @param node_count The number of nodes on the network.
132+ * @return 0 on success, or a non-zero error code.
133+ */
134+ int lan8670_plca_set_node_count (lan8670_t * lan , uint8_t node_count );
135+
136+ /**
137+ * @brief Sets the ID of the PLCA node.
138+ *
139+ * This ID must be unique for each node on the network.
140+ * The ID for the controller node must be 0.
141+ *
142+ * @param lan Pointer to the lan8670_t instance.
143+ * @param id The ID of the PLCA node (0-31).
144+ * @return 0 on success, or a non-zero error code.
145+ */
146+ int lan8670_plca_set_node_id (lan8670_t * lan , uint8_t id );
147+
107148// clang-format on
0 commit comments