configuration_json
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
configuration_json [ 03.12.2024 08:38] – lars | configuration_json [ 21.04.2025 12:14] (current) – lars | ||
---|---|---|---|
Line 3: | Line 3: | ||
====== File format specification of configuration definition ====== | ====== File format specification of configuration definition ====== | ||
- | this describes the possible elements of a configuration description in json format. | + | this describes the possible elements of a configuration description in JSON format. |
{{odt> | {{odt> | ||
- | The json format is defined here: https:// | + | The JSON format is defined here: https:// |
All elements not listed as essential are optional. Being optional means that they can be missing and the configuration is still valid. | All elements not listed as essential are optional. Being optional means that they can be missing and the configuration is still valid. | ||
Line 25: | Line 25: | ||
* general settings | * general settings | ||
* peripheral settings | * peripheral settings | ||
- | | + | |
- | * signal names | + | * signal names |
==== general settings ==== | ==== general settings ==== | ||
Line 61: | Line 61: | ||
Keys like *digital_output* and *SPI* represent group names and are taken from a predefined set of group names understood by MBSP. Keys nested within them are arbitrary user-defined names for a instance in that group. In those instances the keys are from the defined set specific for that group. | Keys like *digital_output* and *SPI* represent group names and are taken from a predefined set of group names understood by MBSP. Keys nested within them are arbitrary user-defined names for a instance in that group. In those instances the keys are from the defined set specific for that group. | ||
+ | |||
+ | ===== general settings ===== | ||
+ | |||
+ | these are settings on the top layer that effect the whole project. | ||
- | ===== vendor_name | + | ==== vendor_name ==== |
- | Name of the company that sells the micro controller. As listed on chipselect.org | + | Name of the company that sells the micro controller. As listed on https://chipselect.org |
**type**: string | **type**: string | ||
- | ===== chip_name | + | ==== chip_name ==== |
- | model number of the micro controller. | + | Model number of the micro controller. |
**type**: string | **type**: string | ||
Model number is truncated so that it only contains relevant differences for code generation: flash and ram sizes are relevant, temperature range or package are not. | Model number is truncated so that it only contains relevant differences for code generation: flash and ram sizes are relevant, temperature range or package are not. | ||
+ | |||
+ | |||
+ | ==== project_type ==== | ||
+ | |||
+ | what type of project to generate. | ||
+ | |||
+ | **type**: string | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | Possible values are: | ||
+ | * "hal only" : only creates the hardware driver files (in the hal/ folder) and hardware definitions (in the hal/hw/ folder) | ||
+ | * " | ||
+ | * " | ||
+ | |||
+ | |||
+ | ==== file_comment ==== | ||
+ | |||
+ | defines the comment at the top of each generated file. | ||
+ | |||
+ | **type**: string | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | Possible values are: | ||
+ | * " | ||
+ | * " | ||
+ | |||
+ | ==== run_from ==== | ||
+ | |||
+ | defines the location of the firmware code when run. | ||
+ | |||
+ | **type**: string | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | Possible values are: | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | |||
+ | ==== path_prefix ==== | ||
+ | |||
+ | if you use a "hal only" MBSP project located in a sub folder of your project then the name of the sub folder goes here. | ||
+ | |||
+ | **type**: string | ||
+ | |||
+ | **default**: | ||
===== clock group ===== | ===== clock group ===== | ||
- | configuration of the used clocks | + | configuration of the used clocks. |
+ | |||
+ | < | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== source ==== | ||
+ | |||
+ | defines the source of the clock signal. Supported clock sources are: | ||
+ | * " | ||
+ | * ... | ||
+ | |||
+ | **type**: enum | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | ==== frequency ==== | ||
+ | |||
+ | defines the frequency that this clock has. | ||
+ | |||
+ | **type**: string (Hz, kHz, MHz) | ||
+ | |||
+ | **default**: | ||
- | TBD | ||
Line 154: | Line 232: | ||
===== Timer group ===== | ===== Timer group ===== | ||
- | TBD | + | This group contains all timer and counter peripherals. |
+ | |||
+ | < | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== peripheral ==== | ||
+ | |||
+ | defines which peripheral to use. peripherals can be: | ||
+ | * systick (part of the ARM core) | ||
+ | * timer1 | ||
+ | * timer2 | ||
+ | * ... | ||
+ | |||
+ | **type**: String | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | ==== mode ==== | ||
+ | |||
+ | defines the operation mode the timer/ | ||
+ | * count overflows | ||
+ | |||
+ | |||
+ | **type**: enum | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | ==== frequency ==== | ||
+ | |||
+ | The frequency defines the time between timer overflows. 1kHz means that the time between overflow events is 1/(1 kHz) = 1 ms. | ||
+ | |||
+ | **type**: string (Hz, kHz, MHz) | ||
+ | |||
+ | **default**: | ||
Line 165: | Line 284: | ||
===== UART group ===== | ===== UART group ===== | ||
- | TBD | + | This group defines all used Universal Asynchronous Receiver Transmitter (UART) interfaces. |
- | + | Each UART is a sub group with the UART name as the group name. | |
- | ===== SPI group ===== | + | |
< | < | ||
- | "SPI": { | + | "UART": { |
- | "encoder_spi": { | + | "debug_uart": { |
- | "pads": { | + | "pad_tx": " |
- | "SCK": " | + | "pad_rx": " |
- | "MISO": " | + | "pad_cts": " |
- | "MOSI": " | + | "pad_rts": " |
- | "NSS": " | + | "bits_per_packet": "8", |
- | } | + | "parity": "None", |
- | "role": "master", | + | "stop_bits": "1", |
- | "communication_mode": "duplex", | + | "baud_rate": "115200", |
- | "frame_format": "motorola", | + | "hardware_flow_control": "no", |
- | "clock_polarity": "idle_low", | + | "receive_buffer_size": "100", |
- | "clock_phase": "sample_on_leading_edge", | + | |
- | "bit_order": "msb_first", | + | "peripheral" : "UART0", |
- | | + | "IRQ" : "20", |
- | "baud_rate": "10Mhz", | + | "IRQ_priority" : " |
- | "crc": "enabled", | + | |
- | "crc_polynomial": | + | |
} | } | ||
} | } | ||
</ | </ | ||
- | * // | + | === pad_tx === |
- | * //pads// specifies the desired pad for each signal of this SPI peripheral. Usually, | + | The UART will send data on this pin. (Idle = High). Either |
- | * //role: master//: role can be //master// or // | + | === pad_rx === |
- | * // | + | The UART will receive |
- | * | + | |
- | * // | + | |
- | **DICUSS(Lars): | + | === pad_cts === |
- | **REPLY(Johan)** Half duplex is different from unidirectional communication. | + | Clear to send signal for flow control. Will not be used if not defined. |
- | **DICUSS(Lars): | + | === pad_rts === |
- | **REPLY(Johan)** I agree: this is a bad idea. Unfortunately, | + | Request |
- | Maybe we just need a setting to specify which pad should be used for half-duplex communication. | ||
- | This whole // | + | ==== bits_per_packet ==== |
- | * // | + | defines the number of data bits. Possible values |
+ | * 7 | ||
+ | * 8 | ||
+ | * 9 | ||
- | | + | **type**: enum |
- | | + | **default**: 8 |
- | Sometimes the documentation talks about a SPI Mode with the value of 0 to 3. This mode maps to the phase and polarity as described in the following table: | + | ==== parity ==== |
- | ^ Mode ^ CPOL ^ CPHA ^ description^ | + | defines the parity bit. Possible values are: |
- | | 0 | 0 | 0 | clock: idle_low, phase: sample_on_leading_edge | | + | * None : no parity bit used. |
- | | 1 | 0 | 1 | clock: idle_low, phase: sample_on_trailing_edge | | + | * Odd : the parity bits value makes sure that the packet contains an **__odd__** number of bits with value "1". |
- | | 2 | 1 | 0 | clock: idle_high, phase: sample_on_leading_edge | | + | * Even : the parity bits value makes sure that the packet contains an **__even__** number of bits with value "1". |
- | | 3 | 1 | 1 | clock: idle_high, phase: sample_on_trailing_edge | | + | |
- | | + | **type**: enum |
- | | + | **default**: None |
- | **DICUSS(Lars): | ||
- | **REPLY(Johan): | + | ==== stop_bits ==== |
- | **DICUSS(Lars):** I added a report file to the list of generated files.(mbsp_report.txt) We probably then need a format for that also,... | + | defines the number of stop bits. Possible values are: |
+ | | ||
+ | | ||
+ | * 2 | ||
- | **REPLY(Johan): | + | **type**: enum |
- | | + | **default**: 8 |
- | **DICUSS(Lars): | ||
- | **REPLY(Johan): | + | ==== baud_rate ==== |
- | * // | + | defines |
- | **DICUSS(Lars): | + | **type**: int |
- | **REPLY(Johan)** You are right. Wikipedia https:// | + | **default**: 115200 |
- | **DICUSS(Lars): | ||
- | **REPLY(Johan)** Agreed: let's postpone this. It is not essential for a demo, so we can even postpone it until after the demo. | + | ==== hardware_flow_control ==== |
- | **REPLY(Johan)** How/where would you specify the parameters of the connected device? Many other SPI parameters specified here also depend | + | defines if the Request to Send (RTS) and Clear to send (CTS) signals should be used for flow control. Possible values are: |
+ | | ||
+ | * RTS only | ||
+ | * CTS only | ||
+ | | ||
- | **DICUSS(Lars): | + | **type**: enum |
- | **REPLY(Johan)** Does that mean that for supported devices, | + | **default**: off |
- | ===== QSPI group ===== | + | ==== receive_buffer_size |
- | TBD | + | defines the number of bytes in the receive buffer of the driver. |
- | ===== SDIO group ===== | + | **type**: int |
- | TBD | + | **default**: |
- | ===== I2C group ===== | + | ==== send_buffer_size |
- | TBD | + | defines the number of bytes in the send buffer of the driver. |
+ | **type**: int | ||
- | ===== I3C group ===== | + | **default**: |
- | TBD | + | ==== peripheral ==== |
+ | name of the UART peripheral to use. | ||
- | ===== I2S group ===== | + | **type**: String |
- | TBD | + | ==== IRQ ==== |
+ | The interrupt number of the peripheral. | ||
- | ===== CAN group ===== | + | **type**: int |
- | TBD | + | ==== IRQ_priority ==== |
+ | The interrupt priority of the interrupt. | ||
- | ===== USB group ===== | + | **type**: int |
- | TBD | ||
+ | ===== SPI group ===== | ||
- | ===== Watchdog | + | This group defines all used Serial Peripheral Interface (SPI) interfaces. |
- | TBD | + | Each SPI interface is a sub group with the SPI name as the group name. |
- | ===== Random_Number group ===== | + | < |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
- | TBD | ||
+ | === pad_sck === | ||
- | ===== CRC group ===== | + | Serial Clock. |
- | TBD | + | === pad_mosi === |
- | ===== ... group ===== | + | " |
- | TBD | + | === pad_miso === |
+ | " | ||
+ | === pad_ncs === | ||
+ | |||
+ | Chip Select signal (Low active). | ||
+ | |||
+ | === role === | ||
+ | |||
+ | Is either master(host) or slave(device). | ||
+ | |||
+ | **type**: enum | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | === communication_mode === | ||
+ | |||
+ | Describes the communication. Possible values are: | ||
+ | * duplex : the traditional mode using MISO and MOSI to transmit and receive at the same time. | ||
+ | * half-duplex : meaning the same wire between master and slave is used for both directions. | ||
+ | * receive-only : send line is not used | ||
+ | * send-only : receive Line is not used. | ||
+ | |||
+ | **type**: enum | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | === frame_format === | ||
+ | |||
+ | Describes the communication. Possible values are: | ||
+ | * motorola : the " | ||
+ | * ti : | ||
+ | |||
+ | **type**: enum | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | === clock_polarity === | ||
+ | Also often called CPOL. Describes the communication. Possible values are: | ||
+ | * idle_low | ||
+ | * idle_high | ||
+ | |||
+ | **type**: enum | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | === clock_phase === | ||
+ | Also often called CPHA. Describes the communication. Possible values are: | ||
+ | * sample_on_leading_edge : samples the data on the edge from idle value to non-idle value. | ||
+ | * sample_on_trailinging_edge : samples the data on the edge from non-idle value to idle value. | ||
+ | |||
+ | **type**: enum | ||
+ | |||
+ | **default**: | ||
+ | |||
+ | |||
+ | === SPI Mode === | ||
+ | Sometimes the documentation talks about a SPI Mode with the value of 0 to 3. This mode maps to the phase and polarity as described in the following table: | ||
+ | |||
+ | ^ Mode ^ CPOL ^ CPHA ^ description^ | ||
+ | | 0 | 0 | 0 | clock: idle_low, phase: sample_on_leading_edge | | ||
+ | | 1 | 0 | 1 | clock: idle_low, phase: sample_on_trailing_edge | | ||
+ | | 2 | 1 | 0 | clock: idle_high, phase: sample_on_leading_edge | | ||
+ | | 3 | 1 | 1 | clock: idle_high, phase: sample_on_trailing_edge | | ||
+ | |||
+ | |||
+ | |||
+ | === bit_order === | ||
+ | Describes the communication. Possible values are: | ||
+ | * msb_first : most significant bit first (bits on the line : 76543210 ) | ||
+ | * lsb_first : least significant bit first (bits on the line: 01234567 ) | ||
+ | |||
+ | **type**: enum | ||
+ | **default**: | ||
+ | === baud_rate === | ||
+ | Is the number of bits per second exchanged on the data lines. Expressed as frequency of the clock line. | ||
+ | **type**: int (Hz) | ||
configuration_json.1733215113.txt.gz · Last modified: by lars