forked from espressif/arduino-esp32
Pull latest IDF and enable TinyUSB
This commit is contained in:
@ -47,20 +47,11 @@
|
||||
#define SOC_SPI_SUPPORT_CONTINUOUS_TRANS 1
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
struct spi_dev_s;
|
||||
extern volatile struct spi_dev_s GPSPI3;
|
||||
struct spi_mem_dev_s;
|
||||
extern volatile struct spi_mem_dev_s SPIMEM1;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// Peripheral supports DIO, DOUT, QIO, or QOUT
|
||||
#define SOC_SPI_PERIPH_SUPPORT_MULTILINE_MODE(spi_dev) (!((void*)spi_dev == (void*)&GPSPI3))
|
||||
// VSPI (SPI3) only support 1-bit mode
|
||||
#define SOC_SPI_PERIPH_SUPPORT_MULTILINE_MODE(host_id) ((host_id) != 2)
|
||||
|
||||
// Peripheral supports output given level during its "dummy phase"
|
||||
#define SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUTPUT(spi_dev) ((void*)spi_dev == (void*)&SPIMEM1)
|
||||
// Only SPI1 supports this feature
|
||||
#define SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUTPUT(host_id) ((host_id) == 0)
|
||||
|
||||
|
@ -97,7 +97,7 @@ static inline uint32_t cpu_ll_ptr_to_pc(const void* addr)
|
||||
|
||||
static inline void* cpu_ll_pc_to_ptr(uint32_t pc)
|
||||
{
|
||||
return (void*) ((pc & 0x3fffffff) | 0x40000000);
|
||||
return (void*) ((pc & 0x3fffffffU) | 0x40000000U);
|
||||
}
|
||||
|
||||
static inline void cpu_ll_set_watchpoint(int id,
|
||||
|
@ -34,9 +34,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define gpspi_flash_ll_get_hw(host_id) (((host_id)==SPI2_HOST ? &GPSPI2 \
|
||||
: ((host_id)==SPI3_HOST ? &GPSPI3 \
|
||||
: ({abort();(spi_dev_t*)0;}))))
|
||||
#define gpspi_flash_ll_get_hw(host_id) ( ((host_id)==SPI2_HOST) ? &GPSPI2 : (\
|
||||
((host_id)==SPI3_HOST) ? &GPSPI3 : (\
|
||||
{abort();(spi_dev_t*)0;}\
|
||||
)) )
|
||||
#define gpspi_flash_ll_hw_get_id(dev) ( ((dev) == (void*)&GPSPI2) ? SPI2_HOST : (\
|
||||
((dev) == (void*)&GPSPI3) ? SPI3_HOST : (\
|
||||
-1 \
|
||||
)) )
|
||||
|
||||
typedef typeof(GPSPI2.clock) gpspi_flash_ll_clock_reg_t;
|
||||
|
||||
@ -286,10 +291,10 @@ static inline void gpspi_flash_ll_set_command8(spi_dev_t *dev, uint8_t command)
|
||||
|
||||
/**
|
||||
* Get the address length that is set in register, in bits.
|
||||
*
|
||||
*
|
||||
* @param dev Beginning address of the peripheral registers.
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
static inline int gpspi_flash_ll_get_addr_bitlen(spi_dev_t *dev)
|
||||
{
|
||||
return dev->user.usr_addr ? dev->user1.usr_addr_bitlen + 1 : 0;
|
||||
@ -346,7 +351,7 @@ static inline void gpspi_flash_ll_set_dummy(spi_dev_t *dev, uint32_t dummy_n)
|
||||
*
|
||||
* @param dev Beginning address of the peripheral registers.
|
||||
* @param out_en whether to enable IO output for dummy phase
|
||||
* @param out_level dummy output level
|
||||
* @param out_level dummy output level
|
||||
*/
|
||||
static inline void gpspi_flash_ll_set_dummy_out(spi_dev_t *dev, uint32_t out_en, uint32_t out_lev)
|
||||
{
|
||||
|
@ -41,6 +41,12 @@ extern "C" {
|
||||
#define spi_flash_ll_get_hw(host_id) (((host_id)<=SPI1_HOST ? (spi_dev_t*) spimem_flash_ll_get_hw(host_id) \
|
||||
: gpspi_flash_ll_get_hw(host_id)))
|
||||
|
||||
#define spi_flash_ll_hw_get_id(dev) ({int dev_id = spimem_flash_ll_hw_get_id(dev); \
|
||||
if (dev_id < 0) {\
|
||||
dev_id = gpspi_flash_ll_hw_get_id(dev);\
|
||||
}\
|
||||
dev_id; \
|
||||
})
|
||||
|
||||
typedef union {
|
||||
gpspi_flash_ll_clock_reg_t gpspi;
|
||||
|
@ -35,7 +35,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define spimem_flash_ll_get_hw(host_id) (((host_id)==SPI1_HOST ? &SPIMEM1 : NULL ))
|
||||
#define spimem_flash_ll_get_hw(host_id) (((host_id)==SPI1_HOST ? &SPIMEM1 : NULL ))
|
||||
#define spimem_flash_ll_hw_get_id(dev) ((dev) == (void*)&SPIMEM1? SPI1_HOST: -1)
|
||||
|
||||
typedef typeof(SPIMEM1.clock) spimem_flash_ll_clock_reg_t;
|
||||
|
||||
@ -324,10 +325,10 @@ static inline void spimem_flash_ll_set_command8(spi_mem_dev_t *dev, uint8_t comm
|
||||
|
||||
/**
|
||||
* Get the address length that is set in register, in bits.
|
||||
*
|
||||
*
|
||||
* @param dev Beginning address of the peripheral registers.
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
static inline int spimem_flash_ll_get_addr_bitlen(spi_mem_dev_t *dev)
|
||||
{
|
||||
return dev->user.usr_addr ? dev->user1.usr_addr_bitlen + 1 : 0;
|
||||
|
Reference in New Issue
Block a user