GithubHelp home page GithubHelp logo

Comments (5)

liebman avatar liebman commented on June 30, 2024 1

@Dominaezzz I'm (ab)using it to drive a 64x64 HUB75 LED matrix. This uses 14 pins and I waste 2 pins because they are not optional. See the example I have in this draft PR.

from esp-hal.

bjoernQ avatar bjoernQ commented on June 30, 2024

I think we had something similar regarding I2S on Matrix and this worked there:

i2s_tx: esp_hal::i2s::I2sTx<'a, esp_hal::peripherals::I2S0, esp_hal::dma::Channel0,esp_hal::Async >,

from esp-hal.

Dominaezzz avatar Dominaezzz commented on June 30, 2024

The generics on that type could really use some simplifying, like what was done for PARL_IO.

A little unrelated to this issue @liebman, can I ask what hardware your talking to with the I8080 driver? (I've been trying to find 16 bit screens to test the driver)

from esp-hal.

liebman avatar liebman commented on June 30, 2024

@bjoernQ that works! Thanks. Now what I really want is this to be static so I can start the next transaction from the send done interrupt:

static MY_I8080: Mutex<
    RefCell<
        Option<
            I8080<
                ChannelTx<ChannelTxImpl<0>, Channel0>,
                TxSixteenBits<
                    GpioPin<14>,
                    GpioPin<46>,
                    GpioPin<13>,
                    GpioPin<9>,
                    GpioPin<3>,
                    GpioPin<10>,
                    GpioPin<12>,
                    GpioPin<11>,
                    GpioPin<6>,
                    GpioPin<7>,
                    GpioPin<38>,
                    GpioPin<42>,
                    GpioPin<48>,
                    GpioPin<47>,
                    GpioPin<2>,
                    GpioPin<21>,
                >,
            >,
        >,
    >,
> = Mutex::new(RefCell::new(None));

But this yields:

error[E0277]: `*mut DmaDescriptor` cannot be sent between threads safely
    --> board-tests/src/bin/i8080-static.rs:44:18
     |
44   |   static MY_I8080: Mutex<
     |  __________________^
45   | |     RefCell<
46   | |         Option<
47   | |             I8080<
...    |
69   | |     >,
70   | | > = Mutex::new(RefCell::new(None));
     | |_^ `*mut DmaDescriptor` cannot be sent between threads safely

and

error[E0277]: `*const u8` cannot be sent between threads safely
    --> board-tests/src/bin/i8080-static.rs:44:18
     |
44   |   static MY_I8080: Mutex<
     |  __________________^
45   | |     RefCell<
46   | |         Option<
47   | |             I8080<
...    |
69   | |     >,
70   | | > = Mutex::new(RefCell::new(None));
     | |_^ `*const u8` cannot be sent between threads safely

from esp-hal.

Dominaezzz avatar Dominaezzz commented on June 30, 2024

Might need a PR to mark the channel type as Send.

Short term hack could be to wrap the I8080 type in a struct before putting it in the mutex, then you can mark this struct as Send. This will let you store it in the mutex I think.

from esp-hal.

Related Issues (20)

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.