2017-05-01 22:02:07 +02:00
|
|
|
// Module for interfacing with the SPI interface
|
|
|
|
|
|
|
|
#include "module.h"
|
|
|
|
#include "lauxlib.h"
|
|
|
|
|
|
|
|
#include "spi_common.h"
|
|
|
|
#include "driver/spi_common.h"
|
|
|
|
|
|
|
|
|
2019-07-22 11:13:43 +02:00
|
|
|
LROT_BEGIN(lspi)
|
|
|
|
LROT_FUNCENTRY( master, lspi_master )
|
|
|
|
// LROT_FUNCENTRY( slave, lspi_slave )
|
2021-08-11 09:11:11 +02:00
|
|
|
#if defined(CONFIG_IDF_TARGET_ESP32)
|
2019-07-22 11:13:43 +02:00
|
|
|
LROT_NUMENTRY( SPI, SPI_HOST )
|
|
|
|
LROT_NUMENTRY( HSPI, HSPI_HOST )
|
|
|
|
LROT_NUMENTRY( VSPI, VSPI_HOST )
|
2021-08-11 09:11:11 +02:00
|
|
|
#endif
|
|
|
|
LROT_NUMENTRY( SPI1, SPI1_HOST )
|
|
|
|
LROT_NUMENTRY( SPI2, SPI2_HOST )
|
|
|
|
LROT_NUMENTRY( SPI3, SPI3_HOST )
|
2019-07-22 11:13:43 +02:00
|
|
|
LROT_END(lspi, NULL, 0)
|
2017-05-01 22:02:07 +02:00
|
|
|
|
|
|
|
int luaopen_spi( lua_State *L ) {
|
|
|
|
luaopen_spi_master( L );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-22 11:13:43 +02:00
|
|
|
NODEMCU_MODULE(SPI, "spi", lspi, luaopen_spi);
|