Standardize the width of all comment boxes in C files

This commit is contained in:
Gregory Nutt
2015-10-03 07:25:03 -06:00
parent cae0c9a2e3
commit 7ced84c5f0
53 changed files with 3060 additions and 3060 deletions
+14 -14
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* arch/arm/src/armv7-m/up_itm.c
*
* Copyright (c) 2009 - 2013 ARM LIMITED
@@ -59,11 +59,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -72,15 +72,15 @@
#include "up_arch.h"
#include "itm.h"
/*****************************************************************************
/****************************************************************************
* Public Data
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: itm_sendchar
*
* Description:
@@ -95,7 +95,7 @@
* Returned Value:
* Character to transmit.
*
*****************************************************************************/
****************************************************************************/
uint32_t itm_sendchar(uint32_t ch)
{
@@ -109,7 +109,7 @@ uint32_t itm_sendchar(uint32_t ch)
return ch;
}
/*****************************************************************************
/****************************************************************************
* Name: itm_receivechar
*
* Description:
@@ -120,7 +120,7 @@ uint32_t itm_sendchar(uint32_t ch)
* Returned Value:
* Received character or -1 No character pending.
*
*****************************************************************************/
****************************************************************************/
int32_t itm_receivechar(void)
{
@@ -135,7 +135,7 @@ int32_t itm_receivechar(void)
return ch;
}
/*****************************************************************************
/****************************************************************************
* Name: itm_checkchar
*
* Description:
@@ -148,7 +148,7 @@ int32_t itm_receivechar(void)
* 0 No character available.
* 1 Character available.
*
*****************************************************************************/
****************************************************************************/
int32_t itm_checkchar (void)
{
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -230,7 +230,7 @@ static void adc_putreg(struct efm32_dev_s *priv, int offset, uint32_t value)
* ref - Reference to load calibrated values for. No values are loaded for
* external references.
*
******************************************************************************/
****************************************************************************/
static void ADC_CalibrateLoadScan(ADC_TypeDef *adc, ADC_Ref_TypeDef ref)
{
@@ -314,7 +314,7 @@ static void ADC_CalibrateLoadScan(ADC_TypeDef *adc, ADC_Ref_TypeDef ref)
* ref - Reference to load calibrated values for. No values are loaded for
* external references.
*
******************************************************************************/
****************************************************************************/
static void ADC_CalibrateLoadSingle(ADC_TypeDef *adc, ADC_Ref_TypeDef ref)
{
@@ -381,9 +381,9 @@ static void ADC_CalibrateLoadSingle(ADC_TypeDef *adc, ADC_Ref_TypeDef ref)
}
}
/*******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/***************************************************************************//**
* Name: ADC_Init
@@ -400,7 +400,7 @@ static void ADC_CalibrateLoadSingle(ADC_TypeDef *adc, ADC_Ref_TypeDef ref)
* adc- Pointer to ADC peripheral register block.
* int - Pointer to ADC initialization structure.
*
******************************************************************************/
****************************************************************************/
void ADC_Init(ADC_TypeDef *adc, const ADC_Init_TypeDef *init)
{
@@ -444,7 +444,7 @@ void ADC_Init(ADC_TypeDef *adc, const ADC_Init_TypeDef *init)
* adc - Pointer to ADC peripheral register block.
* init - Pointer to ADC initialization structure.
*
******************************************************************************/
****************************************************************************/
void ADC_InitScan(ADC_TypeDef *adc, const ADC_InitScan_TypeDef *init)
{
@@ -507,7 +507,7 @@ void ADC_InitScan(ADC_TypeDef *adc, const ADC_InitScan_TypeDef *init)
* adc - Pointer to ADC peripheral register block.
* init - Pointer to ADC initialization structure.
*
******************************************************************************/
****************************************************************************/
void ADC_InitSingle(ADC_TypeDef *adc, const ADC_InitSingle_TypeDef *init)
{
@@ -570,7 +570,7 @@ void ADC_InitSingle(ADC_TypeDef *adc, const ADC_InitSingle_TypeDef *init)
* Prescaler value to use for ADC in order to achieve a clock value
* <= @p adcFreq.
*
******************************************************************************/
****************************************************************************/
uint8_t ADC_PrescaleCalc(uint32_t adcFreq, uint32_t hfperFreq)
{
@@ -616,7 +616,7 @@ uint8_t ADC_PrescaleCalc(uint32_t adcFreq, uint32_t hfperFreq)
* Input Parameters:
* adc - Pointer to ADC peripheral register block.
*
******************************************************************************/
****************************************************************************/
void ADC_Reset(ADC_TypeDef *adc)
{
@@ -651,7 +651,7 @@ void ADC_Reset(ADC_TypeDef *adc)
* Returned Value:
* Timebase value to use for ADC in order to achieve at least 1 us.
*
******************************************************************************/
****************************************************************************/
uint8_t ADC_TimebaseCalc(uint32_t hfperFreq)
{
@@ -837,7 +837,7 @@ static void adc_hw_reset(struct efm32_dev_s *priv, bool reset)
irqrestore(flags);
}
/*******************************************************************************
/****************************************************************************
* Name: adc_enable
*
* Description : Enables or disables the specified ADC peripheral.
@@ -851,7 +851,7 @@ static void adc_hw_reset(struct efm32_dev_s *priv, bool reset)
*
* Returned Value:
*
*******************************************************************************/
****************************************************************************/
static void adc_enable(FAR struct efm32_dev_s *priv, bool enable)
{
+8 -8
View File
@@ -73,7 +73,7 @@
* Private Functions
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Name: bitband_set_peripheral
*
* Description:
@@ -91,7 +91,7 @@
* bit Bit position to modify, 0-31.
* val Value to set bit to, 0 or 1.
*
******************************************************************************/
****************************************************************************/
inline void bitband_set_peripheral(uint32_t addr, uint32_t bit, uint32_t val)
{
@@ -101,7 +101,7 @@ inline void bitband_set_peripheral(uint32_t addr, uint32_t bit, uint32_t val)
*((volatile uint32_t *)regval) = (uint32_t)val;
}
/******************************************************************************
/****************************************************************************
* Name: bitband_get_peripheral
*
* Description:
@@ -122,7 +122,7 @@ inline void bitband_set_peripheral(uint32_t addr, uint32_t bit, uint32_t val)
* Returned Value:
* Return bit value read, 0 or 1.
*
******************************************************************************/
****************************************************************************/
inline uint32_t bitband_get_peripheral(uint32_t addr, uint32_t bit)
{
@@ -132,7 +132,7 @@ inline uint32_t bitband_get_peripheral(uint32_t addr, uint32_t bit)
return *((volatile uint32_t *)regval);
}
/******************************************************************************
/****************************************************************************
* Name: bitband_set_sram
*
* Description:
@@ -150,7 +150,7 @@ inline uint32_t bitband_get_peripheral(uint32_t addr, uint32_t bit)
* bit Bit position to modify, 0-31.
* val Value to set bit to, 0 or 1.
*
******************************************************************************/
****************************************************************************/
inline void bitband_set_sram(uint32_t addr, uint32_t bit, uint32_t val)
{
@@ -160,7 +160,7 @@ inline void bitband_set_sram(uint32_t addr, uint32_t bit, uint32_t val)
*((volatile uint32_t *)regval) = (uint32_t)val;
}
/******************************************************************************
/****************************************************************************
* Name: bitband_get_sram
*
* Description::
@@ -181,7 +181,7 @@ inline void bitband_set_sram(uint32_t addr, uint32_t bit, uint32_t val)
* Returned Value:
* Return bit value read, 0 or 1.
*
******************************************************************************/
****************************************************************************/
inline uint32_t bitband_get_sram(uint32_t addr, uint32_t bit)
{
+16 -16
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* arch/arm/src/efm32/efm32_dma.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -53,17 +53,17 @@
#include "chip/efm32_dma.h"
#include "efm32_dma.h"
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#define ALIGN_MASK(s) ((1 << s) - 1)
#define ALIGN_DOWN(v,m) ((v) & ~m)
#define ALIGN_UP(v,m) (((v) + (m)) & ~m)
/*****************************************************************************
/****************************************************************************
* Public Types
*****************************************************************************/
****************************************************************************/
/* This structure describes one DMA channel */
struct dma_channel_s
@@ -83,9 +83,9 @@ struct dma_controller_s
sem_t chansem; /* Count of free channels */
};
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
/* This is the overall state of the DMA controller */
@@ -130,13 +130,13 @@ static struct dma_descriptor_s g_descriptors[EFM32_DMA_NCHANNELS]
__attribute__((aligned(DESC_TABLE_ALIGN)));
#endif
/*****************************************************************************
/****************************************************************************
* Public Data
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: efm32_set_chctrl
@@ -249,9 +249,9 @@ static int efm32_dmac_interrupt(int irq, void *context)
return OK;
}
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: up_dmainitialize
+5 -5
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* arch/arm/src/efm32/efm32_flash.c
*
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com
@@ -183,7 +183,7 @@ void efm32_flash_unlock(void)
#endif
}
/*******************************************************************************
/****************************************************************************
* Name: msc_load_verify_address
*
* Description:
@@ -206,7 +206,7 @@ void efm32_flash_unlock(void)
* -EBUSY - Busy timeout.
* -EINVAL - Operation tried to access a non-flash area.
* -EACCES - Operation tried to access a locked area of the flash.
*******************************************************************************/
****************************************************************************/
int __ramfunc__ msc_load_verify_address(uint32_t* address)
{
@@ -251,7 +251,7 @@ int __ramfunc__ msc_load_verify_address(uint32_t* address)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name:msc_load_data
*
* Description:
@@ -276,7 +276,7 @@ int __ramfunc__ msc_load_verify_address(uint32_t* address)
* OK - Operation completed successfully.
* -ETIMEDOUT - Operation timed out waiting for flash operation
* to complete.
******************************************************************************/
****************************************************************************/
int __ramfunc__ msc_load_write_data(uint32_t* data, uint32_t num_words,
bool write_strategy_safe)
+73 -73
View File
@@ -32,7 +32,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
****************************************************************************/
/* Supports:
* - Master operation, 100 kHz (standard) and 400 kHz (full speed)
@@ -51,9 +51,9 @@
*
*/
/*******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -84,9 +84,9 @@
#if defined(CONFIG_EFM32_I2C0) || defined(CONFIG_EFM32_I2C1)
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
/* Configuration **************************************************************/
@@ -281,9 +281,9 @@ struct efm32_i2c_inst_s
uint32_t flags; /* Flags used in this instantiation */
};
/*******************************************************************************
/****************************************************************************
* Private Function Prototypes
******************************************************************************/
****************************************************************************/
static inline uint32_t efm32_i2c_getreg(FAR struct efm32_i2c_priv_s *priv,
uint8_t offset);
@@ -351,9 +351,9 @@ static int efm32_i2c_transfer(FAR struct i2c_dev_s *dev,
static const char *efm32_i2c_state_str(int i2c_state);
#endif
/*******************************************************************************
/****************************************************************************
* Private Data
******************************************************************************/
****************************************************************************/
/* Trace events strings */
@@ -433,17 +433,17 @@ static const struct i2c_ops_s efm32_i2c_ops =
#endif
};
/*******************************************************************************
/****************************************************************************
* Private Functions
******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_getreg
*
* Description:
* Get a 16-bit register value by offset
*
******************************************************************************/
****************************************************************************/
static inline uint32_t efm32_i2c_getreg(FAR struct efm32_i2c_priv_s *priv,
uint8_t offset)
@@ -451,13 +451,13 @@ static inline uint32_t efm32_i2c_getreg(FAR struct efm32_i2c_priv_s *priv,
return getreg32(priv->config->base + offset);
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_putreg
*
* Description:
* Put a 16-bit register value by offset
*
******************************************************************************/
****************************************************************************/
static inline void efm32_i2c_putreg(FAR struct efm32_i2c_priv_s *priv,
uint8_t offset, uint32_t value)
@@ -465,13 +465,13 @@ static inline void efm32_i2c_putreg(FAR struct efm32_i2c_priv_s *priv,
putreg32(value, priv->config->base + offset);
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_modifyreg
*
* Description:
* Modify a 16-bit register value by offset
*
******************************************************************************/
****************************************************************************/
static inline void efm32_i2c_modifyreg(FAR struct efm32_i2c_priv_s *priv,
uint8_t offset, uint32_t clearbits,
@@ -480,13 +480,13 @@ static inline void efm32_i2c_modifyreg(FAR struct efm32_i2c_priv_s *priv,
modifyreg32(priv->config->base + offset, clearbits, setbits);
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_state_str
*
* Description:
* Convert i2c_state into corresponding text.
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_TRACE
static const char *efm32_i2c_state_str(int i2c_state)
@@ -521,13 +521,13 @@ static const char *efm32_i2c_state_str(int i2c_state)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_sem_wait
*
* Description:
* Take the exclusive access, waiting as necessary
*
******************************************************************************/
****************************************************************************/
static inline void efm32_i2c_sem_wait(FAR struct i2c_dev_s *dev)
{
@@ -537,14 +537,14 @@ static inline void efm32_i2c_sem_wait(FAR struct i2c_dev_s *dev)
}
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_tousecs
*
* Description:
* Return a micro-second delay based on the number of bytes left to be
* processed.
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_EFM32_I2C_DYNTIMEO
static useconds_t efm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
@@ -566,13 +566,13 @@ static useconds_t efm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_sem_waitdone
*
* Description:
* Wait for a transfer to complete
*
******************************************************************************/
****************************************************************************/
#ifndef CONFIG_I2C_POLLED
static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
@@ -701,26 +701,26 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_sem_post
*
* Description:
* Release the mutual exclusion semaphore
*
******************************************************************************/
****************************************************************************/
static inline void efm32_i2c_sem_post(FAR struct i2c_dev_s *dev)
{
sem_post(&((struct efm32_i2c_inst_s *)dev)->priv->sem_excl);
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_sem_init
*
* Description:
* Initialize semaphores
*
******************************************************************************/
****************************************************************************/
static inline void efm32_i2c_sem_init(FAR struct i2c_dev_s *dev)
{
@@ -730,13 +730,13 @@ static inline void efm32_i2c_sem_init(FAR struct i2c_dev_s *dev)
#endif
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_sem_destroy
*
* Description:
* Destroy semaphores.
*
******************************************************************************/
****************************************************************************/
static inline void efm32_i2c_sem_destroy(FAR struct i2c_dev_s *dev)
{
@@ -746,13 +746,13 @@ static inline void efm32_i2c_sem_destroy(FAR struct i2c_dev_s *dev)
#endif
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_trace*
*
* Description:
* I2C trace instrumentation
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_TRACE
static void efm32_i2c_traceclear(FAR struct efm32_i2c_priv_s *priv)
@@ -841,13 +841,13 @@ static void efm32_i2c_tracedump(FAR struct efm32_i2c_priv_s *priv)
}
#endif /* CONFIG_I2C_TRACE */
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_setclock
*
* Description:
* Set the I2C clock
*
******************************************************************************/
****************************************************************************/
static void efm32_i2c_setclock(FAR struct efm32_i2c_priv_s *priv,
uint32_t frequency)
@@ -893,13 +893,13 @@ static void efm32_i2c_setclock(FAR struct efm32_i2c_priv_s *priv,
efm32_i2c_putreg(priv, EFM32_I2C_CLKDIV_OFFSET, div);
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_isr
*
* Description:
* Common Interrupt Service Routine
*
******************************************************************************/
****************************************************************************/
static int efm32_i2c_isr(struct efm32_i2c_priv_s *priv)
{
@@ -1307,13 +1307,13 @@ done:
#ifndef CONFIG_I2C_POLLED
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c0_isr
*
* Description:
* I2C0 interrupt service routine
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_EFM32_I2C0
static int efm32_i2c0_isr(int irq, void *context)
@@ -1322,13 +1322,13 @@ static int efm32_i2c0_isr(int irq, void *context)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c1_isr
*
* Description:
* I2C1 interrupt service routine
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_EFM32_I2C1
static int efm32_i2c1_isr(int irq, void *context)
@@ -1339,17 +1339,17 @@ static int efm32_i2c1_isr(int irq, void *context)
#endif
/*******************************************************************************
/****************************************************************************
* Private Initialization and Deinitialization
******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_reset
*
* Description:
* Reset I2C to same state as after a HW reset.
*
******************************************************************************/
****************************************************************************/
static void efm32_i2c_reset(FAR struct efm32_i2c_priv_s *priv)
{
@@ -1363,14 +1363,14 @@ static void efm32_i2c_reset(FAR struct efm32_i2c_priv_s *priv)
/* Do not reset route register, setting should be done independently */
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_init
*
* Description:
* Setup the I2C hardware, ready for operation with defaults
* Prepare and start an I2C transfer (single master mode only).
*
******************************************************************************/
****************************************************************************/
static int efm32_i2c_init(FAR struct efm32_i2c_priv_s *priv, int frequency)
{
@@ -1434,13 +1434,13 @@ static int efm32_i2c_init(FAR struct efm32_i2c_priv_s *priv, int frequency)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_deinit
*
* Description:
* Shutdown the I2C hardware
*
******************************************************************************/
****************************************************************************/
static int efm32_i2c_deinit(FAR struct efm32_i2c_priv_s *priv)
{
@@ -1466,17 +1466,17 @@ static int efm32_i2c_deinit(FAR struct efm32_i2c_priv_s *priv)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Device Driver Operations
******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_setfrequency
*
* Description:
* Set the I2C frequency
*
******************************************************************************/
****************************************************************************/
static uint32_t efm32_i2c_setfrequency(FAR struct i2c_dev_s *dev,
uint32_t frequency)
@@ -1489,13 +1489,13 @@ static uint32_t efm32_i2c_setfrequency(FAR struct i2c_dev_s *dev,
return frequency;
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_setaddress
*
* Description:
* Set the I2C slave address
*
******************************************************************************/
****************************************************************************/
static int efm32_i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
{
@@ -1508,13 +1508,13 @@ static int efm32_i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_process
*
* Description:
* Common I2C transfer logic
*
******************************************************************************/
****************************************************************************/
static int efm32_i2c_process(FAR struct i2c_dev_s *dev,
FAR struct i2c_msg_s *msgs, int count)
@@ -1660,13 +1660,13 @@ static int efm32_i2c_process(FAR struct i2c_dev_s *dev,
return -errval;
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_write
*
* Description:
* Write I2C data
*
******************************************************************************/
****************************************************************************/
static int efm32_i2c_write(FAR struct i2c_dev_s *dev, const uint8_t * buffer,
int buflen)
@@ -1682,13 +1682,13 @@ static int efm32_i2c_write(FAR struct i2c_dev_s *dev, const uint8_t * buffer,
return efm32_i2c_process(dev, &msgv, 1);
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_read
*
* Description:
* Read I2C data
*
******************************************************************************/
****************************************************************************/
int efm32_i2c_read(FAR struct i2c_dev_s *dev, uint8_t * buffer, int buflen)
{
@@ -1703,13 +1703,13 @@ int efm32_i2c_read(FAR struct i2c_dev_s *dev, uint8_t * buffer, int buflen)
return efm32_i2c_process(dev, &msgv, 1);
}
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_writeread
*
* Description:
* Read then write I2C data
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_WRITEREAD
static int efm32_i2c_writeread(FAR struct i2c_dev_s *dev,
@@ -1735,13 +1735,13 @@ static int efm32_i2c_writeread(FAR struct i2c_dev_s *dev,
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: efm32_i2c_transfer
*
* Description:
* Generic I2C transfer function
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int efm32_i2c_transfer(FAR struct i2c_dev_s *dev,
@@ -1751,17 +1751,17 @@ static int efm32_i2c_transfer(FAR struct i2c_dev_s *dev,
}
#endif
/*******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: up_i2cinitialize
*
* Description:
* Initialize one I2C bus
*
******************************************************************************/
****************************************************************************/
FAR struct i2c_dev_s *up_i2cinitialize(int port)
{
@@ -1821,13 +1821,13 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
return (struct i2c_dev_s *)inst;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2cuninitialize
*
* Description:
* Uninitialize an I2C bus
*
******************************************************************************/
****************************************************************************/
int up_i2cuninitialize(FAR struct i2c_dev_s *dev)
{
@@ -1865,13 +1865,13 @@ int up_i2cuninitialize(FAR struct i2c_dev_s *dev)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2creset
*
* Description:
* Reset an I2C bus
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_RESET
int up_i2creset(FAR struct i2c_dev_s *dev)
+10 -10
View File
@@ -488,13 +488,13 @@ void efm32_lowsetup(void)
#endif
}
/*****************************************************************************
/****************************************************************************
* Name: efm32_lowputc
*
* Description:
* Output one character to the UART using a simple polling method.
*
*****************************************************************************/
****************************************************************************/
#if defined(HAVE_UART_CONSOLE)
void efm32_lowputc(uint32_t ch)
@@ -527,13 +527,13 @@ void efm32_lowputc(uint32_t ch)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: efm32_uartconfigure
*
* Description:
* Configure a U[S]ART as a RS-232 UART.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_UART_DEVICE
void efm32_uartconfigure(uintptr_t base, uint32_t baud, unsigned int parity,
@@ -646,13 +646,13 @@ void efm32_uartconfigure(uintptr_t base, uint32_t baud, unsigned int parity,
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: efm32_leuartconfigure
*
* Description:
* Configure a LEUART as a RS-232 UART.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_LEUART_DEVICE
void efm32_leuartconfigure(uintptr_t base, uint32_t baud, unsigned int parity,
@@ -722,7 +722,7 @@ void efm32_leuartconfigure(uintptr_t base, uint32_t baud, unsigned int parity,
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: efm32_uart_reset
*
* Description:
@@ -730,7 +730,7 @@ void efm32_leuartconfigure(uintptr_t base, uint32_t baud, unsigned int parity,
* to the initial, reset value. Only the ROUTE data set by efm32_lowsetup
* is preserved.
*
*****************************************************************************/
****************************************************************************/
#if defined(HAVE_UART_DEVICE) || defined(HAVE_SPI_DEVICE)
void efm32_uart_reset(uintptr_t base)
@@ -755,7 +755,7 @@ void efm32_uart_reset(uintptr_t base)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: efm32_leuart_reset
*
* Description:
@@ -763,7 +763,7 @@ void efm32_uart_reset(uintptr_t base)
* to the initial, reset value. Only the ROUTE data set by efm32_lowsetup
* is preserved.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_LEUART_DEVICE
void efm32_leuart_reset(uintptr_t base)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -268,13 +268,13 @@ void kinetis_lowsetup(void)
#endif /* HAVE_UART_DEVICE */
}
/******************************************************************************
/****************************************************************************
* Name: kinetis_uartreset
*
* Description:
* Reset a UART.
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_UART_DEVICE
void kinetis_uartreset(uintptr_t uart_base)
@@ -289,13 +289,13 @@ void kinetis_uartreset(uintptr_t uart_base)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: kinetis_uartconfigure
*
* Description:
* Configure a UART as a RS-232 UART.
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_UART_DEVICE
void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud,
+4 -4
View File
@@ -222,13 +222,13 @@ void kl_lowsetup(void)
#endif
}
/******************************************************************************
/****************************************************************************
* Name: kl_uartreset
*
* Description:
* Reset a UART.
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_UART_DEVICE
void kl_uartreset(uintptr_t uart_base)
@@ -243,13 +243,13 @@ void kl_uartreset(uintptr_t uart_base)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: kl_uartconfigure
*
* Description:
* Configure a UART as a RS-232 UART.
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_UART_DEVICE
void kl_uartconfigure(uintptr_t uart_base, uint32_t baud, uint32_t clock,
+34 -34
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* arch/arm/src/lpc11xx/lpc11_i2c.c
*
* Copyright (C) 2011 Li Zhuoyi. All rights reserved.
@@ -39,11 +39,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -72,9 +72,9 @@
#if defined(CONFIG_LPC11_I2C0) || defined(CONFIG_LPC11_I2C1) || defined(CONFIG_LPC11_I2C2)
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
*******************************************************************************/
****************************************************************************/
#ifndef GPIO_I2C1_SCL
# define GPIO_I2C1_SCL GPIO_I2C1_SCL_1
@@ -95,9 +95,9 @@
#define I2C_TIMEOUT ((20 * CLK_TCK) / 1000) /* 20 mS */
/*******************************************************************************
/****************************************************************************
* Private Types
*******************************************************************************/
****************************************************************************/
struct lpc11_i2cdev_s
{
@@ -115,9 +115,9 @@ struct lpc11_i2cdev_s
uint16_t rdcnt; /* number of bytes read from rx fifo */
};
/*******************************************************************************
/****************************************************************************
* Private Function Prototypes
*******************************************************************************/
****************************************************************************/
static int i2c_start(struct lpc11_i2cdev_s *priv);
static void i2c_stop(struct lpc11_i2cdev_s *priv);
@@ -132,9 +132,9 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int
static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen);
static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, int count);
/*******************************************************************************
/****************************************************************************
* Private Data
*******************************************************************************/
****************************************************************************/
static struct lpc11_i2cdev_s i2cdevices[3];
@@ -149,13 +149,13 @@ struct i2c_ops_s lpc11_i2c_ops =
#endif
};
/*******************************************************************************
/****************************************************************************
* Name: lpc11_i2c_setfrequency
*
* Description:
* Set the frequency for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{
@@ -185,13 +185,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
return frequency;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc11_i2c_setaddress
*
* Description:
* Set the I2C slave address for a subsequent read/write
*
*******************************************************************************/
****************************************************************************/
static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
{
@@ -206,14 +206,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc11_i2c_write
*
* Description:
* Send a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer,
int buflen)
@@ -234,14 +234,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer,
return ret > 0 ? OK : -ETIMEDOUT;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc11_i2c_read
*
* Description:
* Receive a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
{
@@ -261,13 +261,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
return ret > 0 ? OK : -ETIMEDOUT;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_start
*
* Description:
* Perform a I2C transfer start
*
*******************************************************************************/
****************************************************************************/
static int i2c_start(struct lpc11_i2cdev_s *priv)
{
@@ -295,13 +295,13 @@ static int i2c_start(struct lpc11_i2cdev_s *priv)
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_stop
*
* Description:
* Perform a I2C transfer stop
*
*******************************************************************************/
****************************************************************************/
static void i2c_stop(struct lpc11_i2cdev_s *priv)
{
@@ -313,13 +313,13 @@ static void i2c_stop(struct lpc11_i2cdev_s *priv)
sem_post(&priv->wait);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_timeout
*
* Description:
* Watchdog timer for timeout of I2C operation
*
*******************************************************************************/
****************************************************************************/
static void i2c_timeout(int argc, uint32_t arg, ...)
{
@@ -331,13 +331,13 @@ static void i2c_timeout(int argc, uint32_t arg, ...)
irqrestore(flags);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_interrupt
*
* Description:
* The I2C Interrupt Handler
*
*******************************************************************************/
****************************************************************************/
static int i2c_interrupt(int irq, FAR void *context)
{
@@ -439,17 +439,17 @@ static int i2c_interrupt(int irq, FAR void *context)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Public Functions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: up_i2cinitialize
*
* Description:
* Initialise an I2C device
*
*******************************************************************************/
****************************************************************************/
struct i2c_dev_s *up_i2cinitialize(int port)
{
@@ -569,13 +569,13 @@ struct i2c_dev_s *up_i2cinitialize(int port)
return &priv->dev;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2cuninitalize
*
* Description:
* Uninitialise an I2C device
*
*******************************************************************************/
****************************************************************************/
int up_i2cuninitialize(FAR struct i2c_dev_s * dev)
{
+12 -12
View File
@@ -448,13 +448,13 @@ static void lpc17_ethreset(struct lpc17_driver_s *priv);
* Private Functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: lpc17_printreg
*
* Description:
* Print the contents of an LPC17xx register operation
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_NET_REGDEBUG
static void lpc17_printreg(uint32_t addr, uint32_t val, bool iswrite)
@@ -463,13 +463,13 @@ static void lpc17_printreg(uint32_t addr, uint32_t val, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: lpc17_checkreg
*
* Description:
* Get the contents of an LPC17xx register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_NET_REGDEBUG
static void lpc17_checkreg(uint32_t addr, uint32_t val, bool iswrite)
@@ -527,13 +527,13 @@ static void lpc17_checkreg(uint32_t addr, uint32_t val, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: lpc17_getreg
*
* Description:
* Get the contents of an LPC17xx register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_NET_REGDEBUG
static uint32_t lpc17_getreg(uint32_t addr)
@@ -549,13 +549,13 @@ static uint32_t lpc17_getreg(uint32_t addr)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: lpc17_putreg
*
* Description:
* Set the contents of an LPC17xx register to a value
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_NET_REGDEBUG
static void lpc17_putreg(uint32_t val, uint32_t addr)
@@ -2315,7 +2315,7 @@ static int lpc17_rmmac(struct net_driver_s *dev, const uint8_t *mac)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: lpc17_showpins
*
* Description:
@@ -2329,7 +2329,7 @@ static int lpc17_rmmac(struct net_driver_s *dev, const uint8_t *mac)
*
* Assumptions:
*
*******************************************************************************/
****************************************************************************/
#if defined(CONFIG_NET_REGDEBUG) && defined(CONFIG_DEBUG_GPIO)
static void lpc17_showpins(void)
@@ -2339,7 +2339,7 @@ static void lpc17_showpins(void)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: lpc17_showmii
*
* Description:
@@ -2353,7 +2353,7 @@ static void lpc17_showpins(void)
*
* Assumptions:
*
*******************************************************************************/
****************************************************************************/
#if defined(CONFIG_NET_REGDEBUG) && defined(LPC17_HAVE_PHY)
static void lpc17_showmii(uint8_t phyaddr, const char *msg)
+36 -36
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* arch/arm/src/lpc17xx/lpc17_i2c.c
*
* Copyright (C) 2011 Li Zhuoyi. All rights reserved.
@@ -39,11 +39,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -89,19 +89,19 @@
# define CONFIG_I2C2_FREQ 100000
#endif
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
*******************************************************************************/
****************************************************************************/
#define I2C_TIMEOUT ((20 * CLK_TCK) / 1000) /* 20 mS */
/*******************************************************************************
/****************************************************************************
* Private Data
*******************************************************************************/
****************************************************************************/
struct lpc17_i2cdev_s
{
@@ -121,18 +121,18 @@ struct lpc17_i2cdev_s
static struct lpc17_i2cdev_s i2cdevices[3];
/*******************************************************************************
/****************************************************************************
* Private Functions
*******************************************************************************/
****************************************************************************/
static int i2c_start(struct lpc17_i2cdev_s *priv);
static void i2c_stop(struct lpc17_i2cdev_s *priv);
static int i2c_interrupt(int irq, FAR void *context);
static void i2c_timeout(int argc, uint32_t arg, ...);
/*******************************************************************************
/****************************************************************************
* I2C device operations
*******************************************************************************/
****************************************************************************/
static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency);
static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits);
@@ -151,13 +151,13 @@ struct i2c_ops_s lpc17_i2c_ops =
#endif
};
/*******************************************************************************
/****************************************************************************
* Name: lpc17_i2c_setfrequency
*
* Description:
* Set the frequence for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{
@@ -183,13 +183,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
return frequency;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc17_i2c_setaddress
*
* Description:
* Set the I2C slave address for a subsequent read/write
*
*******************************************************************************/
****************************************************************************/
static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
{
@@ -204,14 +204,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc17_i2c_write
*
* Description:
* Send a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen)
{
@@ -231,14 +231,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle
return ret > 0 ? OK : -ETIMEDOUT;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc17_i2c_read
*
* Description:
* Receive a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
{
@@ -258,13 +258,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
return ret > 0 ? OK : -ETIMEDOUT;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_start
*
* Description:
* Perform a I2C transfer start
*
*******************************************************************************/
****************************************************************************/
static int i2c_start(struct lpc17_i2cdev_s *priv)
{
@@ -292,13 +292,13 @@ static int i2c_start(struct lpc17_i2cdev_s *priv)
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_stop
*
* Description:
* Perform a I2C transfer stop
*
*******************************************************************************/
****************************************************************************/
static void i2c_stop(struct lpc17_i2cdev_s *priv)
{
@@ -310,13 +310,13 @@ static void i2c_stop(struct lpc17_i2cdev_s *priv)
sem_post(&priv->wait);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_timeout
*
* Description:
* Watchdog timer for timeout of I2C operation
*
*******************************************************************************/
****************************************************************************/
static void i2c_timeout(int argc, uint32_t arg, ...)
{
@@ -328,13 +328,13 @@ static void i2c_timeout(int argc, uint32_t arg, ...)
irqrestore(flags);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_interrupt
*
* Description:
* The I2C Interrupt Handler
*
*******************************************************************************/
****************************************************************************/
static int i2c_interrupt(int irq, FAR void *context)
{
@@ -436,17 +436,17 @@ static int i2c_interrupt(int irq, FAR void *context)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Public Functions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: up_i2cinitialize
*
* Description:
* Initialise an I2C device
*
*******************************************************************************/
****************************************************************************/
struct i2c_dev_s *up_i2cinitialize(int port)
{
@@ -566,13 +566,13 @@ struct i2c_dev_s *up_i2cinitialize(int port)
return &priv->dev;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2cuninitalize
*
* Description:
* Uninitialise an I2C device
*
*******************************************************************************/
****************************************************************************/
int up_i2cuninitialize(FAR struct i2c_dev_s * dev)
{
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+24 -24
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* arch/arm/src/lpc2378/lpc23xx_i2c.c
*
* Copyright (C) 2013 Li Zhuoyi. All rights reserved.
@@ -44,11 +44,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -153,13 +153,13 @@ struct i2c_ops_s lpc23xx_i2c_ops =
#endif
};
/*******************************************************************************
/****************************************************************************
* Name: lpc23xx_i2c_setfrequency
*
* Description:
* Set the frequence for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{
@@ -189,13 +189,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
return frequency;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc23xx_i2c_setaddress
*
* Description:
* Set the I2C slave address for a subsequent read/write
*
*******************************************************************************/
****************************************************************************/
static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
{
@@ -210,14 +210,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc23xx_i2c_write
*
* Description:
* Send a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen)
{
@@ -237,14 +237,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle
return ret >0 ? OK : -ETIMEDOUT;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc23xx_i2c_read
*
* Description:
* Receive a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
{
@@ -264,13 +264,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
return ret > 0 ? OK : -ETIMEDOUT;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_start
*
* Description:
* Perform a I2C transfer start
*
*******************************************************************************/
****************************************************************************/
static int i2c_start (struct lpc23xx_i2cdev_s *priv)
{
@@ -300,13 +300,13 @@ static int i2c_start (struct lpc23xx_i2cdev_s *priv)
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_stop
*
* Description:
* Perform a I2C transfer stop
*
*******************************************************************************/
****************************************************************************/
static void i2c_stop (struct lpc23xx_i2cdev_s *priv)
{
@@ -318,13 +318,13 @@ static void i2c_stop (struct lpc23xx_i2cdev_s *priv)
sem_post (&priv->wait);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_timeout
*
* Description:
* Watchdog timer for timeout of I2C operation
*
*******************************************************************************/
****************************************************************************/
static void i2c_timeout (int argc, uint32_t arg, ...)
{
@@ -336,13 +336,13 @@ static void i2c_timeout (int argc, uint32_t arg, ...)
irqrestore(flags);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_interrupt
*
* Description:
* The I2C Interrupt Handler
*
*******************************************************************************/
****************************************************************************/
static int i2c_interrupt (int irq, FAR void *context)
{
@@ -447,13 +447,13 @@ static int i2c_interrupt (int irq, FAR void *context)
/****************************************************************************
* Public Functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: up_i2cinitialize
*
* Description:
* Initialise an I2C device
*
*******************************************************************************/
****************************************************************************/
struct i2c_dev_s *up_i2cinitialize(int port)
{
@@ -586,13 +586,13 @@ struct i2c_dev_s *up_i2cinitialize(int port)
return &priv->dev;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2cuninitalize
*
* Description:
* Uninitialise an I2C device
*
*******************************************************************************/
****************************************************************************/
int up_i2cuninitialize(FAR struct i2c_dev_s * dev)
{
File diff suppressed because it is too large Load Diff
+28 -28
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* arch/arm/src/lpc31xx/lpc31_i2c.c
*
* Author: David Hewson
@@ -33,11 +33,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -64,9 +64,9 @@
#include "lpc31_evntrtr.h"
#include "lpc31_syscreg.h"
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
*******************************************************************************/
****************************************************************************/
/****************************************************************************
* Pre-processor Definitions
@@ -142,13 +142,13 @@ struct i2c_ops_s lpc31_i2c_ops =
#endif
};
/*******************************************************************************
/****************************************************************************
* Name: up_i2cinitialize
*
* Description:
* Initialise an I2C device
*
*******************************************************************************/
****************************************************************************/
struct i2c_dev_s *up_i2cinitialize(int port)
{
@@ -191,13 +191,13 @@ struct i2c_dev_s *up_i2cinitialize(int port)
return &priv->dev;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2cuninitalize
*
* Description:
* Uninitialise an I2C device
*
*******************************************************************************/
****************************************************************************/
void up_i2cuninitalize(struct lpc31_i2cdev_s *priv)
{
@@ -218,13 +218,13 @@ void up_i2cuninitalize(struct lpc31_i2cdev_s *priv)
lpc31_disableclock(priv->clkid);
}
/*******************************************************************************
/****************************************************************************
* Name: lpc31_i2c_setfrequency
*
* Description:
* Set the frequence for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{
@@ -252,13 +252,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
return frequency;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc31_i2c_setaddress
*
* Description:
* Set the I2C slave address for a subsequent read/write
*
*******************************************************************************/
****************************************************************************/
static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
{
@@ -273,14 +273,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc31_i2c_write
*
* Description:
* Send a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen)
{
@@ -298,14 +298,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle
return ret == 1 ? OK : -ETIMEDOUT;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc31_i2c_read
*
* Description:
* Receive a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
{
@@ -323,13 +323,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
return ret == 1 ? OK : -ETIMEDOUT;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_transfer
*
* Description:
* Perform a sequence of I2C transfers
*
*******************************************************************************/
****************************************************************************/
static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, int count)
{
@@ -367,13 +367,13 @@ static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, i
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_interrupt
*
* Description:
* The I2C Interrupt Handler
*
*******************************************************************************/
****************************************************************************/
static int i2c_interrupt(int irq, FAR void *context)
{
@@ -390,13 +390,13 @@ static int i2c_interrupt(int irq, FAR void *context)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_progress
*
* Description:
* Progress any remaining I2C transfers
*
*******************************************************************************/
****************************************************************************/
static void i2c_progress(struct lpc31_i2cdev_s *priv)
{
@@ -589,13 +589,13 @@ out:
}
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_timeout
*
* Description:
* Watchdog timer for timeout of I2C operation
*
*******************************************************************************/
****************************************************************************/
static void i2c_timeout(int argc, uint32_t arg, ...)
{
@@ -630,13 +630,13 @@ static void i2c_timeout(int argc, uint32_t arg, ...)
irqrestore(flags);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_reset
*
* Description:
* Perform a soft reset of the I2C controller
*
*******************************************************************************/
****************************************************************************/
static void i2c_reset(struct lpc31_i2cdev_s *priv)
{
putreg32(I2C_CTRL_RESET, priv->base + LPC31_I2C_CTRL_OFFSET);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+26 -26
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* arch/arm/src/lpc43xx/lpc43_i2c.c
*
* Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
@@ -44,11 +44,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -160,13 +160,13 @@ struct i2c_ops_s lpc43_i2c_ops =
#endif
};
/*******************************************************************************
/****************************************************************************
* Name: lpc43_i2c_setfrequency
*
* Description:
* Set the frequence for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{
struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *) dev;
@@ -191,13 +191,13 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
return frequency;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc43_i2c_setaddress
*
* Description:
* Set the I2C slave address for a subsequent read/write
*
*******************************************************************************/
****************************************************************************/
static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
{
@@ -212,14 +212,14 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: lpc43_i2c_write
*
* Description:
* Send a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer,
int buflen)
@@ -246,14 +246,14 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer,
return (ret == 0 ? 0 : -ETIMEDOUT);
}
/*******************************************************************************
/****************************************************************************
* Name: lpc43_i2c_read
*
* Description:
* Receive a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
{
@@ -279,13 +279,13 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
return (ret == 0 ? 0 : -ETIMEDOUT);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_start
*
* Description:
* Perform a I2C transfer start
*
*******************************************************************************/
****************************************************************************/
static int i2c_start(struct lpc43_i2cdev_s *priv)
{
@@ -308,13 +308,13 @@ static int i2c_start(struct lpc43_i2cdev_s *priv)
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_stop
*
* Description:
* Perform a I2C transfer stop
*
*******************************************************************************/
****************************************************************************/
static void i2c_stop(struct lpc43_i2cdev_s *priv)
{
@@ -326,13 +326,13 @@ static void i2c_stop(struct lpc43_i2cdev_s *priv)
sem_post(&priv->wait);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_timeout
*
* Description:
* Watchdog timer for timeout of I2C operation
*
*******************************************************************************/
****************************************************************************/
static void i2c_timeout(int argc, uint32_t arg, ...)
{
@@ -344,13 +344,13 @@ static void i2c_timeout(int argc, uint32_t arg, ...)
irqrestore(flags);
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_transfer
*
* Description:
* Perform a sequence of I2C transfers
*
*******************************************************************************/
****************************************************************************/
static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, int count)
{
@@ -384,13 +384,13 @@ void startStopNextMessage(struct lpc43_i2cdev_s *priv)
}
}
/*******************************************************************************
/****************************************************************************
* Name: i2c_interrupt
*
* Description:
* The I2C Interrupt Handler
*
*******************************************************************************/
****************************************************************************/
static int i2c_interrupt(int irq, FAR void *context)
{
@@ -489,13 +489,13 @@ static int i2c_interrupt(int irq, FAR void *context)
* Public Functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: up_i2cinitialize
*
* Description:
* Initialise an I2C device
*
*******************************************************************************/
****************************************************************************/
struct i2c_dev_s *up_i2cinitialize(int port)
{
@@ -601,13 +601,13 @@ struct i2c_dev_s *up_i2cinitialize(int port)
return &priv->dev;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2cuninitalize
*
* Description:
* Uninitialise an I2C device
*
*******************************************************************************/
****************************************************************************/
int up_i2cuninitialize(FAR struct i2c_dev_s * dev)
{
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/****************************************************************************
* arch/arm/src/moxart/moxart_irq.c
* Driver for MoxaRT IRQ controller
*
+4 -4
View File
@@ -108,7 +108,7 @@
* Wait until the console is ready to add another character to the TX
* FIFO.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_SERIAL_CONSOLE
static inline void nuc_console_ready(void)
@@ -142,7 +142,7 @@ static inline void nuc_console_ready(void)
* Description:
* Called at the very beginning of _start. Performs low level initialization.
*
*****************************************************************************/
****************************************************************************/
void nuc_lowsetup(void)
{
@@ -323,7 +323,7 @@ void nuc_lowsetup(void)
* Description:
* Output one character to the UART using a simple polling method.
*
*****************************************************************************/
****************************************************************************/
void nuc_lowputc(uint32_t ch)
{
@@ -353,7 +353,7 @@ void nuc_lowputc(uint32_t ch)
* Here we assume that the default clock source for the UART modules is
* the external high speed crystal.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_UART
void nuc_setbaud(uintptr_t base, uint32_t baud)
+56 -56
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* arch/arm/src/sam34/sam_twi.c
*
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
@@ -40,11 +40,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -72,9 +72,9 @@
#if defined(CONFIG_SAM34_TWI0) || defined(CONFIG_SAM34_TWI1)
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
*******************************************************************************/
****************************************************************************/
/* Configuration ***************************************************************/
#ifndef CONFIG_SAM34_TWI0_FREQUENCY
@@ -110,9 +110,9 @@
# define i2cllvdbg(x...)
#endif
/*******************************************************************************
/****************************************************************************
* Private Types
*******************************************************************************/
****************************************************************************/
struct twi_dev_s
{
@@ -144,9 +144,9 @@ struct twi_dev_s
#endif
};
/*******************************************************************************
/****************************************************************************
* Private Function Prototypes
*******************************************************************************/
****************************************************************************/
/* Low-level helper functions */
@@ -216,9 +216,9 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv,
static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid,
uint32_t frequency);
/*******************************************************************************
/****************************************************************************
* Private Data
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAM34_TWI0
static struct twi_dev_s g_twi0;
@@ -407,7 +407,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset,
* I2C transfer helper functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: twi_wait
*
* Description:
@@ -416,7 +416,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset,
* Assumptions:
* Interrupts are disabled
*
*******************************************************************************/
****************************************************************************/
static int twi_wait(struct twi_dev_s *priv)
{
@@ -441,13 +441,13 @@ static int twi_wait(struct twi_dev_s *priv)
return priv->result;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_wakeup
*
* Description:
* A terminal event has occurred. Wake-up the waiting thread
*
*******************************************************************************/
****************************************************************************/
static void twi_wakeup(struct twi_dev_s *priv, int result)
{
@@ -465,13 +465,13 @@ static void twi_wakeup(struct twi_dev_s *priv, int result)
twi_givesem(&priv->waitsem);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_interrupt
*
* Description:
* The TWI Interrupt Handler
*
*******************************************************************************/
****************************************************************************/
static int twi_interrupt(struct twi_dev_s *priv)
{
@@ -605,7 +605,7 @@ static int twi1_interrupt(int irq, FAR void *context)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_timeout
*
* Description:
@@ -614,7 +614,7 @@ static int twi1_interrupt(int irq, FAR void *context)
* Assumptions:
* Called from the timer interrupt handler with interrupts disabled.
*
*******************************************************************************/
****************************************************************************/
static void twi_timeout(int argc, uint32_t arg, ...)
{
@@ -624,13 +624,13 @@ static void twi_timeout(int argc, uint32_t arg, ...)
twi_wakeup(priv, -ETIMEDOUT);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_startread
*
* Description:
* Start the next read message
*
*******************************************************************************/
****************************************************************************/
static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
@@ -661,13 +661,13 @@ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg)
twi_putrel(priv, SAM_TWI_CR_OFFSET, TWI_CR_START);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_startwrite
*
* Description:
* Start the next write message
*
*******************************************************************************/
****************************************************************************/
static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
@@ -694,13 +694,13 @@ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg)
twi_putrel(priv, SAM_TWI_IER_OFFSET, TWI_INT_TXRDY | TWI_INT_ERRORS);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_startmessage
*
* Description:
* Start the next write message
*
*******************************************************************************/
****************************************************************************/
static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
@@ -714,17 +714,17 @@ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg)
}
}
/*******************************************************************************
/****************************************************************************
* I2C device operations
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: twi_setfrequency
*
* Description:
* Set the frequency for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{
@@ -744,13 +744,13 @@ static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
return actual;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_setaddress
*
* Description:
* Set the I2C slave address for a subsequent read/write
*
*******************************************************************************/
****************************************************************************/
static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
{
@@ -772,14 +772,14 @@ static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_write
*
* Description:
* Send a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuflen)
{
@@ -838,14 +838,14 @@ static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuf
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_read
*
* Description:
* Receive a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen)
{
@@ -904,12 +904,12 @@ static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen)
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_writeread
*
* Description:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_WRITEREAD
static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer,
@@ -971,12 +971,12 @@ static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer,
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_setownaddress
*
* Description:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_SLAVE
static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
@@ -986,12 +986,12 @@ static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_registercallback
*
* Description:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_SLAVE
static int twi_registercallback(FAR struct i2c_dev_s *dev,
@@ -1002,14 +1002,14 @@ static int twi_registercallback(FAR struct i2c_dev_s *dev,
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_transfer
*
* Description:
* Receive a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int twi_transfer(FAR struct i2c_dev_s *dev,
@@ -1055,17 +1055,17 @@ static int twi_transfer(FAR struct i2c_dev_s *dev,
}
#endif
/*******************************************************************************
/****************************************************************************
* Initialization
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: twi_hw_setfrequency
*
* Description:
* Set the frequency for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency)
{
@@ -1115,13 +1115,13 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency)
return actual;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_hw_initialize
*
* Description:
* Initialize one TWI peripheral for I2C operation
*
*******************************************************************************/
****************************************************************************/
static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid,
uint32_t frequency)
@@ -1191,17 +1191,17 @@ static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid,
(void)twi_hw_setfrequency(priv, frequency);
}
/*******************************************************************************
/****************************************************************************
* Public Functions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: up_i2cinitialize
*
* Description:
* Initialize a TWI device for I2C operation
*
*******************************************************************************/
****************************************************************************/
struct i2c_dev_s *up_i2cinitialize(int bus)
{
@@ -1305,13 +1305,13 @@ struct i2c_dev_s *up_i2cinitialize(int bus)
return &priv->dev;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2cuninitalize
*
* Description:
* Uninitialise an I2C device
*
*******************************************************************************/
****************************************************************************/
int up_i2cuninitialize(FAR struct i2c_dev_s * dev)
{
+8 -8
View File
@@ -594,13 +594,13 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] =
/****************************************************************************
* Register Operations
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: sam_printreg
*
* Description:
* Print the contents of a SAM34 UDP registers
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAM34_UDP_REGDEBUG
static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
@@ -609,14 +609,14 @@ static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: sam_checkreg
*
* Description:
* Check if it is time to output debug information for accesses to a SAM34
* UDP registers
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAM34_UDP_REGDEBUG
static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
@@ -674,13 +674,13 @@ static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: sam_getreg
*
* Description:
* Get the contents of an SAM34 register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAM34_UDP_REGDEBUG
static uint32_t sam_getreg(uintptr_t regaddr)
@@ -701,13 +701,13 @@ static inline uint32_t sam_getreg(uintptr_t regaddr)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: sam_putreg
*
* Description:
* Set the contents of an SAM34 register to a value
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAM34_UDP_REGDEBUG
static void sam_putreg(uint32_t regval, uintptr_t regaddr)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+56 -56
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* arch/arm/src/sama5/sam_twi.c
*
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
@@ -40,11 +40,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -74,9 +74,9 @@
#if defined(CONFIG_SAMA5_TWI0) || defined(CONFIG_SAMA5_TWI1) || \
defined(CONFIG_SAMA5_TWI2) || defined(CONFIG_SAMA5_TWI3)
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
*******************************************************************************/
****************************************************************************/
/* Configuration ***************************************************************/
#ifndef CONFIG_SAMA5_TWI0_FREQUENCY
@@ -138,9 +138,9 @@
# define i2cllvdbg(x...)
#endif
/*******************************************************************************
/****************************************************************************
* Private Types
*******************************************************************************/
****************************************************************************/
/* Invariant attributes of a TWI bus */
struct twi_attr_s
@@ -185,9 +185,9 @@ struct twi_dev_s
#endif
};
/*******************************************************************************
/****************************************************************************
* Private Function Prototypes
*******************************************************************************/
****************************************************************************/
/* Low-level helper functions */
@@ -262,9 +262,9 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv,
uint32_t frequency);
static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency);
/*******************************************************************************
/****************************************************************************
* Private Data
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMA5_TWI0
static const struct twi_attr_s g_twi0attr =
@@ -505,7 +505,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset,
* I2C transfer helper functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: twi_wait
*
* Description:
@@ -514,7 +514,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset,
* Assumptions:
* Interrupts are disabled
*
*******************************************************************************/
****************************************************************************/
static int twi_wait(struct twi_dev_s *priv, unsigned int size)
{
@@ -557,13 +557,13 @@ static int twi_wait(struct twi_dev_s *priv, unsigned int size)
return priv->result;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_wakeup
*
* Description:
* A terminal event has occurred. Wake-up the waiting thread
*
*******************************************************************************/
****************************************************************************/
static void twi_wakeup(struct twi_dev_s *priv, int result)
{
@@ -581,13 +581,13 @@ static void twi_wakeup(struct twi_dev_s *priv, int result)
twi_givesem(&priv->waitsem);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_interrupt
*
* Description:
* The TWI Interrupt Handler
*
*******************************************************************************/
****************************************************************************/
static int twi_interrupt(struct twi_dev_s *priv)
{
@@ -734,7 +734,7 @@ static int twi3_interrupt(int irq, FAR void *context)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_timeout
*
* Description:
@@ -743,7 +743,7 @@ static int twi3_interrupt(int irq, FAR void *context)
* Assumptions:
* Called from the timer interrupt handler with interrupts disabled.
*
*******************************************************************************/
****************************************************************************/
static void twi_timeout(int argc, uint32_t arg, ...)
{
@@ -753,13 +753,13 @@ static void twi_timeout(int argc, uint32_t arg, ...)
twi_wakeup(priv, -ETIMEDOUT);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_startread
*
* Description:
* Start the next read message
*
*******************************************************************************/
****************************************************************************/
static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
@@ -791,13 +791,13 @@ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg)
twi_putrel(priv, SAM_TWI_CR_OFFSET, TWI_CR_START);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_startwrite
*
* Description:
* Start the next write message
*
*******************************************************************************/
****************************************************************************/
static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
@@ -824,13 +824,13 @@ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg)
twi_putrel(priv, SAM_TWI_IER_OFFSET, TWI_INT_TXRDY | TWI_INT_ERRORS);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_startmessage
*
* Description:
* Start the next write message
*
*******************************************************************************/
****************************************************************************/
static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
@@ -844,17 +844,17 @@ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg)
}
}
/*******************************************************************************
/****************************************************************************
* I2C device operations
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: twi_setfrequency
*
* Description:
* Set the frequency for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{
@@ -874,13 +874,13 @@ static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
return actual;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_setaddress
*
* Description:
* Set the I2C slave address for a subsequent read/write
*
*******************************************************************************/
****************************************************************************/
static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
{
@@ -902,14 +902,14 @@ static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_write
*
* Description:
* Send a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuflen)
{
@@ -960,14 +960,14 @@ static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuf
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_read
*
* Description:
* Receive a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen)
{
@@ -1018,12 +1018,12 @@ static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen)
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_writeread
*
* Description:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_WRITEREAD
static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer,
@@ -1095,12 +1095,12 @@ static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer,
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_setownaddress
*
* Description:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_SLAVE
static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
@@ -1110,12 +1110,12 @@ static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_registercallback
*
* Description:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_SLAVE
static int twi_registercallback((FAR struct i2c_dev_s *dev,
@@ -1126,7 +1126,7 @@ static int twi_registercallback((FAR struct i2c_dev_s *dev,
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_transfer
*
* Description:
@@ -1136,7 +1136,7 @@ static int twi_registercallback((FAR struct i2c_dev_s *dev,
* Returned Value:
* Returns zero on success; a negated errno value on failure.
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int twi_transfer(FAR struct i2c_dev_s *dev,
@@ -1196,9 +1196,9 @@ static int twi_transfer(FAR struct i2c_dev_s *dev,
}
#endif
/*******************************************************************************
/****************************************************************************
* Initialization
*******************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: twi_enableclk
@@ -1227,13 +1227,13 @@ static void twi_enableclk(struct twi_dev_s *priv)
}
}
/*******************************************************************************
/****************************************************************************
* Name: twi_hw_setfrequency
*
* Description:
* Set the frequency for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency)
{
@@ -1287,7 +1287,7 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency)
return actual;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_hw_initialize
*
* Description:
@@ -1295,7 +1295,7 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency)
* repeatable initialization after either (1) the one-time initialization, or
* (2) after each bus reset.
*
*******************************************************************************/
****************************************************************************/
static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency)
{
@@ -1384,17 +1384,17 @@ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency)
irqrestore(flags);
}
/*******************************************************************************
/****************************************************************************
* Public Functions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: up_i2cinitialize
*
* Description:
* Initialize a TWI device for I2C operation
*
*******************************************************************************/
****************************************************************************/
struct i2c_dev_s *up_i2cinitialize(int bus)
{
@@ -1512,13 +1512,13 @@ errout_with_irq:
return NULL;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2cuninitalize
*
* Description:
* Uninitialize an I2C device
*
*******************************************************************************/
****************************************************************************/
int up_i2cuninitialize(FAR struct i2c_dev_s *dev)
{
+8 -8
View File
@@ -660,13 +660,13 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] =
/****************************************************************************
* Register Operations
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: sam_printreg
*
* Description:
* Print the contents of a SAMA5 UDPHS register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMA5_UDPHS_REGDEBUG
static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
@@ -675,14 +675,14 @@ static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: sam_checkreg
*
* Description:
* Check if it is time to output debug information for accesses to a SAMA5
* UDPHS register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMA5_UDPHS_REGDEBUG
static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
@@ -740,13 +740,13 @@ static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: sam_getreg
*
* Description:
* Get the contents of an SAMA5 register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMA5_UDPHS_REGDEBUG
static uint32_t sam_getreg(uintptr_t regaddr)
@@ -767,13 +767,13 @@ static inline uint32_t sam_getreg(uintptr_t regaddr)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: sam_putreg
*
* Description:
* Set the contents of an SAMA5 register to a value
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMA5_UDPHS_REGDEBUG
static void sam_putreg(uint32_t regval, uintptr_t regaddr)
+4 -4
View File
@@ -291,7 +291,7 @@ sam_pad_configure(const struct sam_usart_config_s * const config)
* This configures the SERCOM as a USART, but does not configure USART
* interrupts or enable the USART.
*
*****************************************************************************/
****************************************************************************/
#ifdef SAMDL_HAVE_USART
int sam_usart_internal(const struct sam_usart_config_s * const config)
@@ -398,7 +398,7 @@ void sam_lowsetup(void)
* This configures the SERCOM as a USART, but does not configure USART
* interrupts or enable the USART.
*
*****************************************************************************/
****************************************************************************/
#ifdef SAMDL_HAVE_USART
int sam_usart_initialize(const struct sam_usart_config_s * const config)
@@ -428,7 +428,7 @@ int sam_usart_initialize(const struct sam_usart_config_s * const config)
* Reset the USART SERCOM. This restores all SERCOM register to the
* initial state and disables the SERCOM.
*
*****************************************************************************/
****************************************************************************/
#ifdef SAMDL_HAVE_USART
void sam_usart_reset(const struct sam_usart_config_s * const config)
@@ -457,7 +457,7 @@ void sam_usart_reset(const struct sam_usart_config_s * const config)
* Description:
* Output one character to the USART using a simple polling method.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_SERIAL_CONSOLE
void sam_lowputc(uint32_t ch)
+56 -56
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* arch/arm/src/samv7/sam_twihs.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
@@ -40,11 +40,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -74,9 +74,9 @@
#if defined(CONFIG_SAMV7_TWIHS0) || defined(CONFIG_SAMV7_TWIHS1) || \
defined(CONFIG_SAMV7_TWIHS2)
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
*******************************************************************************/
****************************************************************************/
/* Configuration ***************************************************************/
#ifndef CONFIG_SAMV7_TWIHS0_FREQUENCY
@@ -135,9 +135,9 @@
# define i2cllvdbg(x...)
#endif
/*******************************************************************************
/****************************************************************************
* Private Types
*******************************************************************************/
****************************************************************************/
/* Invariant attributes of a TWIHS bus */
struct twi_attr_s
@@ -183,9 +183,9 @@ struct twi_dev_s
#endif
};
/*******************************************************************************
/****************************************************************************
* Private Function Prototypes
*******************************************************************************/
****************************************************************************/
/* Low-level helper functions */
@@ -257,9 +257,9 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv,
uint32_t frequency);
static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency);
/*******************************************************************************
/****************************************************************************
* Private Data
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMV7_TWIHS0
static const struct twi_attr_s g_twi0attr =
@@ -485,7 +485,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset,
* I2C transfer helper functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: twi_wait
*
* Description:
@@ -494,7 +494,7 @@ static inline void twi_putrel(struct twi_dev_s *priv, unsigned int offset,
* Assumptions:
* Interrupts are disabled
*
*******************************************************************************/
****************************************************************************/
static int twi_wait(struct twi_dev_s *priv, unsigned int size)
{
@@ -537,13 +537,13 @@ static int twi_wait(struct twi_dev_s *priv, unsigned int size)
return priv->result;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_wakeup
*
* Description:
* A terminal event has occurred. Wake-up the waiting thread
*
*******************************************************************************/
****************************************************************************/
static void twi_wakeup(struct twi_dev_s *priv, int result)
{
@@ -561,13 +561,13 @@ static void twi_wakeup(struct twi_dev_s *priv, int result)
twi_givesem(&priv->waitsem);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_interrupt
*
* Description:
* The TWIHS Interrupt Handler
*
*******************************************************************************/
****************************************************************************/
static int twi_interrupt(struct twi_dev_s *priv)
{
@@ -761,7 +761,7 @@ static int twi2_interrupt(int irq, FAR void *context)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_timeout
*
* Description:
@@ -770,7 +770,7 @@ static int twi2_interrupt(int irq, FAR void *context)
* Assumptions:
* Called from the timer interrupt handler with interrupts disabled.
*
*******************************************************************************/
****************************************************************************/
static void twi_timeout(int argc, uint32_t arg, ...)
{
@@ -780,13 +780,13 @@ static void twi_timeout(int argc, uint32_t arg, ...)
twi_wakeup(priv, -ETIMEDOUT);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_startread
*
* Description:
* Start the next read message
*
*******************************************************************************/
****************************************************************************/
static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
@@ -818,13 +818,13 @@ static void twi_startread(struct twi_dev_s *priv, struct i2c_msg_s *msg)
twi_putrel(priv, SAM_TWIHS_CR_OFFSET, TWIHS_CR_START);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_startwrite
*
* Description:
* Start the next write message
*
*******************************************************************************/
****************************************************************************/
static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
@@ -851,13 +851,13 @@ static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg)
twi_putrel(priv, SAM_TWIHS_IER_OFFSET, TWIHS_INT_TXRDY | TWIHS_INT_ERRORS);
}
/*******************************************************************************
/****************************************************************************
* Name: twi_startmessage
*
* Description:
* Start the next write message
*
*******************************************************************************/
****************************************************************************/
static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
@@ -871,17 +871,17 @@ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg)
}
}
/*******************************************************************************
/****************************************************************************
* I2C device operations
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: twi_setfrequency
*
* Description:
* Set the frequency for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{
@@ -901,13 +901,13 @@ static uint32_t twi_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
return actual;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_setaddress
*
* Description:
* Set the I2C slave address for a subsequent read/write
*
*******************************************************************************/
****************************************************************************/
static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
{
@@ -929,14 +929,14 @@ static int twi_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_write
*
* Description:
* Send a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuflen)
{
@@ -987,14 +987,14 @@ static int twi_write(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer, int wbuf
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_read
*
* Description:
* Receive a block of data on I2C using the previously selected I2C
* frequency and slave address.
*
*******************************************************************************/
****************************************************************************/
static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen)
{
@@ -1045,12 +1045,12 @@ static int twi_read(FAR struct i2c_dev_s *dev, uint8_t *rbuffer, int rbuflen)
return ret;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_writeread
*
* Description:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_WRITEREAD
static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer,
@@ -1122,12 +1122,12 @@ static int twi_writeread(FAR struct i2c_dev_s *dev, const uint8_t *wbuffer,
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_setownaddress
*
* Description:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_SLAVE
static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
@@ -1137,12 +1137,12 @@ static int twi_setownaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_registercallback
*
* Description:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_SLAVE
static int twi_registercallback((FAR struct i2c_dev_s *dev,
@@ -1153,7 +1153,7 @@ static int twi_registercallback((FAR struct i2c_dev_s *dev,
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: twi_transfer
*
* Description:
@@ -1163,7 +1163,7 @@ static int twi_registercallback((FAR struct i2c_dev_s *dev,
* Returned Value:
* Returns zero on success; a negated errno value on failure.
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int twi_transfer(FAR struct i2c_dev_s *dev,
@@ -1223,9 +1223,9 @@ static int twi_transfer(FAR struct i2c_dev_s *dev,
}
#endif
/*******************************************************************************
/****************************************************************************
* Initialization
*******************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: twi_enableclk
@@ -1254,13 +1254,13 @@ static void twi_enableclk(struct twi_dev_s *priv)
}
}
/*******************************************************************************
/****************************************************************************
* Name: twi_hw_setfrequency
*
* Description:
* Set the frequency for the next transfer
*
*******************************************************************************/
****************************************************************************/
static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency)
{
@@ -1314,7 +1314,7 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency)
return actual;
}
/*******************************************************************************
/****************************************************************************
* Name: twi_hw_initialize
*
* Description:
@@ -1322,7 +1322,7 @@ static uint32_t twi_hw_setfrequency(struct twi_dev_s *priv, uint32_t frequency)
* repeatable initialization after either (1) the one-time initialization, or
* (2) after each bus reset.
*
*******************************************************************************/
****************************************************************************/
static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency)
{
@@ -1411,17 +1411,17 @@ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency)
irqrestore(flags);
}
/*******************************************************************************
/****************************************************************************
* Public Functions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: up_i2cinitialize
*
* Description:
* Initialize a TWIHS device for I2C operation
*
*******************************************************************************/
****************************************************************************/
struct i2c_dev_s *up_i2cinitialize(int bus)
{
@@ -1535,13 +1535,13 @@ errout_with_irq:
return NULL;
}
/*******************************************************************************
/****************************************************************************
* Name: up_i2cuninitalize
*
* Description:
* Uninitialize an I2C device
*
*******************************************************************************/
****************************************************************************/
int up_i2cuninitialize(FAR struct i2c_dev_s *dev)
{
+8 -8
View File
@@ -709,13 +709,13 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] =
/****************************************************************************
* Register Operations
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: sam_printreg
*
* Description:
* Print the contents of a SAMV7 USBHS register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMV7_USBHS_REGDEBUG
static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
@@ -724,14 +724,14 @@ static void sam_printreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: sam_checkreg
*
* Description:
* Check if it is time to output debug information for accesses to a SAMV7
* USBHS register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMV7_USBHS_REGDEBUG
static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
@@ -789,13 +789,13 @@ static void sam_checkreg(uintptr_t regaddr, uint32_t regval, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: sam_getreg
*
* Description:
* Get the contents of an SAMV7 register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMV7_USBHS_REGDEBUG
static uint32_t sam_getreg(uintptr_t regaddr)
@@ -816,13 +816,13 @@ static inline uint32_t sam_getreg(uintptr_t regaddr)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: sam_putreg
*
* Description:
* Set the contents of an SAMV7 register to a value
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SAMV7_USBHS_REGDEBUG
static void sam_putreg(uint32_t regval, uintptr_t regaddr)
+12 -12
View File
@@ -1077,7 +1077,7 @@ static void adc_rccreset(struct stm32_dev_s *priv, bool reset)
irqrestore(flags);
}
/*******************************************************************************
/****************************************************************************
* Name: adc_power_down_idle
*
* Description : Enables or disables power down during the idle phase.
@@ -1091,7 +1091,7 @@ static void adc_rccreset(struct stm32_dev_s *priv, bool reset)
* Returned Value:
* None.
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_STM32_STM32L15XX
static void adc_power_down_idle(FAR struct stm32_dev_s *priv, bool pdi_high)
@@ -1118,7 +1118,7 @@ static void adc_power_down_idle(FAR struct stm32_dev_s *priv, bool pdi_high)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: adc_power_down_delay
*
* Description : Enables or disables power down during the delay phase.
@@ -1132,7 +1132,7 @@ static void adc_power_down_idle(FAR struct stm32_dev_s *priv, bool pdi_high)
* Returned Value:
* None.
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_STM32_STM32L15XX
static void adc_power_down_delay(FAR struct stm32_dev_s *priv, bool pdd_high)
@@ -1159,7 +1159,7 @@ static void adc_power_down_delay(FAR struct stm32_dev_s *priv, bool pdd_high)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: adc_dels_after_conversion
*
* Description : Defines the length of the delay which is applied
@@ -1173,7 +1173,7 @@ static void adc_power_down_delay(FAR struct stm32_dev_s *priv, bool pdd_high)
*
* Returned Value:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_STM32_STM32L15XX
static void adc_dels_after_conversion(FAR struct stm32_dev_s *priv,
@@ -1190,7 +1190,7 @@ static void adc_dels_after_conversion(FAR struct stm32_dev_s *priv,
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: adc_select_ch_bank
*
* Description : Selects the bank of channels to be converted
@@ -1204,7 +1204,7 @@ static void adc_dels_after_conversion(FAR struct stm32_dev_s *priv,
*
* Returned Value:
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_STM32_STM32L15XX
static void adc_select_ch_bank(FAR struct stm32_dev_s *priv, bool chb_selected)
@@ -1228,7 +1228,7 @@ static void adc_select_ch_bank(FAR struct stm32_dev_s *priv, bool chb_selected)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: adc_enable
*
* Description : Enables or disables the specified ADC peripheral.
@@ -1242,7 +1242,7 @@ static void adc_select_ch_bank(FAR struct stm32_dev_s *priv, bool chb_selected)
*
* Returned Value:
*
*******************************************************************************/
****************************************************************************/
static void adc_enable(FAR struct stm32_dev_s *priv, bool enable)
{
@@ -2693,7 +2693,7 @@ static int adc123_interrupt(int irq, void *context)
* Public Functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: adc_change_sample_time
*
* Description : Changes sample times for specified channels. This method
@@ -2712,7 +2712,7 @@ static int adc123_interrupt(int irq, void *context)
* Returned Value:
* None.
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_STM32_STM32L15XX
void stm32_adcchange_sample_time(FAR struct adc_dev_s *dev,
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1324,7 +1324,7 @@ static void stm32_epwrite(struct stm32_usbdev_s *priv,
* Description:
* Handle the ep0 state on writes.
*
*****************************************************************************/
****************************************************************************/
inline static int stm32_wrrequest_ep0(struct stm32_usbdev_s *priv,
struct stm32_ep_s *privep)
@@ -1438,7 +1438,7 @@ static int stm32_wrrequest(struct stm32_usbdev_s *priv, struct stm32_ep_s *prive
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: stm32_ep0_rdrequest
*
* Description:
@@ -1446,7 +1446,7 @@ static int stm32_wrrequest(struct stm32_usbdev_s *priv, struct stm32_ep_s *prive
* is EP0STATE_SETUP_OUT and uppon new incoming data is available in the endpoint
* 0's buffer. This function will simply copy the OUT data into ep0data.
*
*******************************************************************************/
****************************************************************************/
static inline int stm32_ep0_rdrequest(struct stm32_usbdev_s *priv)
{
+1 -1
View File
@@ -44,7 +44,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This is part of revision 2.1.0.12573 of the Tiva Peripheral Driver Library.
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Included Files
+1 -1
View File
@@ -44,7 +44,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This is part of revision 2.1.0.12573 of the Tiva Peripheral Driver Library.
*****************************************************************************/
****************************************************************************/
/* Keep in mind that for every step there should be another entry in the
* CONFIG_ADC_FIFOSIZE value.
+32 -32
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/****************************************************************************
* arch/avr/src/at32uc3/at32uc3_lowconsole.c
*
* Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include "at32uc3_config.h"
@@ -53,9 +53,9 @@
#include "at32uc3_usart.h"
#include "at32uc3_pinmux.h"
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
/* Select USART parameters for the selected console */
@@ -81,33 +81,33 @@
# error "No CONFIG_USARTn_SERIAL_CONSOLE Setting"
#endif
/******************************************************************************
/****************************************************************************
* Private Types
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Function Prototypes
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Public Data
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Variables
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Name: usart_putreg
*
* Description:
* Write a value to a USART register
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_RS232_DEVICE
static inline void usart_putreg(uintptr_t usart_base, unsigned int offset, uint32_t value)
@@ -116,13 +116,13 @@ static inline void usart_putreg(uintptr_t usart_base, unsigned int offset, uint3
}
#endif
/******************************************************************************
/****************************************************************************
* Name: usart_getreg
*
* Description:
* Get a value from a USART register
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_RS232_DEVICE
static inline uint32_t usart_getreg(uintptr_t usart_base, unsigned int offset)
@@ -131,13 +131,13 @@ static inline uint32_t usart_getreg(uintptr_t usart_base, unsigned int offset)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: usart_setbaudrate
*
* Description:
* Configure the UART baud rate.
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_RS232_DEVICE
static void usart_setbaudrate(uintptr_t usart_base, uint32_t baudrate)
@@ -186,17 +186,17 @@ static void usart_setbaudrate(uintptr_t usart_base, uint32_t baudrate)
}
#endif
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Name: usart_reset
*
* Description:
* Reset a USART.
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_RS232_DEVICE
void usart_reset(uintptr_t usart_base)
@@ -223,13 +223,13 @@ void usart_reset(uintptr_t usart_base)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: usart_configure
*
* Description:
* Configure a USART as a RS-232 UART.
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_RS232_DEVICE
void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity,
@@ -290,7 +290,7 @@ void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity,
}
#endif
/******************************************************************************
/****************************************************************************
* Name: up_consoleinit
*
* Description:
@@ -298,7 +298,7 @@ void usart_configure(uintptr_t usart_base, uint32_t baud, unsigned int parity,
* early in the initialization sequence to configure the serial console uart
* (only).
*
******************************************************************************/
****************************************************************************/
void up_consoleinit(void)
{
@@ -368,13 +368,13 @@ void up_consoleinit(void)
#endif
}
/******************************************************************************
/****************************************************************************
* Name: up_lowputc
*
* Description:
* Output one byte on the serial console
*
******************************************************************************/
****************************************************************************/
void up_lowputc(char ch)
{
+26 -26
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/****************************************************************************
* arch/avr/src/at90usb/at90usb_lowconsole.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include "at90usb_config.h"
@@ -52,9 +52,9 @@
#include "at90usb_internal.h"
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
/* Baud rate settings for normal and double speed modes */
@@ -116,37 +116,37 @@
# endif
#endif
/******************************************************************************
/****************************************************************************
* Private Types
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Function Prototypes
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Public Data
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Variables
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Name: usart1_reset
*
* Description:
* Reset a USART.
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_USART_DEVICE
void usart1_reset(void)
@@ -168,13 +168,13 @@ void usart1_reset(void)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: usart1_configure
*
* Description:
* Configure USART1.
*
******************************************************************************/
****************************************************************************/
#ifdef HAVE_USART_DEVICE
void usart1_configure(void)
@@ -249,7 +249,7 @@ void usart1_configure(void)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: up_consoleinit
*
* Description:
@@ -257,7 +257,7 @@ void usart1_configure(void)
* early in the initialization sequence to configure the serial console uart
* (only).
*
******************************************************************************/
****************************************************************************/
void up_consoleinit(void)
{
@@ -266,13 +266,13 @@ void up_consoleinit(void)
#endif
}
/******************************************************************************
/****************************************************************************
* Name: up_lowputc
*
* Description:
* Output one byte on the serial console
*
******************************************************************************/
****************************************************************************/
void up_lowputc(char ch)
{
File diff suppressed because it is too large Load Diff
+22 -22
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/****************************************************************************
* arch/avr/src/atmega/atmega_lowconsole.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include "atmega_config.h"
@@ -51,9 +51,9 @@
#include "up_internal.h"
#include "atmega_internal.h"
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
/* USART0 Baud rate settings for normal and double speed modes */
@@ -175,29 +175,29 @@
# endif
#endif
/******************************************************************************
/****************************************************************************
* Private Types
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Function Prototypes
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Public Data
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Variables
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: usart0_reset and usart1_reset
@@ -431,7 +431,7 @@ void usart1_configure(void)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: up_consoleinit
*
* Description:
@@ -439,7 +439,7 @@ void usart1_configure(void)
* early in the initialization sequence to configure the serial console uart
* (only).
*
******************************************************************************/
****************************************************************************/
void up_consoleinit(void)
{
@@ -452,13 +452,13 @@ void up_consoleinit(void)
#endif
}
/******************************************************************************
/****************************************************************************
* Name: up_lowputc
*
* Description:
* Output one byte on the serial console
*
******************************************************************************/
****************************************************************************/
void up_lowputc(char ch)
{
+10 -10
View File
@@ -477,13 +477,13 @@ static void pic32mx_ethreset(struct pic32mx_driver_s *priv);
* Private Functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: pic32mx_printreg
*
* Description:
* Print the contents of an PIC32MX register operation
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_NET_REGDEBUG
static void pic32mx_printreg(uint32_t addr, uint32_t val, bool iswrite)
@@ -492,13 +492,13 @@ static void pic32mx_printreg(uint32_t addr, uint32_t val, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: pic32mx_checkreg
*
* Description:
* Get the contents of an PIC32MX register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_NET_REGDEBUG
static void pic32mx_checkreg(uint32_t addr, uint32_t val, bool iswrite)
@@ -556,13 +556,13 @@ static void pic32mx_checkreg(uint32_t addr, uint32_t val, bool iswrite)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: pic32mx_getreg
*
* Description:
* Get the contents of an PIC32MX register
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_NET_REGDEBUG
static uint32_t pic32mx_getreg(uint32_t addr)
@@ -578,13 +578,13 @@ static uint32_t pic32mx_getreg(uint32_t addr)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: pic32mx_putreg
*
* Description:
* Set the contents of an PIC32MX register to a value
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_NET_REGDEBUG
static void pic32mx_putreg(uint32_t val, uint32_t addr)
@@ -2401,7 +2401,7 @@ static int pic32mx_rmmac(struct net_driver_s *dev, const uint8_t *mac)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: pic32mx_showmii
*
* Description:
@@ -2415,7 +2415,7 @@ static int pic32mx_rmmac(struct net_driver_s *dev, const uint8_t *mac)
*
* Assumptions:
*
*******************************************************************************/
****************************************************************************/
#if defined(CONFIG_NET_REGDEBUG) && defined(PIC32MX_HAVE_PHY)
static void pic32mx_showmii(uint8_t phyaddr, const char *msg)

Some files were not shown because too many files have changed in this diff Show More