Git Product home page Git Product logo

esp8266_spi_driver's People

Contributors

metalphreak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266_spi_driver's Issues

Can this interface be (ab)used for generate serial IO?

It is possible to send carefully timed, but arbitrary data, using this module? I'm looking to send 433MHz data that consists of high/low periods where each 'period' is a multiple of 400us. So I wondered could I clock the HSPI at 2500Hz and get it to stream '1s' and '0s' representing each needed high/low.

Example of ESP - Mega communication using this library

This SPI lib really looks great and exposing a neat and simple API.
I'm searching for a solution for the communication between a ESP8266 and a Mega2560. The ESP will be the master, communicating with the Mega to retrieve certain sensor values or send commands to it.

I'm especially interested in how to implement the SPI communication getting out of phase between the two.

Is there an example of such a setup that I can use a base for my own code or just to learn from?

Can we have some usage examples for initialization?

Your library looks to be exactly what we need for the Espruino port to ESP8266 project (see www.espruino.com). I'm hoping that we can have your permission to use your library in our project?

As we study your library, we are a little confused on the initialization functions. Specifically the semantics and relationships between:

  • spi_init
  • spi_init_gpio
  • spi_clock

Some additional documentation and/or examples of these would be fantastic.

I am wondering if we can also work together on a recipe or algorithm that would convert a desired SPI clock rate into the correct set of parameters to be passed into spi_clock?

SPI_MODE

I wonder if you or anyone else can help.

I'm trying to get this code working with a simple example of an Arduino slave...
https://forum.arduino.cc/index.php?topic=184527.0

I have the SLAVE demo running - as far as I can tell it should at least toggle the light on and off when it gets a byte with 1.

So I tried - I am SURE the wiring is right - the light on the Arduino is on and the serial says it is ready...

But nothing... when I tried

spi_init(1); // HSPI mode
spi_tx8(1,arg1);

with various values for arg1 including of course - 1..

Then I noted you have a function called spi_mode - which does not seem to be used in any of your examples and is not called in your c code.. I added that into the init and tried all 4 variations of args 2 and 3 in spi_mode....

Am I missing something? any pointers?

Pete.

Possible Doc error in README.md

In the README.md the pins are documented:

  • MTDI - GPIO12
  • MTCK - GPIO13
  • MTMS - GPIO14
  • MTDO - GPIO15

I think this may be an error and might be:

  • MTDI - GPIO12
  • MTDO - GPIO13
  • MTCK - GPIO14
  • MTMS - GPIO15

Add support for LSB/MSB bit order

This may be useful to someone who needs to shift out data low significant bit first. Note that this is not about LSB/MSB byte order, which is already supported.

ICACHE_FLASH_ATTR
void spi_tx_bit_order(uint8 spi_no, uint8 msb)
{
    if (spi_no > 1) return;

    if (msb) {
        CLEAR_PERI_REG_MASK(SPI_CTRL(spi_no), SPI_WR_BIT_ORDER);
    } 
    else {
        SET_PERI_REG_MASK(SPI_CTRL(spi_no), SPI_WR_BIT_ORDER);
    }
}

ICACHE_FLASH_ATTR
void spi_rx_bit_order(uint8 spi_no, uint8 msb)
{
    if (spi_no > 1) return;

    if (msb) {
        CLEAR_PERI_REG_MASK(SPI_CTRL(spi_no), SPI_RD_BIT_ORDER);
    } 
    else {
        SET_PERI_REG_MASK(SPI_CTRL(spi_no), SPI_RD_BIT_ORDER);
    }
}

Is the driver capable of driving SD card & SPI sensor together?

@MetalPhreak thanks for developing the driver, looks great.

I am starting a project where the idea is to use the esp8266 (I'm using a nodemcu-devkit-v1.0) to read data from an SPI sensor, save it to an SD card and send it out to a remote server. Do you think it would be possible to use your driver to read the data from the sensor and write it (using different CS pins) to an SD card? It's just a quick question to know if I am on the right track.

Regards,
Martin

Slave Mode?

I'm having a heck of a time trying to figure out the documentation for SPI Slave mode on the ESP8266. All I have to go on is this post http://bbs.espressif.com/viewtopic.php?t=77

As somebody with experience diving into SPI registers, any way you can point me in the right direction, or any plans to add slave mode support to this driver library?

Thanks!

Support gpio CS?

Your driver seems like a nice fit for my project but I will have more than one SPI device leading to the need for GPIO chip selects. Of course the pin toggling could be made outside of the SPI driver but imho it would be nicer to have it inside the driver as it belongs to "the SPI domain". What do you think?

SPI vs HSPI support

Hi,

I noticed in the README that you reference both SPI and HSPI (spi_no: SPI or HSPI) but in your blog you recommended against SPI use and indicated no further information would be forthcoming due to the complexities of SPI usage. I was wondering if the existence of options for spi_no indicates that your library works without issue with SPI given the constraint that it is shared?

I ask because my use case for SPI requires very infrequent use and PWM usage so I would like to free up the GPIO12-GPIO15 pins on an ESP-12F module.

Thanks,

Jason

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.