Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions app/modules/adxl345.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,6 @@ static int adxl345_setup(lua_State* L) {
return 0;
}

static int adxl345_init(lua_State* L) {

uint32_t sda;
uint32_t scl;

platform_print_deprecation_note("adxl345.init() is replaced by adxl345.setup()", "in the next version");

sda = luaL_checkinteger(L, 1);
scl = luaL_checkinteger(L, 2);

luaL_argcheck(L, sda > 0 && scl > 0, 1, "no i2c for D0");

platform_i2c_setup(adxl345_i2c_id, sda, scl, PLATFORM_I2C_SPEED_SLOW);

return adxl345_setup(L);
}

static int adxl345_read(lua_State* L) {

uint8_t data[6];
Expand Down Expand Up @@ -96,8 +79,6 @@ static int adxl345_read(lua_State* L) {
static const LUA_REG_TYPE adxl345_map[] = {
{ LSTRKEY( "read" ), LFUNCVAL( adxl345_read )},
{ LSTRKEY( "setup" ), LFUNCVAL( adxl345_setup )},
/// init() is deprecated
{ LSTRKEY( "init" ), LFUNCVAL( adxl345_init )},
{ LNILKEY, LNILVAL}
};

Expand Down
25 changes: 0 additions & 25 deletions app/modules/am2320.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,6 @@ static int am2320_setup(lua_State* L)
return 3;
}

static int am2320_init(lua_State* L)
{
uint32_t sda;
uint32_t scl;

platform_print_deprecation_note("am2320.init() is replaced by am2320.setup()", "in the next version");

if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2)) {
return luaL_error(L, "wrong arg range");
}

sda = luaL_checkinteger(L, 1);
scl = luaL_checkinteger(L, 2);

if (scl == 0 || sda == 0) {
return luaL_error(L, "no i2c for D0");
}

platform_i2c_setup(am2320_i2c_id, sda, scl, PLATFORM_I2C_SPEED_SLOW);

return am2320_setup(L);
}

static int am2320_read(lua_State* L)
{
int ret;
Expand All @@ -155,8 +132,6 @@ static int am2320_read(lua_State* L)
static const LUA_REG_TYPE am2320_map[] = {
{ LSTRKEY( "read" ), LFUNCVAL( am2320_read )},
{ LSTRKEY( "setup" ), LFUNCVAL( am2320_setup )},
// init() is deprecated
{ LSTRKEY( "init" ), LFUNCVAL( am2320_init )},
{ LNILKEY, LNILVAL}
};

Expand Down
26 changes: 0 additions & 26 deletions app/modules/bme280.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,30 +314,6 @@ static int bme280_lua_setup(lua_State* L) {
return 1;
}

static int bme280_lua_init(lua_State* L) {
uint8_t sda;
uint8_t scl;
uint8_t config;
uint8_t ack;
uint8_t full_init;

platform_print_deprecation_note("bme280.init() is replaced by bme280.setup()", "in the next version");

if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2)) {
return luaL_error(L, "wrong arg range");
}
sda = luaL_checkinteger(L, 1);
scl = luaL_checkinteger(L, 2);

platform_i2c_setup(bme280_i2c_id, sda, scl, PLATFORM_I2C_SPEED_SLOW);

// remove sda and scl parameters from stack
lua_remove(L, 1);
lua_remove(L, 1);

return bme280_lua_setup(L);
}

static void bme280_readoutdone (void *arg)
{
NODE_DBG("timer out\n");
Expand Down Expand Up @@ -495,8 +471,6 @@ static int bme280_lua_dewpoint(lua_State* L) {
}

static const LUA_REG_TYPE bme280_map[] = {
// init() is deprecated
{ LSTRKEY( "init" ), LFUNCVAL(bme280_lua_init)},
{ LSTRKEY( "setup" ), LFUNCVAL(bme280_lua_setup)},
{ LSTRKEY( "temp" ), LFUNCVAL(bme280_lua_temp)},
{ LSTRKEY( "baro" ), LFUNCVAL(bme280_lua_baro)},
Expand Down
24 changes: 0 additions & 24 deletions app/modules/bmp085.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,6 @@ static int bmp085_setup(lua_State* L) {
return 0;
}

static int bmp085_init(lua_State* L) {
uint32_t sda;
uint32_t scl;

platform_print_deprecation_note("bmp085.init() is replaced by bmp085.setup()", "in the next version");

if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2)) {
return luaL_error(L, "wrong arg range");
}

sda = luaL_checkinteger(L, 1);
scl = luaL_checkinteger(L, 2);

if (scl == 0 || sda == 0) {
return luaL_error(L, "no i2c for D0");
}

platform_i2c_setup(bmp085_i2c_id, sda, scl, PLATFORM_I2C_SPEED_SLOW);

return bmp085_setup(L);
}

