On Mon, Jun 04, 2018 at 05:14:25PM -0500, Eric Blake wrote: > On 06/01/2018 10:16 PM, Steffen Görtz wrote: > > From: Steffen Goertz <cont...@steffen-goertz.de> > > > > Add a new category "stimulate" to host commands that > > act upon high-level devices associated with machines/boards. > > > > This is patch is part of an effort to add support for BBC:microbit > > educational computer to QEMU. > > > > The microbit board, as many other microcontroller boards, > > contains typical trivial (digital) input and output options such as buttons > > and LEDs, > > but also more sophiscated possibilities such as analog inputs and > > s/sophiscated/sophisticated/ > > > complex dedicated sensor ICs that are connected to the microbit machine > > by means of inter-ic bus (i2c). > > These devices interact with peripheral devices of the microcontroller > > in use, for example with the GPIO peripheral of the used NRF51. > > > > One aim of our efforts is to create a user interface that models the > > look and feel of the physical microbit board and lets the user interact > > with its inputs and provide feedback on its outsputs. > > s/outsputs/outputs/ > > > > > For this it is necessary to transmit user inputs such as the pressing of a > > button to the machine. > > In return, when the state of an output is changed on the machine, this > > change needs to be reflected in the user interface. > > > > At the moment, there are only a few QMP commands that provide user input to > > the > > machine, eg. send-keys, input-button. These commands require very > > high-level concepts, which are not really suitable for applications that > > microcontrollers are typically used in in. > > > > This RFC is meant to start a discussion on how to provide stimuli to > > low-complex inputs and outputs typically found in embedded > > microcontroller applications. To the best of my knowledge, there are > > currently no examples of how to provide such stimuli to either SoC > > device peripheral or machine level concepts like pushbuttons and LEDs. > > > > To my understanding, the following concepts/apis are needed: > > - QMP commands to send stimuli to machine level concepts like > > pushbuttons > > - Machine level devices that receive these stimuli and act as an adapter > > to manipulate the associated SoC peripheral devices > > - For outputs, machine level devices are needed that observe changes in > > SoC peripherals and emit QMP events that clients can receive > > > > This patch adds a new qmp command "buttons-set-state" to update the > > push-down state of arbitrarily identified buttons (string identifier). > > An arbitrary string has the most flexibility, but also the least > discoverability. Is there any way to enumerate which strings are valid, > and/or make the button names an enum instead of an open-coded string?
The button names could defined by an enum. Which button names are valid with a particular machine type can't be expressed in the schema AFAIK.
signature.asc
Description: PGP signature