Skip to content

Commit

Permalink
wip: api skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
everedero committed Mar 5, 2024
1 parent 35f5c51 commit 263908d
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions drivers/cc2500/cc2500.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,32 @@ LOG_MODULE_REGISTER(cc2500, CONFIG_CC2500_LOG_LEVEL);

struct cc2500_config {
const struct spi_dt_spec spi;
struct gpio_dt_spec ce;
};

struct cc2500_data {
};

static int cc2500_read(const struct device *dev, uint8_t *buffer, uint8_t data_len)
{
int ret = 0;
struct cc2500_data *data = dev->data;
return ret;
}

static int cc2500_write(const struct device *dev, uint8_t *buffer, uint8_t data_len)
{
int ret = 0;
struct cc2500_data *data = dev->data;
return ret;
}

static const struct propy_radio_api cc2500_api = {
.read = cc2500_read,
.write = cc2500_write,
};


/* Init */
static int cc2500_init(const struct device *dev)
{
Expand All @@ -46,12 +67,6 @@ static int cc2500_init(const struct device *dev)
return ret;
}

if (!cc2500_test_spi(dev))
{
LOG_ERR("Issue with SPI read/write");
return -EIO;
}

return 0;
}

Expand Down

0 comments on commit 263908d

Please sign in to comment.