static uint32_t bmp085_temperature_raw_b5(void) {
int16_t t, X1, X2;

Expand Down Expand Up @@ -196,8 +174,6 @@ static const LUA_REG_TYPE bmp085_map[] = {
{ LSTRKEY( "pressure" ), LFUNCVAL( bmp085_lua_pressure )},
{ LSTRKEY( "pressure_raw" ), LFUNCVAL( bmp085_lua_pressure_raw )},
{ LSTRKEY( "setup" ), LFUNCVAL( bmp085_setup )},
// init() is deprecated
{ LSTRKEY( "init" ), LFUNCVAL( bmp085_init )},
{ LNILKEY, LNILVAL}
};

Expand Down
28 changes: 0 additions & 28 deletions app/modules/hdc1080.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,6 @@ static int hdc1080_setup(lua_State* L) {
return 0;
}

static int hdc1080_init(lua_State* L) {

uint32_t sda;
uint32_t scl;

platform_print_deprecation_note("hdc1080.init() is replaced by hdc1080.setup()", "in the next version");

if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2)) {
return luaL_error(L, "wrong arg range");
}

sda = luaL_checkinteger(L, 1);
scl = luaL_checkinteger(L, 2);

if (scl == 0 || sda == 0) {
return luaL_error(L, "no i2c for D0");
}

platform_i2c_setup(hdc1080_i2c_id, sda, scl, PLATFORM_I2C_SPEED_SLOW);

// remove sda and scl parameters from stack
lua_remove(L, 1);
lua_remove(L, 1);

return hdc1080_setup(L);
}

