Fix code style: platform/zoul
This commit is contained in:
parent
a30154c43e
commit
8727fef05b
@ -34,7 +34,7 @@
|
||||
*
|
||||
* \defgroup zoul-platforms Zolertia platforms based on the Zoul core module
|
||||
*
|
||||
* The Zoul allows a fast reuse and easy integration to most applications and
|
||||
* The Zoul allows a fast reuse and easy integration to most applications and
|
||||
* products. Its small size and module format eases to place in different PCB
|
||||
* designs and to integrate in existing products. The Zoul-based platforms
|
||||
* share most of the Zoul core implementation.
|
||||
@ -74,7 +74,7 @@ typedef uint32_t uip_stats_t;
|
||||
* RTIMER_CLOCK_LT to override this
|
||||
*/
|
||||
typedef uint32_t rtimer_clock_t;
|
||||
#define RTIMER_CLOCK_LT(a,b) ((int32_t)((a)-(b)) < 0)
|
||||
#define RTIMER_CLOCK_LT(a, b) ((int32_t)((a) - (b)) < 0)
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
@ -83,7 +83,7 @@ typedef uint32_t rtimer_clock_t;
|
||||
* @{
|
||||
*/
|
||||
#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR
|
||||
#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR 1 /**<Enable the boot loader backdoor */
|
||||
#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR 1 /**<Enable the boot loader backdoor */
|
||||
#endif
|
||||
|
||||
#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN
|
||||
@ -110,7 +110,7 @@ typedef uint32_t rtimer_clock_t;
|
||||
* @{
|
||||
*/
|
||||
#ifndef WATCHDOG_CONF_ENABLE
|
||||
#define WATCHDOG_CONF_ENABLE 1 /**< Enable the watchdog timer */
|
||||
#define WATCHDOG_CONF_ENABLE 1 /**< Enable the watchdog timer */
|
||||
#endif
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -225,7 +225,7 @@ typedef uint32_t rtimer_clock_t;
|
||||
* This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT
|
||||
* keep using SLIP
|
||||
*/
|
||||
#if defined (UIP_FALLBACK_INTERFACE) || defined (CMD_CONF_OUTPUT)
|
||||
#if defined(UIP_FALLBACK_INTERFACE) || defined(CMD_CONF_OUTPUT)
|
||||
#define SLIP_ARCH_CONF_ENABLED 1
|
||||
#endif
|
||||
#endif
|
||||
@ -359,7 +359,7 @@ typedef uint32_t rtimer_clock_t;
|
||||
#define NETSTACK_CONF_RADIO cc2538_rf_driver
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
* RE-Mote specific:
|
||||
* If dual RF enabled, we set the RF switch to enable the CC1200 and use 2.4GHz
|
||||
* on the available uFl/chip antenna (not mounted as default). In contiki main
|
||||
@ -369,10 +369,10 @@ typedef uint32_t rtimer_clock_t;
|
||||
*/
|
||||
#if REMOTE_DUAL_RF_ENABLED
|
||||
#define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_SUBGHZ
|
||||
#else /* REMOTE_DUAL_RF_ENABLED */
|
||||
#else /* REMOTE_DUAL_RF_ENABLED */
|
||||
#ifndef ANTENNA_SW_SELECT_DEF_CONF
|
||||
#define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_2_4GHZ
|
||||
#else /* ANTENNA_SW_SELECT_DEF_CONF */
|
||||
#else /* ANTENNA_SW_SELECT_DEF_CONF */
|
||||
#define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_DEF_CONF
|
||||
#endif /* ANTENNA_SW_SELECT_DEF_CONF */
|
||||
#endif /* REMOTE_DUAL_RF_ENABLED */
|
||||
|
@ -114,9 +114,9 @@ configure(int type, int value)
|
||||
return ZOUL_SENSORS_ERROR;
|
||||
}
|
||||
|
||||
if((value != ZOUL_SENSORS_ADC1) && (value != ZOUL_SENSORS_ADC2) &&
|
||||
(value != ZOUL_SENSORS_ADC3) && (value != ZOUL_SENSORS_ADC12) &&
|
||||
(value != ZOUL_SENSORS_ADC13) && (value != ZOUL_SENSORS_ADC23)) {
|
||||
if((value != ZOUL_SENSORS_ADC1) && (value != ZOUL_SENSORS_ADC2) &&
|
||||
(value != ZOUL_SENSORS_ADC3) && (value != ZOUL_SENSORS_ADC12) &&
|
||||
(value != ZOUL_SENSORS_ADC13) && (value != ZOUL_SENSORS_ADC23)) {
|
||||
return ZOUL_SENSORS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
* - ZOUL_SENSORS_ADC2
|
||||
* - ZOUL_SENSORS_ADC3
|
||||
*
|
||||
* To initialize the ADC sensors use the configure() function, using as first
|
||||
* To initialize the ADC sensors use the configure() function, using as first
|
||||
* argument SENSORS_HW_INIT, and choose which ADC channels to enable passing as
|
||||
* second argument any single or combined (sum) values as below:
|
||||
* - ZOUL_SENSORS_ADC1
|
||||
@ -83,7 +83,7 @@
|
||||
#define ADC_SENSORS_PORT_BASE GPIO_PORT_TO_BASE(ADC_SENSORS_PORT)
|
||||
|
||||
/*
|
||||
* PA0-PA3 are hardcoded to UART0 and the user button for most Zolertia
|
||||
* PA0-PA3 are hardcoded to UART0 and the user button for most Zolertia
|
||||
* platforms, the following assumes PA0 shall not be used as ADC input, else
|
||||
* re-write the below definitions
|
||||
*/
|
||||
@ -107,7 +107,7 @@
|
||||
#define ZOUL_SENSORS_ADC3 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
* This is safe as the disabled sensors should have a zero value thus not
|
||||
* affecting the mask operations
|
||||
*/
|
||||
|
@ -39,7 +39,7 @@
|
||||
*
|
||||
* Driver for the Zoul user button
|
||||
*
|
||||
* The user button (on Zoul-based platforms like the RE-Mote and the Firefly)
|
||||
* The user button (on Zoul-based platforms like the RE-Mote and the Firefly)
|
||||
* will generate a sensors_changed event on press as well as on release.
|
||||
*
|
||||
* Unlike many other platforms, the user button has the ability to
|
||||
|
@ -99,7 +99,7 @@ cc1200_arch_spi_select(void)
|
||||
/* The MISO pin should go low before chip is fully enabled. */
|
||||
BUSYWAIT_UNTIL(
|
||||
GPIO_READ_PIN(CC1200_SPI_MISO_PORT_BASE, CC1200_SPI_MISO_PIN_MASK) == 0,
|
||||
RTIMER_SECOND/100);
|
||||
RTIMER_SECOND / 100);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
@ -129,7 +129,6 @@ cc1200_arch_spi_rw(uint8_t *inbuf, const uint8_t *write_buf, uint16_t len)
|
||||
|
||||
if((inbuf == NULL && write_buf == NULL) || len <= 0) {
|
||||
return 1;
|
||||
|
||||
} else if(inbuf == NULL) {
|
||||
for(i = 0; i < len; i++) {
|
||||
SPI_WAITFORTx_BEFORE();
|
||||
@ -140,7 +139,6 @@ cc1200_arch_spi_rw(uint8_t *inbuf, const uint8_t *write_buf, uint16_t len)
|
||||
/* read and discard to avoid "variable set but not used" warning */
|
||||
(void)c;
|
||||
}
|
||||
|
||||
} else if(write_buf == NULL) {
|
||||
for(i = 0; i < len; i++) {
|
||||
SPI_WAITFORTx_BEFORE();
|
||||
@ -149,7 +147,6 @@ cc1200_arch_spi_rw(uint8_t *inbuf, const uint8_t *write_buf, uint16_t len)
|
||||
SPIX_WAITFOREORx(CC1200_SPI_INSTANCE);
|
||||
inbuf[i] = SPIX_BUF(CC1200_SPI_INSTANCE);
|
||||
}
|
||||
|
||||
} else {
|
||||
for(i = 0; i < len; i++) {
|
||||
SPI_WAITFORTx_BEFORE();
|
||||
@ -171,7 +168,7 @@ cc1200_arch_gpio0_setup_irq(int rising)
|
||||
GPIO_DETECT_EDGE(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
|
||||
GPIO_TRIGGER_SINGLE_EDGE(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
|
||||
|
||||
if (rising){
|
||||
if(rising) {
|
||||
GPIO_DETECT_RISING(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
|
||||
} else {
|
||||
GPIO_DETECT_FALLING(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
|
||||
@ -180,7 +177,7 @@ cc1200_arch_gpio0_setup_irq(int rising)
|
||||
GPIO_ENABLE_INTERRUPT(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
|
||||
ioc_set_over(CC1200_GDO0_PORT, CC1200_GDO0_PIN, IOC_OVERRIDE_PUE);
|
||||
nvic_interrupt_enable(CC1200_GPIOx_VECTOR);
|
||||
gpio_register_callback(cc1200_rx_interrupt, CC1200_GDO0_PORT,
|
||||
gpio_register_callback(cc1200_rx_interrupt, CC1200_GDO0_PORT,
|
||||
CC1200_GDO0_PIN);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -193,7 +190,7 @@ cc1200_arch_gpio2_setup_irq(int rising)
|
||||
GPIO_DETECT_EDGE(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
|
||||
GPIO_TRIGGER_SINGLE_EDGE(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
|
||||
|
||||
if (rising){
|
||||
if(rising) {
|
||||
GPIO_DETECT_RISING(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
|
||||
} else {
|
||||
GPIO_DETECT_FALLING(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
|
||||
@ -202,7 +199,7 @@ cc1200_arch_gpio2_setup_irq(int rising)
|
||||
GPIO_ENABLE_INTERRUPT(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
|
||||
ioc_set_over(CC1200_GDO2_PORT, CC1200_GDO2_PIN, IOC_OVERRIDE_PUE);
|
||||
nvic_interrupt_enable(CC1200_GPIOx_VECTOR);
|
||||
gpio_register_callback(cc1200_rx_interrupt, CC1200_GDO2_PORT,
|
||||
gpio_register_callback(cc1200_rx_interrupt, CC1200_GDO2_PORT,
|
||||
CC1200_GDO2_PIN);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@ -279,7 +276,7 @@ cc1200_arch_init(void)
|
||||
/* Ensure MISO is high */
|
||||
BUSYWAIT_UNTIL(
|
||||
GPIO_READ_PIN(CC1200_SPI_MISO_PORT_BASE, CC1200_SPI_MISO_PIN_MASK),
|
||||
RTIMER_SECOND/10);
|
||||
RTIMER_SECOND / 10);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
|
@ -55,7 +55,7 @@ configure(int type, int value)
|
||||
return SHT25_ERROR;
|
||||
}
|
||||
if(value) {
|
||||
i2c_init(I2C_SDA_PORT, I2C_SDA_PIN, I2C_SCL_PORT, I2C_SCL_PIN,
|
||||
i2c_init(I2C_SDA_PORT, I2C_SDA_PIN, I2C_SCL_PORT, I2C_SCL_PIN,
|
||||
I2C_SCL_NORMAL_BUS_SPEED);
|
||||
}
|
||||
enabled = value;
|
||||
@ -113,7 +113,7 @@ sht25_read(uint8_t variable, uint16_t *rd)
|
||||
return SHT25_ERROR;
|
||||
}
|
||||
|
||||
if (sht25_read_reg(variable, buf, 2) == SHT25_SUCCESS){
|
||||
if(sht25_read_reg(variable, buf, 2) == SHT25_SUCCESS) {
|
||||
raw = (buf[0] << 8) + buf[1];
|
||||
*rd = sht25_convert(variable, raw);
|
||||
return SHT25_SUCCESS;
|
||||
@ -125,7 +125,7 @@ static int
|
||||
value(int type)
|
||||
{
|
||||
uint16_t val;
|
||||
if (sht25_read(type, &val) == SHT25_SUCCESS){
|
||||
if(sht25_read(type, &val) == SHT25_SUCCESS) {
|
||||
return val;
|
||||
}
|
||||
return SHT25_ERROR;
|
||||
|
@ -44,7 +44,7 @@
|
||||
static void
|
||||
configure_unused_pins(void)
|
||||
{
|
||||
// FIXME
|
||||
/* FIXME */
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
|
@ -29,7 +29,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
/**
|
||||
* \addtogroup zoul-platforms
|
||||
* @{
|
||||
*
|
||||
@ -70,7 +70,7 @@
|
||||
* -----------------------------+---+---+--------------------------------------
|
||||
* PB5/CC1200.CS |-01|01-| LED1/PD5
|
||||
* PB2/SPI0.SCLK/CC1200.SCLK |-02|02-| LED2/PD4
|
||||
* PB1/SPIO0.MOSI/CC1200.MOSI |-03|03-| LED3/PD3
|
||||
* PB1/SPIO0.MOSI/CC1200.MOSI |-03|03-| LED3/PD3
|
||||
* PB3/SPIO0.MISO/CC1200.MISO |-04|04-| PD2
|
||||
* PB3/CC1200.GPIO0 |-05|05-| PD1
|
||||
* PC0/UART1.TX |-06|06-| PD0
|
||||
@ -193,8 +193,8 @@
|
||||
*
|
||||
* The Firefly, as it is, only allows 3.3VDC sensors.
|
||||
*
|
||||
* The internal ADC reference is 1190mV, use either a voltage divider as input,
|
||||
* or a different voltage reference, like AVDD5 or other externally (AIN7 or
|
||||
* The internal ADC reference is 1190mV, use either a voltage divider as input,
|
||||
* or a different voltage reference, like AVDD5 or other externally (AIN7 or
|
||||
* AIN6).
|
||||
* @{
|
||||
*/
|
||||
@ -208,8 +208,8 @@
|
||||
* \name SPI (SSI0) configuration
|
||||
*
|
||||
* These values configure which CC2538 pins to use for the SPI (SSI0) lines,
|
||||
* reserved exclusively for the CC1200 RF transceiver. These pins are exposed
|
||||
* to the JP3 connector. To disable the CC1200 and use these pins, just
|
||||
* reserved exclusively for the CC1200 RF transceiver. These pins are exposed
|
||||
* to the JP3 connector. To disable the CC1200 and use these pins, just
|
||||
* remove the R10 resistor (0 ohm), which powers both the CC2538 and CC1200 to
|
||||
* only power the SoC.
|
||||
* TX -> MOSI, RX -> MISO
|
||||
|
@ -36,9 +36,9 @@
|
||||
* interface of the CC2538, or the CC1200 Sub-1GHz RF interface, both routed to
|
||||
* the RP-SMA connector for an external antenna.
|
||||
* When the 2.4GHz RF interface is enabled, the CC1200 is powered down.
|
||||
* When the CC1200 is enabled, alternatively the 2.4GHz can be also used if
|
||||
* When the CC1200 is enabled, alternatively the 2.4GHz can be also used if
|
||||
* placing an 0Ohm resistor (R19), to connect either via a non-mounted chip
|
||||
* antenna, or with an external antenna connected to a non-mounted U.Fl
|
||||
* antenna, or with an external antenna connected to a non-mounted U.Fl
|
||||
* connector with a pigtail.
|
||||
*
|
||||
* RF switch state:
|
||||
@ -72,7 +72,7 @@ antenna_sw_config(void)
|
||||
GPIO_SET_OUTPUT(ANTENNA_RF_SW_PORT_BASE, ANTENNA_RF_SW_PIN_MASK);
|
||||
|
||||
/* Set the antenna selector to a default position */
|
||||
GPIO_WRITE_PIN(ANTENNA_RF_SW_PORT_BASE, ANTENNA_RF_SW_PIN_MASK,
|
||||
GPIO_WRITE_PIN(ANTENNA_RF_SW_PORT_BASE, ANTENNA_RF_SW_PIN_MASK,
|
||||
ANTENNA_SW_SELECT_DEFAULT);
|
||||
|
||||
initialized = 1;
|
||||
|
@ -45,7 +45,7 @@
|
||||
static void
|
||||
configure_unused_pins(void)
|
||||
{
|
||||
// FIXME
|
||||
/* FIXME */
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
|
@ -192,7 +192,7 @@
|
||||
* \name ADC configuration
|
||||
*
|
||||
* These values configure which CC2538 pins and ADC channels to use for the ADC
|
||||
* inputs. By default the RE-Mote allows two out-of-the-box ADC ports with a
|
||||
* inputs. By default the RE-Mote allows two out-of-the-box ADC ports with a
|
||||
* phidget-like 3-pin connector (GND/VDD/ADC)
|
||||
*
|
||||
* The RE-Mote allows both 3.3V and 5V analogue sensors as follow:
|
||||
@ -201,15 +201,15 @@
|
||||
* - ADC2: up to 3.3V, shared with RTC_INT
|
||||
* - ADC3: up to 5V, by means of a 2/3 voltage divider.
|
||||
*
|
||||
* ADC inputs can only be on port A.
|
||||
* All ADCx are exposed in JP5 connector, but only ADC1 and ADC3 have GND and
|
||||
* VDD (3/5V) pins next to it, so these can be exposed into a 3-pin phidget-like
|
||||
* connector, for ADC2 either solder a wire to connect, or use a 4-pin connector
|
||||
* to expose both ADC1 and ADC2 in a single connector, but this will leave no
|
||||
* ADC inputs can only be on port A.
|
||||
* All ADCx are exposed in JP5 connector, but only ADC1 and ADC3 have GND and
|
||||
* VDD (3/5V) pins next to it, so these can be exposed into a 3-pin phidget-like
|
||||
* connector, for ADC2 either solder a wire to connect, or use a 4-pin connector
|
||||
* to expose both ADC1 and ADC2 in a single connector, but this will leave no
|
||||
* space for a ADC3 connector.
|
||||
* The internal ADC reference is 1190mV, use either a voltage divider as input,
|
||||
* The internal ADC reference is 1190mV, use either a voltage divider as input,
|
||||
* or a different voltage reference, like AVDD5 or other externally (AIN7), but
|
||||
* note the PA7 is shared with the Micro-SD CSn pin, likewise for PA6 (AIN6)
|
||||
* note the PA7 is shared with the Micro-SD CSn pin, likewise for PA6 (AIN6)
|
||||
* shared witht the Micro-SD select pin
|
||||
* To use the ADC2 pin, remove the resistor on the Zoul's PA4 pin (JP1, pin 10)
|
||||
* and enable below (replace -1 with 4).
|
||||
@ -272,8 +272,8 @@
|
||||
/**
|
||||
* \name Antenna switch configuration
|
||||
*
|
||||
* These values configure the required pin to drive the RF antenna switch, to
|
||||
* either enable the sub-1Ghz RF interface (power-up the CC1200) or the 2.4GHz
|
||||
* These values configure the required pin to drive the RF antenna switch, to
|
||||
* either enable the sub-1Ghz RF interface (power-up the CC1200) or the 2.4GHz
|
||||
* RF interface of the CC2538, both alternatively routed to a RP-SMA connector
|
||||
* to allow using an external antenna for both cases.
|
||||
*
|
||||
@ -295,7 +295,7 @@
|
||||
* \name Dual RF interface support
|
||||
*
|
||||
* Enables support for dual band operation (both CC1200 and 2.4GHz enabled).
|
||||
* The driver checks the selected Radio stack, and forces the antenna switch to
|
||||
* The driver checks the selected Radio stack, and forces the antenna switch to
|
||||
* either position. Enabling the definition below forces to skip this check.
|
||||
* @{
|
||||
*/
|
||||
@ -331,7 +331,7 @@
|
||||
/**
|
||||
* \name microSD configuration
|
||||
*
|
||||
* These values configure the required pins to drive the built-in microSD
|
||||
* These values configure the required pins to drive the built-in microSD
|
||||
* external module, to be used with SSI1
|
||||
* @{
|
||||
*/
|
||||
@ -356,13 +356,13 @@
|
||||
* an ultra-low power consumption MCU (PIC12F635). The Shutdown mode allows:
|
||||
*
|
||||
* - Put the RE-Mote in an ultra-low power sleep (shutdown) drawing 350nA avg.
|
||||
* - Periodically awake and execute tasks, being the shutdown period selectable
|
||||
* - Periodically awake and execute tasks, being the shutdown period selectable
|
||||
* via R47 resistor value (22KOhm as default for 1 minute shutdown period).
|
||||
* - Enter shutdown mode before the shutdown period expiration, by sending a
|
||||
* pulse to SHUTDOWN_DONE.
|
||||
*
|
||||
* To enable or disable the shutdown mode a well-known sequence has to be sent
|
||||
* to the PIC12F635 via its 1-Wire pin, when the shutdown mode is enabled,
|
||||
* to the PIC12F635 via its 1-Wire pin, when the shutdown mode is enabled,
|
||||
* confirmation is done by the PIC echoing-back the command to the CC2538.
|
||||
*
|
||||
* The shutdown mode can be disabled by hardware by short-circuiting or placing
|
||||
@ -378,7 +378,7 @@
|
||||
/**
|
||||
* \name On-board RTC
|
||||
*
|
||||
* The Abracon AB0805 RTC is used by both the
|
||||
* The Abracon AB0805 RTC is used by both the
|
||||
* The shutdown mode can be disabled by hardware by short-circuiting or placing
|
||||
* an 0Ohm resistor across W1 pad. As the RTC_INT1 pin is also shared with the
|
||||
* BUTTON_USER, so either disable or not use the user button, or upon receiving
|
||||
|
Loading…
Reference in New Issue
Block a user