periph | Go·Hardware·Lean

 by   google Go Version: v3.7.0 License: Apache-2.0

kandi X-RAY | periph Summary

kandi X-RAY | periph Summary

periph is a Go library typically used in Internet of Things (IoT), Raspberry Pi applications. periph has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Documentation is at
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              periph has a medium active ecosystem.
              It has 1765 star(s) with 182 fork(s). There are 63 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 42 open issues and 106 have been closed. On average issues are closed in 378 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of periph is v3.7.0

            kandi-Quality Quality

              periph has no bugs reported.

            kandi-Security Security

              periph has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              periph is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              periph releases are available to install and integrate.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of periph
            Get all kandi verified functions for this library.

            periph Key Features

            No Key Features are available at this moment for periph.

            periph Examples and Code Snippets

            No Code Snippets are available at this moment for periph.

            Community Discussions

            QUESTION

            STM32F407ZET6, Is it possible for Multiple streams of a DMA to run in Parallel?
            Asked 2021-Jun-01 at 11:41

            Hi I am using STM32F407ZET6 Microcontroller and I want to use multiple streams of DMA1. Is it possible to trigger two different streams of the same DMA for transferring data to two different peripherals simulatenously. (Like in Parallel).

            In the advanced AHB bus matrix I observe that for each DMA there are only two lines, one for memory and one for peripheral, which suggest to me that at any time at max two streams can perhaps run in parallel and that also if none of the streams are really doing memory<->peripheral transfer. Is this assumption correct? And, is this also correct that to run two streams in parallel through a single DMA they should not be doing memory<->peripheral transfer? what I mean is that by the look of AHB matrix it felt if only Mem to Mem and Periph to Periph transfers are done then probably two streams can run in parallel, but if any one of them does memory<->peripheral transfer then the use of DMA memory and peripheral interface for a single transfer will probably make that NOT possible. Can you shed some light on this?

            I would like to request some guidance on this particular topic as i could not find satisfactory information on it... And if it is dependent on the bus bandwidth to transfer streams in parallel then how the bandwidth is divided among multiple channels for a single bus to perform multiple transfer.... Some If there is any such example, i would be thankful. As a reference I have put the AHB matrix below:

            ...

            ANSWER

            Answered 2021-Jun-01 at 11:41

            You can only select one channel per stream, but you can enable all 8 streams per DMA peripheral at once if you like, subject to the hardware defect listed in the errata sheet*.

            Each of the masters take turns to access the buses. Once a master takes the bus it decides how long to use it for. For the DMA master, this is configured with the MBURST and PBURST bits of the DMA_SxCR register. If you require very low latency in the system and do not want the processor or another master (ethernet etc) to be stalled and have to wait for the DMA to get off the bus then set the burst configuration short (but even the longest burst you can configure will still only be a microsecond or so).

            (*) there is a hardware defect in DMA2 which disallows concurrent use of AHB and APB peripherals, see the errata for details.

            Source https://stackoverflow.com/questions/67785480

            QUESTION

            Arduino very randomly freezes on printing float to string via String and sprintf
            Asked 2021-Apr-16 at 13:12

            TLDR: I am getting consistent freezes when printing floats to a String via arduinos String class. Previously I was getting the same freeze with sprintf and %f. I've solved the problem using the PString class, but I would like to understand the issue.

            FULL STORY: I have a rather large c++ codebase for arduino SAMD architecture (a MKRZero), that started freezing recently on a line of code I hadn't touched in a long time. This was a call to sprintf with %f, which was oddly working as expected previously. After some research on SO and google, I realized that float formatting via sprintf isn't supported on Arduino, and after ruling out dtostr (due to not being on AVR), I tried with Arduinos String class. This temporarily solved the problem, but the freeze resurfaced after testing the system with some different external periphicals (I2C slaves that can be connected and disconnected). So the exact same code, but some differences in the parts of it being exersized due to the different periphical.

            The codebase is quite large (several 1000s lines), and I haven't been able to reproduce with a simple example. So unfortunately without much context, these are the lines that fail:

            ...

            ANSWER

            Answered 2021-Apr-16 at 13:12

            After a lot of debugging, it seems that the issue indeed does have to do with ability of Arduino to print floats to string, and not with pointers or non-terminated string issues in my code.

            It seems to be stalling in the dtostrf() call of the String constructor:

            Source https://stackoverflow.com/questions/67075163

            QUESTION

            STM32F405 bare metal spi slave - MISO data messed up sometimes
            Asked 2021-Mar-26 at 09:46

            I've set up two STM32 Boards, one as SPI-master, the other one as slave. I write directly to registers without any framework. Master to slave communication is working perfectly. But the slave sends garbage sometimes.

            I first tried interrupts, but the slave would always send garbage and often receive garbage. Now I implemented DMA. This is working way better, the slave now always receives correct data. But sending is still an issue.

            If the transmission is 3 to 5 Bytes long the data from the slave is correct in 95% of all cases. If the transmission is longer then 5 bytes, then after the 4th or 5th byte there is just random byte foo. But the first 4 bytes are nearly (95%) always correct.

            The signals are clean, I checked them with an oscilloscope. The data which the master receives shows up properly on MISO. So I guess the slave somehow writes garbage into the SPI DR, or the data register gets messed up. I know SPI slaves on non-FPGAs are tricky, but this really is unexpected...

            Anyone can point me a direction? I'm desperate and thankful for any bit of advice.

            This is the code

            ...

            ANSWER

            Answered 2021-Mar-26 at 09:46

            So, I did it. It was a whole bunch of things. Also, my assumption in the question was wrong. My slave did not receive/send valid data.

            1. The signals were shown as clean by the oscilloscope, but the scope itself was adding noise to the lines, that was not visible on the scope itself. Not measuring the lines helped.

            2. I put 100 OHM resistors close to the MASTER pins. This was not working, out of desperation I put the resistors close to the slave instead. Suddenly I got valid data. (This has been the main culprit all along)

            3. According to the comment of Ashley Miller, I implemented a circular buffer, where I always send a fixed length every time. So the slave knows exactly what to expect. This mitigated eventual errors that could be produced when switching off / resetting the DMA shortly after the transmission.

            4. The UART tricked me also. When getting too much data at once ( as little as 20 or 30 bytes! ) my terminal program gliched and threw the bytes randomly around. So part of the problem was just that... I'm using GtkTerm for those who are interested.

            5. The Clock mode CPOL= 0 and CPH = 0 doesn't work at all. I set both master and slave to the same setting and it just received garbage. If I loop back the master to itself (connect MISO to MOSI a.k.a. exclude the slave) then it works regardless of clock mode. This seems to stem from a timing issue, where the slave has to react too fast and can't handle even the slowest possible speed (approx. 100 kHz). I did not go into details on this.

            I hope I could help someone with this.

            Source https://stackoverflow.com/questions/66679047

            QUESTION

            Updating jquery with realtime sensor data through flask
            Asked 2020-Dec-15 at 11:27

            I am trying to send realtime data from a sensor through flask to the front-end through jquery. Right now my script uses setInterval(..., 1000); to update the data through a ajax request.

            However, I would like to update the jquery request when new sensordata is received from flask, as the framerate from the sensor differ and its hard to set a specific interval to make it realtime.

            Is it possible to use some kind of signal in the jquery code when new data is sent through @app.route('/data')?

            Python script:

            ...

            ANSWER

            Answered 2020-Dec-15 at 11:27

            For realtime data, use 'text/event-stream' MIME type

            return Response(generate_random_data(), mimetype='text/event-stream')

            or yield a server-side event (i used this type with the below snippet)

            Here is part of a front-end snippet i used:

            Source https://stackoverflow.com/questions/65304692

            QUESTION

            What is the difference between #define name and #define name(arguments) when it comes to #ifdef name or #if defined(name) in C?
            Asked 2020-Nov-10 at 18:14

            I've been working on an embedded C project for a few days and I've found some interesting configuration files that use a lot of macros.

            The code looks like this

            ...

            ANSWER

            Answered 2020-Nov-10 at 16:09

            The code in “config.h” appears designed for some earlier code to define CONFIG_PERIPH_0 or CONFIG_PERIPH_1 but not both.

            If CONFIG_PERIPH_0 is defined, this code defines CONFIG_PERIPH_1 to be null—any use of CONFIG_PERIPH_1(…) is replaced with nothing (an empty token list). Conversely, if CONFIG_PERIPH_1 is defined, this code defines CONFIG_PERIPH_0 to be null.

            Then the code uses both CONFIG_PERIPH_0 and CONFIG_PERIPH_1, knowing that the one that was defined by the earlier code will be replaced as defined and the other will have no effect.

            Whether a macro is defined as object-like (#define foo replacement-tokens) or function-like (#define foo(argument) replacement-tokens) is irrelevant to the defined operator or the #ifdef directive. If the macro is defined either way, the defined operator evaluates as true. If it is not defined, the operator evaluates as false.

            Source https://stackoverflow.com/questions/64772356

            QUESTION

            Modify element text with loop in xml file using python
            Asked 2020-Oct-28 at 01:33

            I have been doing some modifications on an .xml file using python and lxml library and ElementTree. I have this result:

            ...

            ANSWER

            Answered 2020-Oct-27 at 22:05
            from lxml import etree
            
            root = etree.parse(r'')
            
            for name in root.xpath('//name[./following-sibling::displayName]'):
                name.getnext().text = name.text
            
            print( etree.tostring(root, pretty_print=True).decode('utf-8') )
            

            Source https://stackoverflow.com/questions/64563217

            QUESTION

            RISCV C to hex Compilation for UART
            Asked 2020-Sep-06 at 18:35

            I am trying to convert UART loopback program to corresponding hex code. The command

            ...

            ANSWER

            Answered 2020-Sep-06 at 18:35

            You have this error because rt/rt_api.h is not present in your riscv gcc search path.
            To see the folders present in search path you can add -v option to your command or use:

            Source https://stackoverflow.com/questions/63751301

            QUESTION

            How do I template a class using an instance of another templated class?
            Asked 2020-May-18 at 17:51

            I have a gpio class which is templated:

            ...

            ANSWER

            Answered 2020-May-18 at 15:24

            QUESTION

            Distinct pointer types lacks a cast in c
            Asked 2020-Feb-17 at 18:43

            I am using the ST32 I-cube example code and trying to initiate the ADC with the following code:

            ...

            ANSWER

            Answered 2020-Feb-17 at 18:43

            I'm almost certain that ADC is not a valid instance, you should be using ADC1 (or 2 or whatever) instead.

            Looking in one of the STM32 header files shows:

            Source https://stackoverflow.com/questions/60266864

            QUESTION

            SPI slave read data into buffer on stm32?
            Asked 2019-Nov-05 at 11:08

            I'm trying to set communication between esp32 (master) and stm32 (slave) over SPI. esp32 is running under micropython and sends four bytes, for example spi.write_readinto(b'\x31\x32\x33\x34', buf)

            stm32' code is here (instead of this i use SPI_InitDef.SPI_NSS = SPI_NSS_Soft;)

            ...

            ANSWER

            Answered 2019-Nov-05 at 09:17

            I think the following code is not correct (but I don't know what the function SPI_I2S_ReceiveData is doing):

            Source https://stackoverflow.com/questions/58706757

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install periph

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries