fcp_dbc

fcp plugin to generate CAN bus dbc <https://www.csselectronics.com/pages/can-dbc-file-database-intro> schemas.

Usage

fcp generate dbc <fcp source> <output file>

Supported schema fields

Impl

  1. id: CAN bus frame identifier

  2. device: Sender name

SignalBlock

  1. mux_count: Number of variants for muxed signal

  2. mux_signal: Signal that muxes the current signal

  3. endianess: byte order of the encoded signal

  4. bitstart: Start bit for the current signal

  5. scale: Scaling multiplier for the encoded signal

  6. offset: Scaling offset for the encoded signal

  7. minimum: Allowed minimum value for the decoded signal

  8. maximum: Allowed maximum value for the decoded signal

Example

version: "3"

enum SensorState {
    Off = 0,
    On = 1,
    Error = 2,
}

struct SensorInformation {
    temperature @0: f32 | unit("C"),
    sensors_state @1: SensorState,
    sensor_id @2: u8,
}

impl can for SensorInformation {
    id: 100,
    device: "ecu1",

    signal temperature {
        mux_count: 16,
        mux_signal: "sensor_id",
    },

    signal sensor_state {
        mux_count: 16,
        mux_signal: "sensor_id",
    },
}

API