|
K-FSW v1.2.1-59-gcaca356
KFSW: modular flight software on Zephyr, for small satellites
|
Public Headers | |
| file | can.h |
Data Structures | |
| struct | kfsw_can_info |
| struct | kfsw_can_test_result |
Macros | |
| #define | KFSW_CAN_INTERFACE_NAME_SIZE 10U |
| #define | KFSW_CAN_BITRATE_125K 125000U |
| #define | KFSW_CAN_BITRATE_250K 250000U |
| #define | KFSW_CAN_BITRATE_500K 500000U |
| #define | KFSW_CAN_BITRATE_800K 800000U |
| #define | KFSW_CAN_BITRATE_1M 1000000U |
Functions | |
| int | kfsw_can_open (void) |
| void | kfsw_can_get_info (struct kfsw_can_info *info) |
| bool | kfsw_can_bitrate_supported (uint32_t bitrate) |
| int | kfsw_can_set_bitrate (uint32_t bitrate) |
| int | kfsw_can_test_peer (uint16_t peer, uint32_t timeout_ms, struct kfsw_can_test_result *result) |
CAN configuration, interface state, bitrate selection and peer tests.
| #define KFSW_CAN_BITRATE_125K 125000U |
| #define KFSW_CAN_INTERFACE_NAME_SIZE 10U |
#include <can.h>
Longest interface name libcsp's text parser accepts, plus a terminator.
| bool kfsw_can_bitrate_supported | ( | uint32_t | bitrate | ) |
#include <can.h>
Check whether a bitrate is supported.
Exposed so a parameter validator can reject a bitrate before the controller is opened.
| void kfsw_can_get_info | ( | struct kfsw_can_info * | info | ) |
#include <can.h>
Read the CAN configuration and interface state.
| int kfsw_can_open | ( | void | ) |
#include <can.h>
Open the chosen CAN controller and register it with libcsp.
Called by the CSP lifecycle after the router exists and before it starts. Returns 0 on success, a negative errno if the controller is missing or refuses the configured bitrate.
| int kfsw_can_set_bitrate | ( | uint32_t | bitrate | ) |
#include <can.h>
Apply a new bitrate, restarting the controller.
This function only reports whether the controller accepted the change.
Returns 0 on success, -EINVAL for an unsupported bitrate, -ENODEV when no controller is open.
| int kfsw_can_test_peer | ( | uint16_t | peer, |
| uint32_t | timeout_ms, | ||
| struct kfsw_can_test_result * | result | ||
| ) |
#include <can.h>
Ping a peer whose route leaves through the CAN interface.
Returns CSP_ERR_NOTSUP when the route to the peer is not CAN, or the peer is this node and the ping would never reach the bus.