HSPI Clock Polarity

0xPIT
Posts: 9
Joined: Mon Jan 05, 2015 9:26 pm

HSPI Clock Polarity

Postby 0xPIT » Sun Jun 07, 2015 10:41 pm

Hi,

how can I change the Clock Polarity for Hardware-SPI? I need the clock to be low-active instead of the default which is high-active.

I've been playing with SPI_CTRL2, but this did not work as advertised in the Register-Description Excel file.
I was unable to delay MOSI for half a cycle.

Any help? Any examples?

Thanks,

- pit

0xPIT
Posts: 9
Joined: Mon Jan 05, 2015 9:26 pm

Re: HSPI Clock Polarity

Postby 0xPIT » Wed Jun 17, 2015 5:05 am

Bump
Hey Espressif, any help here please?
It's OK if it is not possible, I just need to know.

Thanks,

pit

OverKill
Posts: 2
Joined: Thu Jun 18, 2015 10:29 am

Re: HSPI Clock Polarity

Postby OverKill » Thu Jun 18, 2015 10:41 am

I'm trying to figure out the same thing.

I'll post back if I find anything.

0xPIT
Posts: 9
Joined: Mon Jan 05, 2015 9:26 pm

Re: HSPI Clock Polarity

Postby 0xPIT » Thu Jul 09, 2015 2:07 am

Hello Espressif,

please dig out this information, can that be so hard?

Thanks again,

pit

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Re: HSPI Clock Polarity

Postby kolban » Thu Jul 09, 2015 5:31 am

Howdy there,
Have you seen this document:

download/file.php?id=577

It is:

8Q-ESP8266 HSPI Host Multi-device API v1.0

If I look on page 6, I find a parameter called "clk_polar"

This is associated with the function called hpsi_master_dev_init().

Is this what you are looking for?

Neil

leeshine
Posts: 63
Joined: Wed Dec 31, 2014 4:59 pm

Re: HSPI Clock Polarity

Postby leeshine » Thu Jul 09, 2015 1:12 pm

是啊,希望你们增加这些接口 :D

0xPIT
Posts: 9
Joined: Mon Jan 05, 2015 9:26 pm

Re: HSPI Clock Polarity

Postby 0xPIT » Fri Jul 10, 2015 3:26 am

Thanks Neil, I could find

Code: Select all

#define HSPI_FALLING_EDGE_SAMPLE()      SET_PERI_REG_MASK(SPI_USER(HSPI),  SPI_CK_OUT_EDGE)
#define HSPI_RISING_EDGE_SAMPLE()         CLEAR_PERI_REG_MASK(SPI_USER(HSPI),  SPI_CK_OUT_EDGE)


in the spi_overlap.* sources, will try soon.

Not sure if this is for slave mode, though, as it's called _SAMPLE.

Who is online

Users browsing this forum: No registered users and 89 guests