diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-05-07 19:22:15 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-05-07 19:22:15 +0000 |
commit | ca700d2e3c06a80de37c5ef8383ca550fe20c750 (patch) | |
tree | d486856c6dafe9c6271b7808caaa4920bef63474 /nuttx/drivers | |
parent | b238002998250df997560fac2b0f18550f998855 (diff) | |
download | px4-nuttx-ca700d2e3c06a80de37c5ef8383ca550fe20c750.tar.gz px4-nuttx-ca700d2e3c06a80de37c5ef8383ca550fe20c750.tar.bz2 px4-nuttx-ca700d2e3c06a80de37c5ef8383ca550fe20c750.zip |
Mostly cosmetic changes from Uros
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3575 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers')
-rw-r--r-- | nuttx/drivers/sensors/Make.defs | 2 | ||||
-rw-r--r-- | nuttx/drivers/sensors/lis331dl.c (renamed from nuttx/drivers/sensors/st_lis331dl.c) | 50 | ||||
-rw-r--r-- | nuttx/drivers/wireless/Make.defs | 2 | ||||
-rwxr-xr-x | nuttx/drivers/wireless/cc1101.c (renamed from nuttx/drivers/wireless/chipcon_cc1101.c) | 36 |
4 files changed, 45 insertions, 45 deletions
diff --git a/nuttx/drivers/sensors/Make.defs b/nuttx/drivers/sensors/Make.defs index 61badadc2..d1019dd4d 100644 --- a/nuttx/drivers/sensors/Make.defs +++ b/nuttx/drivers/sensors/Make.defs @@ -39,6 +39,6 @@ SENSOR_CSRCS = # These drivers depend on I2C support ifeq ($(CONFIG_I2C),y) -SENSOR_CSRCS += st_lis331dl.c +SENSOR_CSRCS += lis331dl.c endif diff --git a/nuttx/drivers/sensors/st_lis331dl.c b/nuttx/drivers/sensors/lis331dl.c index ab2228fe7..4f8a858ab 100644 --- a/nuttx/drivers/sensors/st_lis331dl.c +++ b/nuttx/drivers/sensors/lis331dl.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/sensors/st_lis331dl.c + * drivers/sensors/lis331dl.c * * Copyright (C) 2011 Uros Platise. All rights reserved. * @@ -47,7 +47,7 @@ #include <stdio.h> #include <nuttx/kmalloc.h> -#include <nuttx/sensors/st_lis331dl.h> +#include <nuttx/sensors/lis331dl.h> /************************************************************************************ * LIS331DL Internal Registers @@ -89,11 +89,11 @@ * Private Data Types ************************************************************************************/ -struct st_lis331dl_dev_s { +struct lis331dl_dev_s { struct i2c_dev_s * i2c; uint8_t address; - struct st_lis331dl_vector_s a; + struct lis331dl_vector_s a; uint8_t cr1; uint8_t cr2; uint8_t cr3; @@ -112,7 +112,7 @@ struct st_lis331dl_dev_s { * \param length when >0 it denotes read access, when <0 it denotes write access of -length * \return OK on success or errno is set. **/ -int st_lis331dl_access(struct st_lis331dl_dev_s * dev, uint8_t subaddr, uint8_t *buf, int length) +int lis331dl_access(struct lis331dl_dev_s * dev, uint8_t subaddr, uint8_t *buf, int length) { uint16_t flags = 0; int retval; @@ -170,9 +170,9 @@ int st_lis331dl_access(struct st_lis331dl_dev_s * dev, uint8_t subaddr, uint8_t } -int st_lis331dl_readregs(struct st_lis331dl_dev_s * dev) +int lis331dl_readregs(struct lis331dl_dev_s * dev) { - if (st_lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, 3) != 3) return ERROR; + if (lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, 3) != 3) return ERROR; return OK; } @@ -181,24 +181,24 @@ int st_lis331dl_readregs(struct st_lis331dl_dev_s * dev) * Public Functions ****************************************************************************/ -struct st_lis331dl_dev_s * st_lis331dl_init(struct i2c_dev_s * i2c, uint16_t address) +struct lis331dl_dev_s * lis331dl_init(struct i2c_dev_s * i2c, uint16_t address) { - struct st_lis331dl_dev_s * dev; + struct lis331dl_dev_s * dev; uint8_t retval; ASSERT(i2c); ASSERT(address); - if ( (dev = kmalloc( sizeof(struct st_lis331dl_dev_s) )) == NULL ) + if ( (dev = kmalloc( sizeof(struct lis331dl_dev_s) )) == NULL ) return NULL; - memset(dev, 0, sizeof(struct st_lis331dl_dev_s)); + memset(dev, 0, sizeof(struct lis331dl_dev_s)); dev->i2c = i2c; dev->address = address; /* Probe device */ - if (st_lis331dl_access(dev, ST_LIS331DL_WHOAMI, &retval, 1) > 0) { + if (lis331dl_access(dev, ST_LIS331DL_WHOAMI, &retval, 1) > 0) { /* Check chip identification, in the future several more compatible parts * may be added here. @@ -208,7 +208,7 @@ struct st_lis331dl_dev_s * st_lis331dl_init(struct i2c_dev_s * i2c, uint16_t add /* Copy LIS331DL registers to our private structure and power-up device */ - if (st_lis331dl_readregs(dev)==OK && st_lis331dl_powerup(dev)==OK) { + if (lis331dl_readregs(dev)==OK && lis331dl_powerup(dev)==OK) { /* Normal exit point */ errno = 0; @@ -232,52 +232,52 @@ struct st_lis331dl_dev_s * st_lis331dl_init(struct i2c_dev_s * i2c, uint16_t add } -int st_lis331dl_deinit(struct st_lis331dl_dev_s * dev) +int lis331dl_deinit(struct lis331dl_dev_s * dev) { ASSERT(dev); - st_lis331dl_powerdown(dev); + lis331dl_powerdown(dev); kfree(dev); return OK; } -int st_lis331dl_powerup(struct st_lis331dl_dev_s * dev) +int lis331dl_powerup(struct lis331dl_dev_s * dev) { dev->cr1 = ST_LIS331DL_CR1_PD | ST_LIS331DL_CR1_ZEN | ST_LIS331DL_CR1_YEN | ST_LIS331DL_CR1_XEN; dev->cr2 = 0; dev->cr3 = 0; - if (st_lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -3) == 3) return OK; + if (lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -3) == 3) return OK; return ERROR; } -int st_lis331dl_powerdown(struct st_lis331dl_dev_s * dev) +int lis331dl_powerdown(struct lis331dl_dev_s * dev) { dev->cr1 = ST_LIS331DL_CR1_ZEN | ST_LIS331DL_CR1_YEN | ST_LIS331DL_CR1_XEN; dev->cr2 = 0; dev->cr3 = 0; - if (st_lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -3) == 3) return OK; + if (lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -3) == 3) return OK; return ERROR; } -int st_lis331dl_setconversion(struct st_lis331dl_dev_s * dev, bool full, bool fast) +int lis331dl_setconversion(struct lis331dl_dev_s * dev, bool full, bool fast) { dev->cr1 = ST_LIS331DL_CR1_PD | (full ? ST_LIS331DL_CR1_FS : 0) | (fast ? ST_LIS331DL_CR1_DR : 0) | ST_LIS331DL_CR1_ZEN | ST_LIS331DL_CR1_YEN | ST_LIS331DL_CR1_XEN; - if (st_lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -1) == 1) return OK; + if (lis331dl_access(dev, ST_LIS331DL_CTRL_REG1, &dev->cr1, -1) == 1) return OK; return ERROR; } -int st_lis331dl_getprecision(struct st_lis331dl_dev_s * dev) +int lis331dl_getprecision(struct lis331dl_dev_s * dev) { if (dev->cr1 & ST_LIS331DL_CR1_FS) return 9200/127; /* typ. 9.2g full scale */ @@ -285,7 +285,7 @@ int st_lis331dl_getprecision(struct st_lis331dl_dev_s * dev) } -int st_lis331dl_getsamplerate(struct st_lis331dl_dev_s * dev) +int lis331dl_getsamplerate(struct lis331dl_dev_s * dev) { if (dev->cr1 & ST_LIS331DL_CR1_DR) return 400; @@ -293,13 +293,13 @@ int st_lis331dl_getsamplerate(struct st_lis331dl_dev_s * dev) } -const struct st_lis331dl_vector_s * st_lis331dl_getreadings(struct st_lis331dl_dev_s * dev) +const struct lis331dl_vector_s * lis331dl_getreadings(struct lis331dl_dev_s * dev) { uint8_t retval[7]; ASSERT(dev); - if (st_lis331dl_access(dev, ST_LIS331DL_STATUS_REG, retval, 7) == 7) { + if (lis331dl_access(dev, ST_LIS331DL_STATUS_REG, retval, 7) == 7) { /* If result is not yet ready, return NULL */ diff --git a/nuttx/drivers/wireless/Make.defs b/nuttx/drivers/wireless/Make.defs index 93d062d2b..0e1aae550 100644 --- a/nuttx/drivers/wireless/Make.defs +++ b/nuttx/drivers/wireless/Make.defs @@ -37,5 +37,5 @@ WIRELESS_ASRCS = WIRELESS_CSRCS = ifeq ($(CONFIG_WIRELESS),y) -WIRELESS_CSRCS += chipcon_cc1101.c +WIRELESS_CSRCS += cc1101.c endif diff --git a/nuttx/drivers/wireless/chipcon_cc1101.c b/nuttx/drivers/wireless/cc1101.c index 1f5a2015a..0d8c003c6 100755 --- a/nuttx/drivers/wireless/chipcon_cc1101.c +++ b/nuttx/drivers/wireless/cc1101.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/wireless/chipcon_cc1101.c + * drivers/wireless/cc1101.c * * Copyright (C) 2011 Uros Platise. All rights reserved. * @@ -49,7 +49,7 @@ #include <stdio.h> #include <nuttx/kmalloc.h> -#include <nuttx/wireless/chipcon_cc1101.h> +#include <nuttx/wireless/cc1101.h> /************************************************************************************ @@ -351,7 +351,7 @@ * Private Data Types ************************************************************************************/ -struct chipcon_c1101_rfsettings_s { +struct c1101_rfsettings_s { uint8_t FSCTRL1; /* Frequency synthesizer control. */ uint8_t IOCFG0; /* GDO0 output pin configuration */ uint8_t FSCTRL0; /* Frequency synthesizer control. */ @@ -389,9 +389,9 @@ struct chipcon_c1101_rfsettings_s { uint8_t PKTLEN; /* Packet length. */ }; -struct chipcon_cc1101_dev_s { +struct cc1101_dev_s { struct spi_dev_s * spi; - struct chipcon_c1101_rfsettings_s * settings; + struct c1101_rfsettings_s * settings; }; @@ -408,7 +408,7 @@ struct chipcon_cc1101_dev_s { * \param length when >0 it denotes read access, when <0 it denotes write access of -length * \return OK on success or errno is set. **/ -int chipcon_cc1101_access(struct chipcon_cc1101_dev_s * dev, uint8_t subaddr, uint8_t *buf, int length) +int cc1101_access(struct cc1101_dev_s * dev, uint8_t subaddr, uint8_t *buf, int length) { return 0; } @@ -427,7 +427,7 @@ int chipcon_cc1101_access(struct chipcon_cc1101_dev_s * dev, uint8_t subaddr, ui * its callback, and it is up to peripheral to find, whether the cause * of EXTI ISR was itself. **/ -void chipcon_cc1101_eventcb(void) +void cc1101_eventcb(void) { } @@ -436,7 +436,7 @@ void chipcon_cc1101_eventcb(void) * Public Functions ****************************************************************************/ -struct chipcon_cc1101_dev_s * chipcon_cc1101_init(struct spi_dev_s * spi) +struct cc1101_dev_s * cc1101_init(struct spi_dev_s * spi) { /* Powerup or wake-up, if it was previously set into some power-down state */ @@ -452,7 +452,7 @@ struct chipcon_cc1101_dev_s * chipcon_cc1101_init(struct spi_dev_s * spi) } -int chipcon_cc1101_deinit(struct chipcon_cc1101_dev_s * dev) +int cc1101_deinit(struct cc1101_dev_s * dev) { /* Power down chip, possibly in some inactive state */ @@ -460,55 +460,55 @@ int chipcon_cc1101_deinit(struct chipcon_cc1101_dev_s * dev) } -int chipcon_cc1101_setgdo(struct chipcon_cc1101_dev_s * dev, uint8_t pin, uint8_t function) +int cc1101_setgdo(struct cc1101_dev_s * dev, uint8_t pin, uint8_t function) { return 0; } -int chipcon_cc1101_setrf(struct chipcon_cc1101_dev_s * dev, uint32_t frequency, int modulation) +int cc1101_setrf(struct cc1101_dev_s * dev, uint32_t frequency, int modulation) { return 0; } -int chipcon_cc1101_read(struct chipcon_cc1101_dev_s * dev, uint8_t * data, size_t size) +int cc1101_read(struct cc1101_dev_s * dev, uint8_t * data, size_t size) { return 0; } -int chipcon_cc1101_write(struct chipcon_cc1101_dev_s * dev, const uint8_t * data, size_t size) +int cc1101_write(struct cc1101_dev_s * dev, const uint8_t * data, size_t size) { return 0; } -int chipcon_cc1101_listen(struct chipcon_cc1101_dev_s * dev) +int cc1101_listen(struct cc1101_dev_s * dev) { return 0; } -int chipcon_cc1101_send(struct chipcon_cc1101_dev_s * dev) +int cc1101_send(struct cc1101_dev_s * dev) { return 0; } -int chipcon_cc1101_idle(struct chipcon_cc1101_dev_s * dev) +int cc1101_idle(struct cc1101_dev_s * dev) { return 0; } -int chipcon_cc1101_powerup(struct chipcon_cc1101_dev_s * dev) +int cc1101_powerup(struct cc1101_dev_s * dev) { return 0; } -int chipcon_cc1101_powerdown(struct chipcon_cc1101_dev_s * dev) +int cc1101_powerdown(struct cc1101_dev_s * dev) { return 0; } |