Move the SPI and Ext Flash Driver to a common directory

This commit creates a `common` directory, aimed to host drivers supported by multiple boards of the CC13xx/CC26xx family.

We move the Sensortag SPI and External Flash drivers to this location and we change the Sensortag build system to pull the  respective files from therein.
This commit is contained in:
George Oikonomou 2016-01-24 16:52:56 +00:00
parent 24871b0702
commit 5eb0470ad4
5 changed files with 20 additions and 11 deletions

View file

@ -33,7 +33,7 @@
* @{
*
* \file
* Board-specific SPI driver for the Sensortag-CC26xx
* Board-specific SPI driver common to the Sensortag and LaunchPad
*/
/*---------------------------------------------------------------------------*/
#include "contiki.h"

View file

@ -29,14 +29,22 @@
*/
/*---------------------------------------------------------------------------*/
/**
* \addtogroup sensortag-cc26xx-peripherals
* \addtogroup cc26xx-srf-tag
* @{
*
* \defgroup sensortag-cc26xx-spi SensorTag 2.0 SPI functions
* \defgroup common-cc26xx-peripherals CC13xx/CC26xx peripheral driver pool
*
* Drivers for peripherals present on more than one CC13xx/CC26xx board. For
* example, the same external flash driver is used for both the part found on
* the Sensortag as well as the part on the LaunchPad.
*
* @{
*
* \defgroup sensortag-cc26xx-spi SensorTag/LaunchPad SPI functions
* @{
*
* \file
* Header file for the Sensortag-CC26xx SPI Driver
* Header file for the Sensortag/LaunchPad SPI Driver
*/
/*---------------------------------------------------------------------------*/
#ifndef BOARD_SPI_H_
@ -100,6 +108,7 @@ bool board_spi_write(const uint8_t *buf, size_t length);
#endif /* BOARD_SPI_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
* @}
* @}
*/

View file

@ -33,7 +33,7 @@
* @{
*
* \file
* Driver for the Sensortag-CC26xx WinBond W25X20CL Flash
* Driver for the LaunchPad Flash and the Sensortag WinBond W25X20CL/W25X40CL
*/
/*---------------------------------------------------------------------------*/
#include "contiki.h"
@ -158,7 +158,7 @@ static uint8_t
verify_part(void)
{
const uint8_t wbuf[] = { BLS_CODE_MDID, 0xFF, 0xFF, 0x00 };
uint8_t rbuf[2] = {0, 0};
uint8_t rbuf[2] = { 0, 0 };
bool ret;
select_on_bus();

View file

@ -29,14 +29,14 @@
*/
/*---------------------------------------------------------------------------*/
/**
* \addtogroup sensortag-cc26xx-peripherals
* \addtogroup common-cc26xx-peripherals
* @{
*
* \defgroup sensortag-cc26xx-ext-flash SensorTag 2.0 External Flash
* \defgroup sensortag-cc26xx-ext-flash SensorTag/LaunchPad External Flash
* @{
*
* \file
* Header file for the Sensortag-CC26xx External Flash Driver
* Header file for the Sensortag/LaunchPad External Flash Driver
*/
/*---------------------------------------------------------------------------*/
#ifndef EXT_FLASH_H_

View file

@ -1,7 +1,7 @@
CFLAGS += -DBOARD_SENSORTAG=1
CFLAGS += -DBACKDOOR_IOID=0x00000000
CONTIKI_TARGET_DIRS += sensortag
CONTIKI_TARGET_DIRS += sensortag common
BOARD_SOURCEFILES += sensortag-sensors.c sensor-common.c
BOARD_SOURCEFILES += bmp-280-sensor.c tmp-007-sensor.c opt-3001-sensor.c