1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #3956 from haukepetersen/rm_periph_i2c_slavemode

drivers/i2c: removed init_slave for now
This commit is contained in:
Hauke Petersen 2015-10-20 17:48:41 +02:00
commit 3c82951208
8 changed files with 0 additions and 87 deletions

View File

@ -154,14 +154,6 @@ int i2c_init_master(i2c_t dev, i2c_speed_t speed)
return 0;
}
int i2c_init_slave(i2c_t dev, uint8_t address)
{
/* TODO: implement slave mode */
(void) dev;
(void) address;
return -1;
}
/*
* Check for bus master arbitration lost.
* Arbitration is lost in the following circumstances:

View File

@ -204,12 +204,6 @@ int i2c_init_master(i2c_t dev, i2c_speed_t speed)
return 0;
}
int i2c_init_slave(i2c_t dev, uint8_t address)
{
/* TODO */
return 0;
}
int i2c_acquire(i2c_t dev)
{
if (dev >= I2C_NUMOF) {

View File

@ -152,12 +152,6 @@ static void _pin_config(gpio_t scl, gpio_t sda)
gpio_init_af(sda, GPIO_AF_OUT_OD);
}
int i2c_init_slave(i2c_t dev, uint8_t address)
{
/* TODO: implement slave mode */
return -1;
}
int i2c_acquire(i2c_t dev)
{
if (dev >= I2C_NUMOF) {

View File

@ -227,12 +227,6 @@ static void _pin_config(GPIO_TypeDef *port_scl, GPIO_TypeDef *port_sda,
}
}
int i2c_init_slave(i2c_t dev, uint8_t address)
{
/* TODO: implement slave mode */
return -1;
}
int i2c_acquire(i2c_t dev)
{
if (dev >= I2C_NUMOF) {

View File

@ -215,14 +215,6 @@ static void _toggle_pins(GPIO_TypeDef *port_scl, GPIO_TypeDef *port_sda, int pin
port_sda->ODR |= (1 << pin_sda);
}
int i2c_init_slave(i2c_t dev, uint8_t address)
{
/* TODO: implement slave mode */
(void) dev;
(void) address;
return -1;
}
int i2c_acquire(i2c_t dev)
{
if (dev >= I2C_NUMOF) {

View File

@ -213,12 +213,6 @@ static void _toggle_pins(GPIO_TypeDef *port, int pin_scl, int pin_sda)
port->ODR |= (1 << pin_sda);
}
int i2c_init_slave(i2c_t dev, uint8_t address)
{
/* TODO: implement slave mode */
return -1;
}
int i2c_acquire(i2c_t dev)
{
if (dev >= I2C_NUMOF) {

View File

@ -131,17 +131,6 @@ typedef enum {
*/
int i2c_init_master(i2c_t dev, i2c_speed_t speed);
/**
* @brief Initialize an I2C device to run in slave mode
*
* @param[in] dev the device to initialize
* @param[in] address the devices I2C address
*
* @return 0 on success
* @return -1 on undefined device given
*/
int i2c_init_slave(i2c_t dev, uint8_t address);
/**
* @brief Get mutually exclusive access to the given I2C bus
*

View File

@ -69,41 +69,6 @@ int cmd_init_master(int argc, char **argv)
return 0;
}
int cmd_init_slave(int argc, char **argv)
{
int dev, addr, res;
if (argc != 3) {
puts("Error: Invalid number of arguments!");
printf("Usage:\n%s: [DEVICE] [ADDRESS]\n", argv[0]);
puts(" with DEVICE:");
for (int i = 0; i < I2C_NUMOF; i++) {
printf(" %i -> I2C_%i\n", i, i);
}
puts(" ADDRESS: value between 0 and 127");
return 1;
}
dev = atoi(argv[1]);
addr = atoi(argv[1]);
res = i2c_init_slave(dev, addr);
if (res == -1) {
puts("Error: Init: Given device not available");
return 1;
}
else if (res == -2) {
puts("Error: Init: Invalid address given");
return 1;
}
else {
printf("I2C_%i successfully initialized as slave with address %i!\n", dev, addr);
i2c_dev = dev;
}
return 0;
}
int cmd_write(int argc, char **argv)
{
int res;
@ -294,7 +259,6 @@ int cmd_read_reg(int argc, char **argv)
static const shell_command_t shell_commands[] = {
{ "init_master", "Initialize I2C as master", cmd_init_master },
{ "init_slave", "Initialize I2C as slave", cmd_init_slave },
{ "w", "write bytes to given address", cmd_write },
{ "wr", "write to register ", cmd_write_reg },
{ "r", "read bytes from given address", cmd_read },