### CanConfigurator API Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.CanConfigurator.html?search= Provides methods for creating, configuring, and starting the CAN bus. ```APIDOC ## POST /can/configurator/new ### Description Creates a new Fdcan instance, keeping the peripheral in sleep mode. You must call `Fdcan::enable_non_blocking` to use the peripheral. ### Method POST ### Endpoint /can/configurator/new ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **peri** (Peri<'d, T>) - Required - The peripheral instance. - **rx** (Peri<'d, impl RxPin>) - Required - The receive pin. - **tx** (Peri<'d, impl TxPin>) - Required - The transmit pin. - **irqs** (impl Binding> + Binding> + 'd) - Required - Interrupt handlers. ### Request Example ```json { "peri": "...", "rx": "...", "tx": "...", "irqs": "..." } ``` ### Response #### Success Response (200) - **CanConfigurator<'d>** (CanConfigurator) - The newly created CanConfigurator instance. #### Response Example ```json { "instance": "..." } ``` ## GET /can/configurator/properties ### Description Get driver properties. ### Method GET ### Endpoint /can/configurator/properties ### Parameters None ### Request Example None ### Response #### Success Response (200) - **Properties** (Properties) - The driver properties. #### Response Example ```json { "properties": "..." } ``` ## GET /can/configurator/config ### Description Get current CAN configuration. ### Method GET ### Endpoint /can/configurator/config ### Parameters None ### Request Example None ### Response #### Success Response (200) - **FdCanConfig** (FdCanConfig) - The current CAN configuration. #### Response Example ```json { "config": "..." } ``` ## PUT /can/configurator/config ### Description Set the CAN configuration. ### Method PUT ### Endpoint /can/configurator/config ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **config** (FdCanConfig) - Required - The new CAN configuration. ### Request Example ```json { "config": "..." } ``` ### Response #### Success Response (200) None #### Response Example None ## PUT /can/configurator/bitrate ### Description Configures the bit timings calculated from the supplied bitrate. ### Method PUT ### Endpoint /can/configurator/bitrate ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **bitrate** (u32) - Required - The desired bitrate in bits per second. ### Request Example ```json { "bitrate": 500000 } ``` ### Response #### Success Response (200) None #### Response Example None ## PUT /can/configurator/fd_data_bitrate ### Description Configures the bit timings for FDCAN data bitrate. This also sets the configuration to allow CAN FD and VBR. ### Method PUT ### Endpoint /can/configurator/fd_data_bitrate ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **bitrate** (u32) - Required - The desired data bitrate in bits per second. - **transceiver_delay_compensation** (bool) - Required - Whether to enable transceiver delay compensation. ### Request Example ```json { "bitrate": 2000000, "transceiver_delay_compensation": true } ``` ### Response #### Success Response (200) None #### Response Example None ## POST /can/configurator/start ### Description Starts the CAN peripheral in the specified operating mode. ### Method POST ### Endpoint /can/configurator/start ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **mode** (OperatingMode) - Required - The operating mode to start the CAN peripheral in. ### Request Example ```json { "mode": "Normal" } ``` ### Response #### Success Response (200) - **Can<'d>** (Can) - The started CAN peripheral instance. #### Response Example ```json { "instance": "..." } ``` ## POST /can/configurator/into_normal_mode ### Description Starts the CAN peripheral in normal operating mode. ### Method POST ### Endpoint /can/configurator/into_normal_mode ### Parameters None ### Request Example None ### Response #### Success Response (200) - **Can<'d>** (Can) - The CAN peripheral instance in normal mode. #### Response Example ```json { "instance": "..." } ``` ## POST /can/configurator/into_internal_loopback_mode ### Description Starts the CAN peripheral in internal loopback mode. ### Method POST ### Endpoint /can/configurator/into_internal_loopback_mode ### Parameters None ### Request Example None ### Response #### Success Response (200) - **Can<'d>** (Can) - The CAN peripheral instance in internal loopback mode. #### Response Example ```json { "instance": "..." } ``` ## POST /can/configurator/into_external_loopback_mode ### Description Starts the CAN peripheral in external loopback mode. ### Method POST ### Endpoint /can/configurator/into_external_loopback_mode ### Parameters None ### Request Example None ### Response #### Success Response (200) - **Can<'d>** (Can) - The CAN peripheral instance in external loopback mode. #### Response Example ```json { "instance": "..." } ``` ``` -------------------------------- ### Start FDCAN in External Loopback Mode (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.CanConfigurator.html Starts the FDCAN peripheral in external loopback mode. This is a convenience function equivalent to `start(OperatingMode::ExternalLoopback)`. ```rust pub fn into_external_loopback_mode(self) -> Can<'d> ``` -------------------------------- ### Start FDCAN in Internal Loopback Mode (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.CanConfigurator.html Starts the FDCAN peripheral in internal loopback mode. This is a convenience function equivalent to `start(OperatingMode::InternalLoopback)`. ```rust pub fn into_internal_loopback_mode(self) -> Can<'d> ``` -------------------------------- ### Start FDCAN in Normal Mode (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.CanConfigurator.html Starts the FDCAN peripheral in normal operating mode. This is a convenience function equivalent to `start(OperatingMode::Normal)`. ```rust pub fn into_normal_mode(self) -> Can<'d> ``` -------------------------------- ### FDCAN Module Configuration Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/index.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides configuration structures and utilities for the FDCAN module, allowing for detailed setup of CAN communication parameters. ```APIDOC ## Modules ### config Configuration for FDCAN Module ### enums Enums shared between CAN controller types. ### filter Definition of Filter structs for FDCAN Module ### frame Definition for CAN Frames ### util Utility functions shared between CAN controller types. ``` -------------------------------- ### BufferedCanFd Implementations Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.BufferedCanFd.html Provides methods for interacting with the Buffered CAN FD driver, including getting properties, writing, reading, and obtaining sender/receiver instances. ```APIDOC ## impl<'c, 'd, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> BufferedCanFd<'d, TX_BUF_SIZE, RX_BUF_SIZE> ### Description Implementations for the `BufferedCanFd` struct. ### Methods #### `properties(&self) -> &Properties` * **Description**: Get driver properties. * **Method**: GET (Conceptual) * **Endpoint**: N/A (Method call on struct instance) * **Parameters**: None * **Response**: `&Properties` - A reference to the driver's properties. #### `async fn write(&mut self, frame: FdFrame)` * **Description**: Asynchronously writes a CAN FD frame to the transmit buffer. * **Method**: POST (Conceptual) * **Endpoint**: N/A (Method call on struct instance) * **Parameters**: * `frame` (FdFrame) - Required - The CAN FD frame to write. * **Response**: None (Operation is asynchronous, success indicated by lack of error). #### `async fn read(&mut self) -> Result` * **Description**: Asynchronously reads a CAN FD frame from the receive buffer. * **Method**: GET (Conceptual) * **Endpoint**: N/A (Method call on struct instance) * **Parameters**: None * **Response**: `Result` - Either an `FdEnvelope` on success or a `BusError` on failure. #### `writer(&self) -> BufferedFdCanSender` * **Description**: Returns a sender instance for transmitting CAN frames. * **Method**: GET (Conceptual) * **Endpoint**: N/A (Method call on struct instance) * **Parameters**: None * **Response**: `BufferedFdCanSender` - A sender object. #### `reader(&self) -> BufferedFdCanReceiver` * **Description**: Returns a receiver instance for receiving CAN frames. Each frame is delivered to only one receiver. * **Method**: GET (Conceptual) * **Endpoint**: N/A (Method call on struct instance) * **Parameters**: None * **Response**: `BufferedFdCanReceiver` - A receiver object. ``` -------------------------------- ### Start FDCAN in Operating Mode (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.CanConfigurator.html Starts the FDCAN peripheral in a specified operating mode. This consumes the CanConfigurator and returns a Can<'d> instance. ```rust pub fn start(self, mode: OperatingMode) -> Can<'d> ``` -------------------------------- ### Implement Any Trait (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.CanConfigurator.html Implements the `Any` trait for any type `T`, providing a `type_id` method to get the `TypeId` of the instance. ```rust impl Any for T where T: 'static + ?Sized, { fn type_id(&self) -> TypeId } ``` -------------------------------- ### Implement BufferedCan Methods Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.BufferedCan.html?search=u32+-%3E+bool Provides implementations for the BufferedCan struct, including methods to get driver properties, asynchronously write and read CAN frames, and obtain sender/receiver instances. ```rust impl<'c, 'd, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE> /// Get driver properties pub fn properties(&self) -> &Properties /// Async write frame to TX buffer. pub async fn write(&mut self, frame: Frame) /// Async read frame from RX buffer. pub async fn read(&mut self) -> Result /// Returns a sender that can be used for sending CAN frames. pub fn writer(&self) -> BufferedCanSender /// Returns a receiver that can be used for receiving CAN frames. Note, each CAN frame will only be received by one receiver. pub fn reader(&self) -> BufferedCanReceiver ``` -------------------------------- ### Implement BufferedCan Methods Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.BufferedCan.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides implementations for the BufferedCan struct, including methods to get driver properties, asynchronously write and read CAN frames, and obtain sender and receiver instances. ```rust impl<'c, 'd, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE> { pub fn properties(&self) -> &Properties pub async fn write(&mut self, frame: Frame) pub async fn read(&mut self) -> Result pub fn writer(&self) -> BufferedCanSender pub fn reader(&self) -> BufferedCanReceiver } ``` -------------------------------- ### Type Conversion with TryFrom and TryInto Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/config/struct.FdCanConfig.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Demonstrates generic implementations of TryFrom and TryInto for type conversions. These traits allow for fallible conversions between different types, returning a Result. ```rust type Error = Infallible fn try_from(value: U) -> Result>::Error> type Error = >::Error fn try_into(self) -> Result>::Error> ``` -------------------------------- ### Generic Type Conversions (From, Into, TryFrom, TryInto) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/frame/struct.Header.html Demonstrates blanket implementations for generic type conversions, including `From`, `Into`, `TryFrom`, and `TryInto`. These allow for flexible conversion between different types, including infallible and fallible conversions. ```rust impl From for T Source #### fn from(t: T) -> T Returns the argument unchanged. ``` ```rust impl Into for T where U: From, Source #### fn into(self) -> U Calls `U::from(self)`. ``` ```rust impl TryFrom for T where U: Into, Source #### type Error = Infallible #### fn try_from(value: U) -> Result>::Error> Performs the conversion. ``` ```rust impl TryInto for T where U: TryFrom, Source #### type Error = >::Error #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### Type Conversion (From, Into, TryFrom, TryInto) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/config/struct.FdCanConfig.html?search= Illustrates various type conversion mechanisms. `From` and `Into` provide direct conversions, while `TryFrom` and `TryInto` offer fallible conversions with an associated error type. ```rust fn from(t: T) -> T; fn into(self) -> U; type Error = Infallible; fn try_from(value: U) -> Result>::Error>; type Error = >::Error; fn try_into(self) -> Result>::Error>; ``` -------------------------------- ### Implement Generic Type Conversions Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.Properties.html Demonstrates blanket implementations for generic type conversions like `From`, `Into`, `TryFrom`, and `TryInto`. These implementations allow for flexible data transformations between different types, often used for interoperability. ```rust impl From for T Source fn from(t: T) -> T Returns the argument unchanged. ``` ```rust impl Into for T where U: From, Source fn into(self) -> U Calls `U::from(self)`. ``` ```rust impl TryFrom for T where U: Into, Source type Error = Infallible The type returned in the event of a conversion error. fn try_from(value: U) -> Result>::Error> Performs the conversion. ``` ```rust impl TryInto for T where U: TryFrom, Source type Error = >::Error The type returned in the event of a conversion error. fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### Instance Trait Documentation Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/trait.Instance.html?search=std%3A%3Avec Details the Instance trait, its associated types, and compatibility information. ```APIDOC ## Trait: Instance ### Description Represents an instance of a peripheral with interrupt capabilities. ### Required Associated Types - **IT0Interrupt** (Interrupt): Represents the interrupt for event 0. - **IT1Interrupt** (Interrupt): Represents the interrupt for event 1. ### Dyn Compatibility This trait is **not** dyn compatible. ``` -------------------------------- ### Generic From and Into Conversions Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/config/struct.FdCanConfig.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Illustrates generic implementations of the From and Into traits for type conversions. These traits enable straightforward conversions between types where a direct mapping exists. ```rust fn from(t: T) -> T fn into(self) -> U ``` -------------------------------- ### Generic Implementations for Any Type in Rust Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/frame/struct.Envelope.html?search= Demonstrates blanket implementations for generic types `T`, including `Any`, `Borrow`, `BorrowMut`, `CloneToUninit`, `From`, `Into`, `TryFrom`, and `TryInto`, showcasing common Rust patterns for type manipulation and conversion. ```rust impl Any for T where T: 'static + ?Sized { fn type_id(&self) -> TypeId } impl Borrow for T where T: ?Sized { fn borrow(&self) -> &T } impl BorrowMut for T where T: ?Sized { fn borrow_mut(&mut self) -> &mut T } impl CloneToUninit for T where T: Clone { unsafe fn clone_to_uninit(&self, dest: *mut u8) } impl From for T { fn from(t: T) -> T } impl Into for T where U: From { fn into(self) -> U } impl TryFrom for T where U: Into { type Error = Infallible; fn try_from(value: U) -> Result>::Error> } impl TryInto for T where U: TryFrom { type Error = >::Error; fn try_into(self) -> Result>::Error> } ``` -------------------------------- ### Get Type ID - Rust Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.CanTx.html?search= Retrieves the `TypeId` of an object. This is a common operation used for runtime type identification. ```rust impl Any for T where T: 'static + ?Sized, fn type_id(&self) -> TypeId ``` -------------------------------- ### Experimental Unsafe CloneToUninit Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/config/struct.FdCanConfig.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Details the nightly-only experimental `clone_to_uninit` function. This unsafe function allows for copying data to an uninitialized memory location, requiring careful usage. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### Get FDCAN Configuration (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.CanConfigurator.html Retrieves the current configuration of the FDCAN driver. This method returns a copy of the FdCanConfig struct. ```rust pub fn config(&self) -> FdCanConfig ``` -------------------------------- ### TxPin Implementations Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/trait.TxPin.html Lists the available implementations of the TxPin trait for specific pins and peripheral instances. ```APIDOC ## Implementations of TxPin ### `impl TxPin for PA12` #### Description Implementation of `TxPin` for pin `PA12` when used with the `FDCAN1` peripheral instance. Available on non-`afio` configurations only. ### `impl TxPin for PB1` #### Description Implementation of `TxPin` for pin `PB1` when used with the `FDCAN1` peripheral instance. Available on non-`afio` configurations only. ### `impl TxPin for PB6` #### Description Implementation of `TxPin` for pin `PB6` when used with the `FDCAN1` peripheral instance. Available on non-`afio` configurations only. ### `impl TxPin for PB9` #### Description Implementation of `TxPin` for pin `PB9` when used with the `FDCAN1` peripheral instance. Available on non-`afio` configurations only. ### `impl TxPin for PC14` #### Description Implementation of `TxPin` for pin `PC14` when used with the `FDCAN1` peripheral instance. Available on non-`afio` configurations only. ``` -------------------------------- ### Type Information Retrieval Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/config/struct.FdCanConfig.html Provides a method to get the TypeId of an object. This is part of the Any trait implementation and is useful for runtime type identification. ```rust fn type_id(&self) -> TypeId; ``` -------------------------------- ### Instance Trait Implementation for FDCAN1 Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/trait.Instance.html?search=std%3A%3Avec Shows how the Instance trait is implemented for the FDCAN1 peripheral. ```APIDOC ## Implementation: Instance for FDCAN1 ### Description Provides the specific interrupt types for the FDCAN1 peripheral. ### Associated Types - **IT0Interrupt**: `FDCAN1_IT0` - **IT1Interrupt**: `FDCAN1_IT1` ``` -------------------------------- ### Get CAN FD Sender Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.BufferedCanFd.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns a sender instance for transmitting CAN frames. The sender can be used independently for sending messages, potentially in different parts of the application. ```rust pub fn writer(&self) -> BufferedFdCanSender ``` -------------------------------- ### Generic Implementations for FdFrame Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/frame/struct.FdFrame.html?search= Showcases various blanket implementations applied to `FdFrame`, including `Copy`, `Freeze`, `Send`, `Sync`, `Unpin`, `UnwindSafe`, `RefUnwindSafe`, `Any`, `Borrow`, `BorrowMut`, `CloneToUninit`, `From`, `Into`, `TryFrom`, and `TryInto`. These enable FdFrame to integrate seamlessly with Rust's type system and standard library features. ```rust impl Copy for FdFrame ``` ```rust impl Freeze for FdFrame ``` ```rust impl RefUnwindSafe for FdFrame ``` ```rust impl Send for FdFrame ``` ```rust impl Sync for FdFrame ``` ```rust impl Unpin for FdFrame ``` ```rust impl UnwindSafe for FdFrame ``` ```rust fn type_id(&self) -> TypeId ``` ```rust fn borrow(&self) -> &T ``` ```rust fn borrow_mut(&mut self) -> &mut T ``` ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` ```rust fn from(t: T) -> T ``` ```rust fn into(self) -> U ``` ```rust type Error = Infallible ``` ```rust fn try_from(value: U) -> Result>::Error> ``` ```rust type Error = >::Error ``` ```rust fn try_into(self) -> Result>::Error> ``` -------------------------------- ### Implement Any for Generic Type T Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/enums/enum.TryReadError.html?search=std%3A%3Avec This blanket implementation allows any type T that is 'static and not dynamically sized to be treated as Any. It provides a method to get the TypeId of the instance. ```rust impl Any for T where T: 'static + ?Sized { fn type_id(&self) -> TypeId { // Implementation to return the TypeId todo!() } } ``` -------------------------------- ### Frame Cloning and Formatting Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/frame/struct.Frame.html?search= Documentation for traits related to cloning and formatting the CAN Frame structure. ```APIDOC ## Frame Cloning and Formatting ### `Clone` Trait Implementation #### `clone(&self) -> Frame` Returns a duplicate of the `Frame` value. #### `clone_from(&mut self, source: &Self)` Performs copy-assignment from a source `Frame`. ### `Debug` Trait Implementation #### `fmt(&self, f: &mut Formatter<'_>) -> Result` Formats the `Frame` value using the given formatter. ### `Format` Trait Implementation #### `format(&self, f: Formatter<'_>)` Writes the defmt representation of the `Frame` to the formatter. ``` -------------------------------- ### Generic Implementations: CloneToUninit Trait (Nightly) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/config/enum.TxBufferMode.html?search=std%3A%3Avec Presents a nightly-only experimental API for `CloneToUninit`. This trait allows cloning a value into an uninitialized memory location, requiring `unsafe` operations. ```Rust impl CloneToUninit for T where T: Clone, { unsafe fn clone_to_uninit(&self, dest: *mut u8); } ``` -------------------------------- ### Get BufferedCan Sender in Rust Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.BufferedCan.html Returns a sender handle for the BufferedCan instance, which can be used to send CAN frames. This sender is typically used in multi-threaded or asynchronous contexts. ```rust pub fn writer(&self) -> BufferedCanSender ``` -------------------------------- ### Access CAN Header ID Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/frame/struct.Header.html?search= Provides methods to get an immutable or mutable reference to the CAN Header's ID. The ID is crucial for identifying the message on the CAN bus. ```rust pub fn id(&self) -> &Id ``` ```rust pub fn id_mut(&mut self) -> &mut Id ``` -------------------------------- ### FdFrame Cloning and Formatting Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/frame/struct.FdFrame.html Provides methods for cloning FdFrame instances and formatting them for debugging or logging. ```APIDOC ## POST /fdframe/{frame_id}/clone ### Description Creates a duplicate of an existing FdFrame. ### Method POST ### Endpoint /fdframe/{frame_id}/clone ### Parameters #### Path Parameters - **frame_id** (string) - Required - The unique identifier of the FdFrame to clone. ### Response #### Success Response (200) - **FdFrame** (FdFrame) - A new FdFrame instance that is a copy of the original. #### Response Example ```json { "cloned_frame": { ... } } ``` ## POST /fdframe/{frame_id}/clone_from ### Description Performs copy-assignment from a source FdFrame to the target FdFrame. ### Method POST ### Endpoint /fdframe/{frame_id}/clone_from ### Parameters #### Path Parameters - **frame_id** (string) - Required - The unique identifier of the target FdFrame. ### Request Body ```json { "source_frame": { ... } } ``` ### Response #### Success Response (200) - **Success** (boolean) - Indicates if the clone operation was successful. #### Response Example ```json { "success": true } ``` ## GET /fdframe/{frame_id}/debug_format ### Description Formats the FdFrame for debugging purposes using the Debug trait. ### Method GET ### Endpoint /fdframe/{frame_id}/debug_format ### Parameters #### Path Parameters - **frame_id** (string) - Required - The unique identifier of the FdFrame. ### Response #### Success Response (200) - **formatted_string** (string) - A string representation of the FdFrame for debugging. #### Response Example ```json { "formatted_string": "FdFrame {{ ... }}" } ``` ## GET /fdframe/{frame_id}/format ### Description Formats the FdFrame using the defmt representation. ### Method GET ### Endpoint /fdframe/{frame_id}/format ### Parameters #### Path Parameters - **frame_id** (string) - Required - The unique identifier of the FdFrame. ### Response #### Success Response (200) - **formatted_string** (string) - A defmt formatted string representation of the FdFrame. #### Response Example ```json { "formatted_string": "{{ ... }}" } ``` ``` -------------------------------- ### Get CAN Bus Error Mode (Rust) Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.Properties.html?search= Returns the current operating mode of the CAN bus error handling. The function returns a value of type BusErrorMode. ```rust pub fn bus_error_mode(&self) -> BusErrorMode ``` -------------------------------- ### Supported STM32 Microcontrollers Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/trait.RxPin.html?search=u32+-%3E+bool A comprehensive list of supported STM32 microcontroller models within the embassy-stm32 ecosystem. ```APIDOC ## Supported STM32 Microcontrollers ### Description This section lists the various STM32 microcontroller families and specific models supported by the embassy-stm32 library. ### Microcontroller List **STM32L4 Series:** - stm32l486zg - stm32l496ae - stm32l496ag - stm32l496qe - stm32l496qg - stm32l496re - stm32l496rg - stm32l496ve - stm32l496vg - stm32l496wg - stm32l496ze - stm32l496zg - stm32l4a6ag - stm32l4a6qg - stm32l4a6rg - stm32l4a6vg - stm32l4a6zg - stm32l4p5ae - stm32l4p5ag - stm32l4p5ce - stm32l4p5cg - stm32l4p5qe - stm32l4p5qg - stm32l4p5re - stm32l4p5rg - stm32l4p5ve - stm32l4p5vg - stm32l4p5ze - stm32l4p5zg - stm32l4q5ag - stm32l4q5cg - stm32l4q5qg - stm32l4q5rg - stm32l4q5vg - stm32l4q5zg - stm32l4r5ag - stm32l4r5ai - stm32l4r5qg - stm32l4r5qi - stm32l4r5vg - stm32l4r5vi - stm32l4r5zg - stm32l4r5zi - stm32l4r7ai - stm32l4r7vi - stm32l4r7zi - stm32l4r9ag - stm32l4r9ai - stm32l4r9vg - stm32l4r9vi - stm32l4r9zg - stm32l4r9zi - stm32l4s5ai - stm32l4s5qi - stm32l4s5vi - stm32l4s5zi - stm32l4s7ai - stm32l4s7vi - stm32l4s7zi - stm32l4s9ai - stm32l4s9vi - stm32l4s9zi **STM32L5 Series:** - stm32l552cc - stm32l552ce - stm32l552me - stm32l552qc - stm32l552qe - stm32l552rc - stm32l552re - stm32l552vc - stm32l552ve - stm32l552zc - stm32l552ze - stm32l562ce - stm32l562me - stm32l562qe - stm32l562re - stm32l562ve - stm32l562ze **STM32N6 Series:** - stm32n645a0 - stm32n645b0 - stm32n645i0 - stm32n645l0 - stm32n645x0 - stm32n645z0 - stm32n647a0 - stm32n647b0 - stm32n647i0 - stm32n647l0 - stm32n647x0 - stm32n647z0 - stm32n655a0 - stm32n655b0 - stm32n655i0 - stm32n655l0 - stm32n655x0 - stm32n655z0 - stm32n657a0 - stm32n657b0 - stm32n657i0 - stm32n657l0 - stm32n657x0 - stm32n657z0 **STM32U0 Series:** - stm32u031c6 - stm32u031c8 - stm32u031f4 - stm32u031f6 - stm32u031f8 - stm32u031g6 - stm32u031g8 - stm32u031k4 - stm32u031k6 - stm32u031k8 - stm32u031r6 - stm32u031r8 - stm32u073c8 - stm32u073cb - stm32u073cc - stm32u073h8 - stm32u073hb - stm32u073hc - stm32u073k8 - stm32u073kb - stm32u073kc - stm32u073m8 - stm32u073mb - stm32u073mc - stm32u073r8 - stm32u073rb - stm32u073rc - stm32u083cc - stm32u083hc - stm32u083kc - stm32u083mc - stm32u083rc **STM32U3 Series:** - stm32u375ce - stm32u375cg - stm32u375ke - stm32u375kg - stm32u375re - stm32u375rg - stm32u375ve - stm32u375vg - stm32u385cg - stm32u385kg - stm32u385rg - stm32u385vg **STM32U5 Series:** - stm32u535cb - stm32u535cc - stm32u535ce - stm32u535je - stm32u535nc - stm32u535ne - stm32u535rb - stm32u535rc - stm32u535re - stm32u535vc - stm32u535ve - stm32u545ce - stm32u545je - stm32u545ne - stm32u545re - stm32u545ve - stm32u575ag - stm32u575ai - stm32u575cg - stm32u575ci - stm32u575og - stm32u575oi - stm32u575qg - stm32u575qi - stm32u575rg - stm32u575ri - stm32u575vg - stm32u575vi - stm32u575zg - stm32u575zi - stm32u585ai - stm32u585ci - stm32u585oi - stm32u585qi - stm32u585ri - stm32u585vi - stm32u585zi - stm32u595ai - stm32u595aj - stm32u595qi - stm32u595qj - stm32u595ri - stm32u595rj - stm32u595vi - stm32u595vj - stm32u595zi - stm32u595zj - stm32u599bj - stm32u599ni - stm32u599nj - stm32u599vi - stm32u599vj - stm32u599zi - stm32u599zj - stm32u5a5aj - stm32u5a5qi - stm32u5a5qj - stm32u5a5rj - stm32u5a5vj - stm32u5a5zj - stm32u5a9bj - stm32u5a9nj - stm32u5a9vj - stm32u5a9zj - stm32u5f7vi - stm32u5f7vj - stm32u5f9bj - stm32u5f9nj - stm32u5f9vi - stm32u5f9vj - stm32u5f9zi - stm32u5f9zj - stm32u5g7vj - stm32u5g9bj - stm32u5g9nj - stm32u5g9vj - stm32u5g9zj **STM32WB Series:** - stm32wb10cc - stm32wb15cc - stm32wb30ce - stm32wb35cc - stm32wb35ce - stm32wb50cg - stm32wb55cc - stm32wb55ce - stm32wb55cg - stm32wb55rc - stm32wb55re - stm32wb55rg - stm32wb55vc - stm32wb55ve - stm32wb55vg - stm32wb55vy - stm32wba50ke - stm32wba50kg - stm32wba52ce - stm32wba52cg - stm32wba52ke - stm32wba52kg - stm32wba54ce - stm32wba54cg - stm32wba54ke - stm32wba54kg - stm32wba55ce - stm32wba55cg - stm32wba55he - stm32wba55hg - stm32wba55ue - stm32wba55ug - stm32wba62cg - stm32wba62ci - stm32wba62mg - stm32wba62mi - stm32wba62pg - stm32wba62pi - stm32wba63cg - stm32wba63ci - stm32wba64cg - stm32wba64ci - stm32wba65cg - stm32wba65ci - stm32wba65mg - stm32wba65mi - stm32wba65pg - stm32wba65pi - stm32wba65rg - stm32wba65ri **STM32WL Series:** - stm32wl54cc-cm0p - stm32wl54cc-cm4 - stm32wl54jc-cm0p - stm32wl54jc-cm4 - stm32wl55cc-cm0p - stm32wl55cc-cm4 - stm32wl55jc-cm0p - stm32wl55jc-cm4 **STM32WLE Series:** - stm32wle4c8 - stm32wle4cb - stm32wle4cc - stm32wle4j8 - stm32wle4jb - stm32wle4jc - stm32wle5c8 - stm32wle5cb - stm32wle5cc - stm32wle5j8 - stm32wle5jb - stm32wle5jc ``` -------------------------------- ### Implement Default for NominalBitTiming in Rust Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/config/struct.NominalBitTiming.html Provides a default implementation for the NominalBitTiming struct. This allows creating a NominalBitTiming instance with default values, often used for initialization. ```rust impl Default for NominalBitTiming { fn default() -> Self { // ... implementation details ... } } ``` -------------------------------- ### Get CAN FD Receiver Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.BufferedCanFd.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns a receiver instance for reading CAN frames. Each CAN frame is guaranteed to be received by only one receiver, ensuring data integrity and preventing duplicate processing. ```rust pub fn reader(&self) -> BufferedFdCanReceiver ``` -------------------------------- ### Implement Blanket Implementations for Frame Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/frame/struct.Frame.html?search= Details various blanket implementations for the Frame struct, including Any, Borrow, BorrowMut, CloneToUninit, From, Into, TryFrom, and TryInto. These implementations provide generic functionality and conversions. ```rust fn type_id(&self) -> TypeId ``` ```rust fn borrow(&self) -> &T ``` ```rust fn borrow_mut(&mut self) -> &mut T ``` ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` ```rust fn from(t: T) -> T ``` ```rust fn into(self) -> U ``` ```rust type Error = Infallible ``` ```rust fn try_from(value: U) -> Result>::Error> ``` ```rust type Error = >::Error ``` -------------------------------- ### Get CAN FD Driver Properties Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.BufferedCanFd.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the properties of the CAN FD driver instance. This method returns a reference to the properties, which may include configuration details and status information. ```rust pub fn properties(&self) -> &Properties ``` -------------------------------- ### Get CAN Error Counters Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.Properties.html Retrieves the CAN error counters. These functions return the number of receive (RX) and transmit (TX) errors encountered on the CAN bus as a u8 value. ```rust pub fn rx_error_count(&self) -> u8 Get the CAN RX error counter ``` ```rust pub fn tx_error_count(&self) -> u8 Get the CAN TX error counter ``` -------------------------------- ### FdFrame Creation Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/frame/struct.FdFrame.html Provides methods for creating new FdFrame instances with various configurations. ```APIDOC ## POST /fdframe/new ### Description Creates a new CAN classic Frame with a specified header and raw data. ### Method POST ### Endpoint /fdframe/new ### Parameters #### Query Parameters - **can_header** (Header) - Required - The CAN header for the frame. - **raw_data** (slice of u8) - Required - The raw data payload for the frame. ### Request Body ```json { "can_header": { ... }, "raw_data": [ ... ] } ``` ### Response #### Success Response (200) - **FdFrame** (FdFrame) - The newly created FdFrame object. #### Response Example ```json { "fd_frame": { ... } } ``` ## POST /fdframe/new_extended ### Description Creates a new extended CAN FD frame with a given ID and raw data. ### Method POST ### Endpoint /fdframe/new_extended ### Parameters #### Query Parameters - **raw_id** (u32) - Required - The extended identifier for the frame. - **raw_data** (slice of u8) - Required - The raw data payload for the frame. ### Request Body ```json { "raw_id": 12345, "raw_data": [ ... ] } ``` ### Response #### Success Response (200) - **FdFrame** (FdFrame) - The newly created extended FdFrame object. #### Response Example ```json { "fd_frame": { ... } } ``` ## POST /fdframe/new_standard ### Description Creates a new standard CAN FD frame with a specified ID and raw data. ### Method POST ### Endpoint /fdframe/new_standard ### Parameters #### Query Parameters - **raw_id** (u16) - Required - The standard identifier for the frame. - **raw_data** (slice of u8) - Required - The raw data payload for the frame. ### Request Body ```json { "raw_id": 123, "raw_data": [ ... ] } ``` ### Response #### Success Response (200) - **FdFrame** (FdFrame) - The newly created standard FdFrame object. #### Response Example ```json { "fd_frame": { ... } } ``` ## POST /fdframe/new_remote ### Description Creates a new remote frame with a given ID and data length. ### Method POST ### Endpoint /fdframe/new_remote ### Parameters #### Query Parameters - **id** (impl Into) - Required - The identifier for the remote frame. - **len** (usize) - Required - The expected data length for the remote frame. ### Request Body ```json { "id": { ... }, "len": 8 } ``` ### Response #### Success Response (200) - **FdFrame** (FdFrame) - The newly created remote FdFrame object. #### Response Example ```json { "fd_frame": { ... } } ``` ``` -------------------------------- ### Implement Generic Traits for ClassicData Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/frame/struct.ClassicData.html?search= Shows blanket implementations of common traits like Any, Borrow, CloneToUninit, From, Into, and TryFrom/TryInto for ClassicData. ```rust impl Any for T impl Borrow for T impl BorrowMut for T unsafe fn clone_to_uninit(&self, dest: *mut u8) impl From for T impl Into for T impl TryFrom for T impl TryInto for T ``` -------------------------------- ### TryInto for T Trait Implementation Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.FdcanInstance.html?search=u32+-%3E+bool Details the blanket implementation of the `TryInto` trait for any type `T`, provided that `U` implements `TryFrom`. ```APIDOC ## Blanket Implementation: TryInto for T ### Description Provides the `TryInto` trait for any type `T`, where `U` implements `TryFrom`. This implementation attempts the conversion. ### Method `try_into(self) -> Result>::Error>` ### Endpoint N/A (Trait Implementation) ### Parameters None ### Request Body None ### Response #### Success Response (N/A) - **Result** - A `Result` containing the converted value `U` or an error. - **Error** (type) - The type returned in the event of a conversion error, as defined by `U`'s `TryFrom` implementation. ### Response Example N/A ``` -------------------------------- ### Get BufferedCan Receiver in Rust Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/struct.BufferedCan.html Returns a receiver handle for the BufferedCan instance, used for receiving CAN frames. Each CAN frame is guaranteed to be received by only one receiver, ensuring exclusive access. ```rust pub fn reader(&self) -> BufferedCanReceiver ``` -------------------------------- ### Generic Borrowing with Borrow and BorrowMut Source: https://docs.embassy.dev/embassy-stm32/git/stm32c092kb/can/config/struct.FdCanConfig.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Showcases generic implementations of Borrow and BorrowMut traits. These traits allow for immutable and mutable borrowing of owned values, respectively. ```rust fn borrow(&self) -> &T fn borrow_mut(&mut self) -> &mut T ```