static int hdc1080_read(lua_State* L) {

uint8_t data[2];
Expand Down Expand Up @@ -129,7 +102,6 @@ static int hdc1080_read(lua_State* L) {
static const LUA_REG_TYPE hdc1080_map[] = {
{ LSTRKEY( "read" ), LFUNCVAL( hdc1080_read )},
{ LSTRKEY( "setup" ), LFUNCVAL( hdc1080_setup )},
{ LSTRKEY( "init" ), LFUNCVAL( hdc1080_init )},
{ LNILKEY, LNILVAL}
};

Expand Down
19 changes: 0 additions & 19 deletions app/modules/hmc5883l.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@ static int hmc5883_setup(lua_State* L) {
return 0;
}

static int hmc5883_init(lua_State* L) {

uint32_t sda;
uint32_t scl;

platform_print_deprecation_note("hmc5883l.init() is replaced by hmc5883l.setup()", "in the next version");

sda = luaL_checkinteger(L, 1);
scl = luaL_checkinteger(L, 2);

luaL_argcheck(L, sda > 0 && scl > 0, 1, "no i2c for D0");

platform_i2c_setup(hmc5883_i2c_id, sda, scl, PLATFORM_I2C_SPEED_SLOW);

return hmc5883_setup(L);
}

static int hmc5883_read(lua_State* L) {

uint8_t data[6];
Expand Down Expand Up @@ -109,8 +92,6 @@ static int hmc5883_read(lua_State* L) {
static const LUA_REG_TYPE hmc5883_map[] = {
{ LSTRKEY( "read" ), LFUNCVAL( hmc5883_read )},
{ LSTRKEY( "setup" ), LFUNCVAL( hmc5883_setup )},
// init() is deprecated
{ LSTRKEY( "init" ), LFUNCVAL( hmc5883_init )},
{ LNILKEY, LNILVAL}
};

Expand Down
19 changes: 0 additions & 19 deletions app/modules/l3g4200d.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,6 @@ static int l3g4200d_setup(lua_State* L) {
return 0;
}

static int l3g4200d_init(lua_State* L) {

uint32_t sda;
uint32_t scl;

platform_print_deprecation_note("l3g4200d.init() is replaced by l3g4200d.setup()", "in the next version");

sda = luaL_checkinteger(L, 1);
scl = luaL_checkinteger(L, 2);

luaL_argcheck(L, sda > 0 && scl > 0, 1, "no i2c for D0");

platform_i2c_setup(i2c_id, sda, scl, PLATFORM_I2C_SPEED_SLOW);

return l3g4200d_setup(L);
}

static int l3g4200d_read(lua_State* L) {

uint8_t data[6];
Expand Down Expand Up @@ -99,8 +82,6 @@ static int l3g4200d_read(lua_State* L) {
static const LUA_REG_TYPE l3g4200d_map[] = {
{ LSTRKEY( "read" ), LFUNCVAL( l3g4200d_read )},
{ LSTRKEY( "setup" ), LFUNCVAL( l3g4200d_setup )},
// init() is deprecated
{ LSTRKEY( "init" ), LFUNCVAL( l3g4200d_init )},
{ LNILKEY, LNILVAL}
};

Expand Down
17 changes: 0 additions & 17 deletions docs/en/modules/adxl345.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,6 @@ local x,y,z = adxl345.read()
print(string.format("X = %d, Y = %d, Z = %d", x, y, z))
```

## adxl345.init()
Initializes the module and sets the pin configuration.

!!! attention

This function is deprecated and will be removed in upcoming releases. Use `adxl345.setup()` instead.

#### Syntax
`adxl345.init(sda, scl)`

#### Parameters
- `sda` data pin
- `scl` clock pin

#### Returns
`nil`

## adxl345.setup()
Initializes the module.

Expand Down
21 changes: 0 additions & 21 deletions docs/en/modules/am2320.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,6 @@

This module provides access to the [AM2320](https://akizukidenshi.com/download/ds/aosong/AM2320.pdf) humidity and temperature sensor, using the i2c interface.

## am2320.init()
Initializes the module and sets the pin configuration. Returns model, version, serial but is seams these where all zero on my model.

!!! attention

This function is deprecated and will be removed in upcoming releases. Use `am2320.setup()` instead.

#### Syntax
`model, version, serial = am2320.init(sda, scl)`

#### Parameters
- `sda` data pin
- `scl` clock pin

#### Returns
- `model` 16 bits number of model
- `version` 8 bits version number
- `serial` 32 bits serial number

Note: I have only observed values of 0 for all of these, maybe other sensors return more sensible readings.

## am2320.read()
Samples the sensor and returns the relative humidity in % and temperature in celsius, as an integer multiplied with 10.

Expand Down
15 changes: 0 additions & 15 deletions docs/en/modules/bme280.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,6 @@ none
- `H` last relative humidity reading in % times 1000
- `T` temperature in celsius as an integer multiplied with 100

## bme280.init()

Initializes module. Initialization is mandatory before read values.

!!! attention

This function is deprecated and will be removed in upcoming releases. Use `bme280.setup()` instead.

#### Syntax

`bme280.init(sda, scl, [temp_oss, press_oss, humi_oss, power_mode, inactive_duration, IIR_filter])`

#### Parameters
See [`setup()`](#bme280setup).

## bme280.qfe2qnh()

For given altitude converts the air pressure to sea level air pressure.
Expand Down
17 changes: 0 additions & 17 deletions docs/en/modules/bmp085.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,6 @@

This module provides access to the [BMP085](https://www.sparkfun.com/tutorials/253) temperature and pressure sensor. The module also works with BMP180.

## bmp085.init()
Initializes the module and sets the pin configuration.

!!! attention

This function is deprecated and will be removed in upcoming releases. Use `bmp085.setup()` instead.

#### Syntax
`bmp085.init(sda, scl)`

#### Parameters
- `sda` data pin
- `scl` clock pin

#### Returns
`nil`

## bmp085.setup()
Initializes the module.

Expand Down
18 changes: 0 additions & 18 deletions docs/en/modules/hdc1080.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,3 @@ Initializes the module.

#### Returns
`nil`


## hdc1080.init(sda,scl)
Initializes the module and sets the pin configuration.

!!! attention

This function is deprecated and will be removed in upcoming releases. Use `hdc1080.setup()` instead.

#### Syntax
`hdc1080.init(sda, scl)`

#### Parameters
- `sda` data pin
- `scl` clock pin

#### Returns
`nil`
Loading