Lines Matching full:can
8 #include <zephyr/drivers/can.h>
21 * @brief Standard (11-bit) CAN ID transmit callback 1.
31 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_std_callback_1()
36 * @brief Standard (11-bit) CAN ID transmit callback 2.
46 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_std_callback_2()
51 * @brief Extended (29-bit) CAN ID transmit callback 1.
61 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_ext_callback_1()
66 * @brief Extended (29-bit) CAN ID transmit callback 2.
76 zassert_equal(dev, can_dev, "CAN device does not match"); in tx_ext_callback_2()
81 * @brief Standard (11-bit) CAN ID receive callback 1.
91 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_callback_1()
98 * @brief Standard (11-bit) CAN ID receive callback 2.
108 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_callback_2()
115 * @brief Standard (11-bit) masked CAN ID receive callback 1.
125 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_mask_callback_1()
132 * @brief Standard (11-bit) masked CAN ID receive callback 2.
142 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_std_mask_callback_2()
149 * @brief Extended (29-bit) CAN ID receive callback 1.
159 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_ext_callback_1()
166 * @brief Extended (29-bit) CAN ID receive callback 2.
176 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_ext_callback_2()
183 * @brief Extended (29-bit) masked CAN ID receive callback 1.
193 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_ext_mask_callback_1()
200 * @brief Extended (29-bit) masked CAN ID receive callback 2.
210 zassert_equal(dev, can_dev, "CAN device does not match"); in rx_ext_mask_callback_2()
217 * @brief Send a CAN test frame with asserts.
223 * @param frame Pointer to the CAN frame to send.
235 * @brief Send a CAN test frame with asserts.
241 * @param frame Pointer to the CAN frame to send.
255 * @brief Add a CAN message queue with asserts.
258 * @param filter CAN filter for the CAN message queue.
260 * @return CAN filter ID.
274 * @brief Add a CAN filter with asserts.
277 * @param filter CAN filter.
280 * @return CAN filter ID.
298 * @brief Perform a send/receive test with a set of CAN ID filters and CAN frames.
300 * @param filter1 CAN filter 1
301 * @param filter2 CAN filter 2
302 * @param frame1 CAN frame 1
303 * @param frame2 CAN frame 2
388 * @brief Perform a send/receive test with a set of CAN ID filters and CAN frames, RTR and data
391 * @param data_filter CAN data filter
392 * @param rtr_filter CAN RTR filter
393 * @param data_frame CAN data frame
394 * @param rtr_frame CAN RTR frame
431 * @brief Test getting the CAN core clock rate.
439 zassert_equal(err, 0, "failed to get CAN core clock rate (err %d)", err); in ZTEST_USER()
440 zassert_not_equal(rate, 0, "CAN core clock rate is 0"); in ZTEST_USER()
444 * @brief Test getting the CAN controller capabilities.
452 zassert_equal(err, 0, "failed to get CAN capabilities (err %d)", err); in ZTEST_USER()
453 zassert_not_equal(cap & CAN_MODE_LOOPBACK, 0, "CAN loopback mode not supported"); in ZTEST_USER()
457 * @brief CAN state change callback.
469 * @brief Test setting the CAN state change callback.
502 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
511 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
523 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
529 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
552 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
561 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
565 * @brief Test that the minimum timing values can be set.
572 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
581 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
585 * @brief Test that the maximum timing values can be set.
592 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
601 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
607 * This basic test work since the CAN controller is in loopback mode and
657 * @brief Test adding an invalid CAN RX filter.
660 * @param frame Pointer to the CAN RX filter.
719 * @param ide standard (11-bit) CAN ID filters if false, or extended (29-bit) CAN ID filters if
763 * @brief Test max standard (11-bit) CAN RX filters.
771 * @brief Test max extended (29-bit) CAN RX filters.
811 * @brief Test sending an invalid CAN frame.
814 * @param frame Pointer to the CAN frame to send.
835 * @brief Test sending frame with standard (11-bit) CAN ID out-of-range.
847 * @brief Test sending frame with extended (29-bit) CAN ID out-of-range.
860 * @brief Test sending standard (11-bit ID) CAN frame with too big payload.
873 * @brief Test sending extended (29-bit ID) CAN frame with too big payload.
887 * @brief Test send/receive with standard (11-bit) CAN IDs.
896 * @brief Test send/receive with standard (11-bit) CAN IDs without no data.
923 * @brief Test send/receive with extended (29-bit) CAN IDs.
932 * @brief Test send/receive with standard (11-bit) masked CAN IDs.
941 * @brief Test send/receive with extended (29-bit) masked CAN IDs.
950 * @brief Test send/receive with messages buffered in a CAN message queue.
990 * @brief Test send/receive with standard (11-bit) CAN IDs and remote transmission request (RTR).
1000 * @brief Test send/receive with extended (29-bit) CAN IDs and remote transmission request (RTR).
1010 * @brief Test rejection of standard (11-bit) CAN IDs and remote transmission request (RTR).
1037 * @brief Test rejection of extended (29-bit) CAN IDs and remote transmission request (RTR).
1064 * @brief Test that non-matching CAN frames do not pass a filter.
1098 * @brief Test that CAN FD format frames are rejected in non-FD mode.
1110 zassert_equal(err, -ENOTSUP, "sent a CAN FD format frame in non-FD mode"); in ZTEST_USER()
1114 * @brief Test CAN controller bus recovery.
1126 zassert_equal(err, 0, "failed to get CAN capabilities (err %d)", err); in ZTEST_USER()
1134 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
1142 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
1151 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
1159 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
1167 * @brief Test retrieving the state of the CAN controller.
1176 zassert_equal(err, 0, "failed to get CAN state without destinations (err %d)", err); in ZTEST_USER()
1179 zassert_equal(err, 0, "failed to get CAN state (err %d)", err); in ZTEST_USER()
1182 zassert_equal(err, 0, "failed to get CAN error counters (err %d)", err); in ZTEST_USER()
1185 zassert_equal(err, 0, "failed to get CAN state + error counters (err %d)", err); in ZTEST_USER()
1189 * @brief Test that CAN RX filters are preserved through CAN controller mode changes.
1206 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
1209 zassert_equal(err, 0, "failed to get CAN state (err %d)", err); in ZTEST_USER()
1210 zassert_equal(state, CAN_STATE_STOPPED, "CAN controller not stopped"); in ZTEST_USER()
1221 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
1233 * @brief Test that CAN RX filters are preserved through CAN controller bitrate changes.
1250 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
1253 zassert_equal(err, 0, "failed to get CAN state (err %d)", err); in ZTEST_USER()
1254 zassert_equal(state, CAN_STATE_STOPPED, "CAN controller not stopped"); in ZTEST_USER()
1266 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
1278 * @brief Test that CAN RX filters can be added while CAN controller is stopped.
1287 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
1292 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
1311 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
1314 zassert_not_equal(err, 0, "stopped CAN controller while stopped"); in ZTEST_USER()
1318 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
1329 zassert_not_equal(err, 0, "started CAN controller while started"); in ZTEST_USER()
1344 zassert_equal(err, 0, "failed to get CAN capabilities (err %d)", err); in ZTEST_USER()
1351 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
1358 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
1369 zassert_equal(err, 0, "failed to stop CAN controller (err %d)", err); in ZTEST_USER()
1376 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()