configuration_json
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
configuration_json [ 17.12.2024 23:54] – 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 ===== | ||
- | This group defines all used UART interfaces. | + | 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. | Each UART is a sub group with the UART name as the group name. | ||
Line 172: | Line 291: | ||
" | " | ||
" | " | ||
- | "pads": { | + | "pad_tx": " |
- | "TX": " | + | "pad_rx": " |
- | "RX": " | + | "pad_cts": " |
- | "CTS": " | + | "pad_rts": " |
- | "RTS": " | + | " |
- | } | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
} | } | ||
} | } | ||
</ | </ | ||
+ | |||
+ | === pad_tx === | ||
+ | |||
+ | The UART will send data on this pin. (Idle = High). Either this or the pad_rx must be given. | ||
+ | |||
+ | === pad_rx === | ||
+ | |||
+ | The UART will receive (read) signals on this pin. Either this or pad_rx must be given. | ||
+ | |||
+ | === pad_cts === | ||
+ | |||
+ | Clear to send signal for flow control. Will not be used if not defined. | ||
+ | |||
+ | === pad_rts === | ||
+ | |||
+ | Request to Send signal for flow control. Will not be used if not defined. | ||
+ | |||
==== bits_per_packet ==== | ==== bits_per_packet ==== | ||
Line 236: | Line 373: | ||
defines if the Request to Send (RTS) and Clear to send (CTS) signals should be used for flow control. Possible values are: | defines if the Request to Send (RTS) and Clear to send (CTS) signals should be used for flow control. Possible values are: | ||
- | * no (RTS and CTS pins are not used. | + | * off (RTS and CTS pins are not used. |
* RTS only | * RTS only | ||
* CTS only | * CTS only | ||
- | * yes (RTS and CTS signals are used) | + | * on (RTS and CTS signals are used) |
**type**: enum | **type**: enum | ||
- | **default**: | + | **default**: |
- | " | ||
- | " | ||
- | | ||
==== receive_buffer_size ==== | ==== receive_buffer_size ==== | ||
Line 263: | Line 397: | ||
**default**: | **default**: | ||
+ | |||
+ | ==== peripheral ==== | ||
+ | |||
+ | name of the UART peripheral to use. | ||
+ | |||
+ | **type**: String | ||
+ | |||
+ | ==== IRQ ==== | ||
+ | |||
+ | The interrupt number of the peripheral. | ||
+ | |||
+ | **type**: int | ||
+ | |||
+ | ==== IRQ_priority ==== | ||
+ | |||
+ | The interrupt priority of the interrupt. | ||
+ | |||
+ | **type**: int | ||
===== SPI group ===== | ===== SPI group ===== | ||
+ | |||
+ | This group defines all used Serial Peripheral Interface (SPI) interfaces. | ||
+ | |||
+ | Each SPI interface is a sub group with the SPI name as the group name. | ||
< | < | ||
" | " | ||
" | " | ||
- | "pads": { | + | "pad_sck": " |
- | "SCK": " | + | "pad_miso": " |
- | "MISO": " | + | "pad_mosi": " |
- | "MOSI": " | + | "pad_ncs": " |
- | "NSS": " | + | |
- | } | + | |
" | " | ||
" | " | ||
Line 282: | Line 436: | ||
" | " | ||
" | " | ||
- | | + | " |
- | | + | |
- | " | + | |
- | " | + | |
} | } | ||
} | } | ||
</ | </ | ||
- | * // | ||
- | * //pads// specifies the desired pad for each signal of this SPI peripheral. Usually, this will uniquely define the peripheral to be used. Unused signals can be skipped. | + | === pad_sck === |
- | * //role: master//: role can be //master// or // | + | Serial Clock. |
- | * // | + | === pad_mosi === |
- | * | + | |
- | * // | + | |
- | **DICUSS(Lars): | + | " |
- | **REPLY(Johan)** Half duplex is different from unidirectional communication. | + | === pad_miso === |
- | **DICUSS(Lars): | + | "Master In Slave Out" |
- | **REPLY(Johan)** I agree: this is a bad idea. Unfortunately, | + | === pad_ncs === |
- | Maybe we just need a setting to specify which pad should be used for half-duplex communication. | + | Chip Select signal (Low active). |
- | This whole // | + | === role === |
- | * // | + | Is either master(host) |
- | | + | **type**: enum |
- | | + | **default**: master |
- | 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: | + | === communication_mode === |
- | ^ Mode ^ CPOL ^ CPHA ^ description^ | + | Describes the communication. Possible values are: |
- | | 0 | 0 | 0 | clock: idle_low, phase: sample_on_leading_edge | | + | * duplex |
- | | 1 | 0 | 1 | clock: idle_low, phase: sample_on_trailing_edge | | + | * half-duplex |
- | | 2 | 1 | 0 | clock: idle_high, phase: sample_on_leading_edge | | + | * receive-only |
- | | 3 | 1 | 1 | clock: idle_high, phase: sample_on_trailing_edge | | + | * send-only |
- | | + | **type**: enum |
- | | + | **default**: duplex |
- | **DICUSS(Lars): | + | === frame_format === |
- | **REPLY(Johan): | + | Describes |
+ | * motorola : the " | ||
+ | * ti : | ||
- | **DICUSS(Lars): | + | **type**: enum |
- | **REPLY(Johan): | + | **default**: motorola |
- | * //crc//: //enabled// or // | + | === clock_polarity === |
+ | Also often called CPOL. Describes the communication. Possible values are: | ||
+ | * idle_low | ||
+ | * idle_high | ||
- | **DICUSS(Lars): | + | **type**: enum |
- | **REPLY(Johan): | + | **default**: idle_low |
- | | + | === clock_phase === |
+ | Also often called CPHA. Describes the communication. Possible values are: | ||
+ | | ||
+ | * sample_on_trailinging_edge : samples | ||
- | **DICUSS(Lars): | + | **type**: enum |
- | **REPLY(Johan)** You are right. Wikipedia https:// | + | **default**: sample_on_leading_edge |
- | **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. | + | === 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: | ||
- | **REPLY(Johan)** How/where would you specify the parameters of the connected device? Many other SPI parameters specified here also depend on the connected device. For example | + | ^ Mode ^ CPOL ^ CPHA ^ description^ |
- | + | | 0 | 0 | 0 | clock: idle_low, | |
- | **DICUSS(Lars):** We could add explicit support for some devices. Then the user would just select the device and all the dependent settings (CPOL/CPHA,CRC, bits per transfer..) would be set accordingly. Does that make sense? | + | | 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 | | ||
- | **REPLY(Johan)** Does that mean that for supported devices, | ||
- | ===== QSPI group ===== | ||
- | |||
- | TBD | ||
- | |||
- | ===== SDIO group ===== | ||
- | |||
- | TBD | ||
- | |||
- | ===== I2C group ===== | ||
- | |||
- | TBD | ||
- | |||
- | |||
- | ===== I3C group ===== | ||
- | |||
- | TBD | ||
- | |||
- | |||
- | ===== I2S group ===== | ||
- | |||
- | TBD | ||
- | |||
- | |||
- | ===== CAN group ===== | ||
- | |||
- | TBD | ||
- | |||
- | |||
- | ===== USB group ===== | ||
- | |||
- | TBD | ||
- | |||
- | |||
- | ===== Watchdog group ===== | ||
- | |||
- | TBD | ||
- | |||
- | ===== Random_Number group ===== | ||
- | |||
- | TBD | ||
- | |||
- | |||
- | ===== CRC group ===== | ||
- | |||
- | TBD | ||
- | |||
- | ===== ... group ===== | ||
- | |||
- | TBD | ||
+ | === 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.1734479643.txt.gz · Last modified: by lars