arch/arm: Remove FAR and CODE from chip folder(3)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-04-17 14:01:48 +08:00
committed by Petro Karashchenko
parent 44ad6d0a23
commit 972a260391
329 changed files with 10295 additions and 10301 deletions
+30 -30
View File
@@ -145,28 +145,28 @@ static void stm32_1wire_send(struct stm32_1wire_priv_s *priv, int ch);
static void stm32_1wire_set_baud(struct stm32_1wire_priv_s *priv);
static void stm32_1wire_set_apb_clock(struct stm32_1wire_priv_s *priv,
bool on);
static int stm32_1wire_init(FAR struct stm32_1wire_priv_s *priv);
static int stm32_1wire_deinit(FAR struct stm32_1wire_priv_s *priv);
static inline void stm32_1wire_sem_init(FAR struct stm32_1wire_priv_s *priv);
static int stm32_1wire_init(struct stm32_1wire_priv_s *priv);
static int stm32_1wire_deinit(struct stm32_1wire_priv_s *priv);
static inline void stm32_1wire_sem_init(struct stm32_1wire_priv_s *priv);
static inline void stm32_1wire_sem_destroy(
FAR struct stm32_1wire_priv_s *priv);
static inline int stm32_1wire_sem_wait(FAR struct stm32_1wire_priv_s *priv);
static inline void stm32_1wire_sem_post(FAR struct stm32_1wire_priv_s *priv);
struct stm32_1wire_priv_s *priv);
static inline int stm32_1wire_sem_wait(struct stm32_1wire_priv_s *priv);
static inline void stm32_1wire_sem_post(struct stm32_1wire_priv_s *priv);
static int stm32_1wire_process(struct stm32_1wire_priv_s *priv,
FAR const struct stm32_1wire_msg_s *msgs,
const struct stm32_1wire_msg_s *msgs,
int count);
static int stm32_1wire_isr(int irq, void *context, void *arg);
static int stm32_1wire_reset(FAR struct onewire_dev_s *dev);
static int stm32_1wire_write(FAR struct onewire_dev_s *dev,
static int stm32_1wire_reset(struct onewire_dev_s *dev);
static int stm32_1wire_write(struct onewire_dev_s *dev,
const uint8_t *buffer, int buflen);
static int stm32_1wire_read(FAR struct onewire_dev_s *dev, uint8_t *buffer,
static int stm32_1wire_read(struct onewire_dev_s *dev, uint8_t *buffer,
int buflen);
static int stm32_1wire_exchange(FAR struct onewire_dev_s *dev, bool reset,
static int stm32_1wire_exchange(struct onewire_dev_s *dev, bool reset,
const uint8_t *txbuffer, int txbuflen,
uint8_t *rxbuffer, int rxbuflen);
static int stm32_1wire_writebit(FAR struct onewire_dev_s *dev,
static int stm32_1wire_writebit(struct onewire_dev_s *dev,
const uint8_t *bit);
static int stm32_1wire_readbit(FAR struct onewire_dev_s *dev, uint8_t *bit);
static int stm32_1wire_readbit(struct onewire_dev_s *dev, uint8_t *bit);
/****************************************************************************
* Private Data
@@ -591,7 +591,7 @@ static void stm32_1wire_set_apb_clock(struct stm32_1wire_priv_s *priv,
*
****************************************************************************/
static int stm32_1wire_init(FAR struct stm32_1wire_priv_s *priv)
static int stm32_1wire_init(struct stm32_1wire_priv_s *priv)
{
const struct stm32_1wire_config_s *config = priv->config;
uint32_t regval;
@@ -666,7 +666,7 @@ static int stm32_1wire_init(FAR struct stm32_1wire_priv_s *priv)
*
****************************************************************************/
static int stm32_1wire_deinit(FAR struct stm32_1wire_priv_s *priv)
static int stm32_1wire_deinit(struct stm32_1wire_priv_s *priv)
{
const struct stm32_1wire_config_s *config = priv->config;
uint32_t regval;
@@ -711,7 +711,7 @@ static int stm32_1wire_deinit(FAR struct stm32_1wire_priv_s *priv)
*
****************************************************************************/
static inline void stm32_1wire_sem_init(FAR struct stm32_1wire_priv_s *priv)
static inline void stm32_1wire_sem_init(struct stm32_1wire_priv_s *priv)
{
nxsem_init(&priv->sem_excl, 0, 1);
nxsem_init(&priv->sem_isr, 0, 0);
@@ -732,7 +732,7 @@ static inline void stm32_1wire_sem_init(FAR struct stm32_1wire_priv_s *priv)
****************************************************************************/
static inline void stm32_1wire_sem_destroy(
FAR struct stm32_1wire_priv_s *priv)
struct stm32_1wire_priv_s *priv)
{
nxsem_destroy(&priv->sem_excl);
nxsem_destroy(&priv->sem_isr);
@@ -746,7 +746,7 @@ static inline void stm32_1wire_sem_destroy(
*
****************************************************************************/
static inline int stm32_1wire_sem_wait(FAR struct stm32_1wire_priv_s *priv)
static inline int stm32_1wire_sem_wait(struct stm32_1wire_priv_s *priv)
{
return nxsem_wait_uninterruptible(&priv->sem_excl);
}
@@ -759,7 +759,7 @@ static inline int stm32_1wire_sem_wait(FAR struct stm32_1wire_priv_s *priv)
*
****************************************************************************/
static inline void stm32_1wire_sem_post(FAR struct stm32_1wire_priv_s *priv)
static inline void stm32_1wire_sem_post(struct stm32_1wire_priv_s *priv)
{
nxsem_post(&priv->sem_excl);
}
@@ -772,7 +772,7 @@ static inline void stm32_1wire_sem_post(FAR struct stm32_1wire_priv_s *priv)
****************************************************************************/
static int stm32_1wire_process(struct stm32_1wire_priv_s *priv,
FAR const struct stm32_1wire_msg_s *msgs,
const struct stm32_1wire_msg_s *msgs,
int count)
{
irqstate_t irqs;
@@ -1044,7 +1044,7 @@ static int stm32_1wire_isr(int irq, void *context, void *arg)
*
****************************************************************************/
static int stm32_1wire_reset(FAR struct onewire_dev_s *dev)
static int stm32_1wire_reset(struct onewire_dev_s *dev)
{
struct stm32_1wire_priv_s *priv = ((struct stm32_1wire_inst_s *)dev)->priv;
const struct stm32_1wire_msg_s msgs[1] =
@@ -1063,7 +1063,7 @@ static int stm32_1wire_reset(FAR struct onewire_dev_s *dev)
*
****************************************************************************/
static int stm32_1wire_write(FAR struct onewire_dev_s *dev,
static int stm32_1wire_write(struct onewire_dev_s *dev,
const uint8_t *buffer, int buflen)
{
struct stm32_1wire_priv_s *priv = ((struct stm32_1wire_inst_s *)dev)->priv;
@@ -1085,7 +1085,7 @@ static int stm32_1wire_write(FAR struct onewire_dev_s *dev,
*
****************************************************************************/
static int stm32_1wire_read(FAR struct onewire_dev_s *dev, uint8_t *buffer,
static int stm32_1wire_read(struct onewire_dev_s *dev, uint8_t *buffer,
int buflen)
{
struct stm32_1wire_priv_s *priv = ((struct stm32_1wire_inst_s *)dev)->priv;
@@ -1109,9 +1109,9 @@ static int stm32_1wire_read(FAR struct onewire_dev_s *dev, uint8_t *buffer,
*
****************************************************************************/
static int stm32_1wire_exchange(FAR struct onewire_dev_s *dev, bool reset,
const uint8_t *txbuffer, int txbuflen,
uint8_t *rxbuffer, int rxbuflen)
static int stm32_1wire_exchange(struct onewire_dev_s *dev, bool reset,
const uint8_t *txbuffer, int txbuflen,
uint8_t *rxbuffer, int rxbuflen)
{
int result = ERROR;
struct stm32_1wire_priv_s *priv = ((struct stm32_1wire_inst_s *)dev)->priv;
@@ -1160,7 +1160,7 @@ static int stm32_1wire_exchange(FAR struct onewire_dev_s *dev, bool reset,
*
****************************************************************************/
static int stm32_1wire_writebit(FAR struct onewire_dev_s *dev,
static int stm32_1wire_writebit(struct onewire_dev_s *dev,
const uint8_t *bit)
{
struct stm32_1wire_priv_s *priv = ((struct stm32_1wire_inst_s *)dev)->priv;
@@ -1184,7 +1184,7 @@ static int stm32_1wire_writebit(FAR struct onewire_dev_s *dev,
*
****************************************************************************/
static int stm32_1wire_readbit(FAR struct onewire_dev_s *dev, uint8_t *bit)
static int stm32_1wire_readbit(struct onewire_dev_s *dev, uint8_t *bit)
{
struct stm32_1wire_priv_s *priv = ((struct stm32_1wire_inst_s *)dev)->priv;
const struct stm32_1wire_msg_s msgs[1] =
@@ -1218,7 +1218,7 @@ static int stm32_1wire_readbit(FAR struct onewire_dev_s *dev, uint8_t *bit)
*
****************************************************************************/
FAR struct onewire_dev_s *stm32_1wireinitialize(int port)
struct onewire_dev_s *stm32_1wireinitialize(int port)
{
struct stm32_1wire_priv_s *priv = NULL; /* Private data of device with multiple instances */
struct stm32_1wire_inst_s *inst = NULL; /* Device, single instance */
@@ -1316,7 +1316,7 @@ FAR struct onewire_dev_s *stm32_1wireinitialize(int port)
*
****************************************************************************/
int stm32_1wireuninitialize(FAR struct onewire_dev_s *dev)
int stm32_1wireuninitialize(struct onewire_dev_s *dev)
{
struct stm32_1wire_priv_s *priv = ((struct stm32_1wire_inst_s *)dev)->priv;
int irqs;
+2 -2
View File
@@ -50,7 +50,7 @@
*
****************************************************************************/
FAR struct onewire_dev_s *stm32_1wireinitialize(int port);
struct onewire_dev_s *stm32_1wireinitialize(int port);
/****************************************************************************
* Name: stm32_1wireuninitialize
@@ -67,6 +67,6 @@ FAR struct onewire_dev_s *stm32_1wireinitialize(int port);
*
****************************************************************************/
int stm32_1wireuninitialize(FAR struct onewire_dev_s *dev);
int stm32_1wireuninitialize(struct onewire_dev_s *dev);
#endif /* __ARCH_ARM_SRC_STM32_STM32_1WIRE_H */
File diff suppressed because it is too large Load Diff
+20 -20
View File
@@ -2144,7 +2144,7 @@ struct stm32_adc_dev_s
{
/* Publicly visible portion of the "lower-half" ADC driver structure */
FAR const struct stm32_adc_ops_s *llops;
const struct stm32_adc_ops_s *llops;
/* Require cast-compatibility with private "lower-half" ADC structure */
};
@@ -2155,80 +2155,80 @@ struct stm32_adc_ops_s
{
/* Low-level ADC setup */
int (*setup)(FAR struct stm32_adc_dev_s *dev);
int (*setup)(struct stm32_adc_dev_s *dev);
/* Low-level ADC shutdown */
void (*shutdown)(FAR struct stm32_adc_dev_s *dev);
void (*shutdown)(struct stm32_adc_dev_s *dev);
/* Acknowledge interrupts */
void (*int_ack)(FAR struct stm32_adc_dev_s *dev, uint32_t source);
void (*int_ack)(struct stm32_adc_dev_s *dev, uint32_t source);
/* Get pending interrupts */
uint32_t (*int_get)(FAR struct stm32_adc_dev_s *dev);
uint32_t (*int_get)(struct stm32_adc_dev_s *dev);
/* Enable interrupts */
void (*int_en)(FAR struct stm32_adc_dev_s *dev, uint32_t source);
void (*int_en)(struct stm32_adc_dev_s *dev, uint32_t source);
/* Disable interrupts */
void (*int_dis)(FAR struct stm32_adc_dev_s *dev, uint32_t source);
void (*int_dis)(struct stm32_adc_dev_s *dev, uint32_t source);
/* Get current ADC data register */
uint32_t (*val_get)(FAR struct stm32_adc_dev_s *dev);
uint32_t (*val_get)(struct stm32_adc_dev_s *dev);
/* Register buffer for ADC DMA transfer */
int (*regbuf_reg)(FAR struct stm32_adc_dev_s *dev,
int (*regbuf_reg)(struct stm32_adc_dev_s *dev,
uint16_t *buffer, uint8_t len);
/* Start/stop regular conversion */
void (*reg_startconv)(FAR struct stm32_adc_dev_s *dev, bool state);
void (*reg_startconv)(struct stm32_adc_dev_s *dev, bool state);
/* Set offset for channel */
int (*offset_set)(FAR struct stm32_adc_dev_s *dev, uint8_t ch, uint8_t i,
int (*offset_set)(struct stm32_adc_dev_s *dev, uint8_t ch, uint8_t i,
uint16_t offset);
#ifdef ADC_HAVE_EXTCFG
/* Configure the ADC external trigger for regular conversion */
void (*extcfg_set)(FAR struct stm32_adc_dev_s *dev, uint32_t extcfg);
void (*extcfg_set)(struct stm32_adc_dev_s *dev, uint32_t extcfg);
#endif
#ifdef ADC_HAVE_JEXTCFG
/* Configure the ADC external trigger for injected conversion */
void (*jextcfg_set)(FAR struct stm32_adc_dev_s *dev, uint32_t jextcfg);
void (*jextcfg_set)(struct stm32_adc_dev_s *dev, uint32_t jextcfg);
#endif
#ifdef ADC_HAVE_INJECTED
/* Get current ADC injected data register */
uint32_t (*inj_get)(FAR struct stm32_adc_dev_s *dev, uint8_t chan);
uint32_t (*inj_get)(struct stm32_adc_dev_s *dev, uint8_t chan);
/* Start/stop injected conversion */
void (*inj_startconv)(FAR struct stm32_adc_dev_s *dev, bool state);
void (*inj_startconv)(struct stm32_adc_dev_s *dev, bool state);
#endif
#ifdef CONFIG_STM32_ADC_CHANGE_SAMPLETIME
/* Set ADC sample time */
void (*stime_set)(FAR struct stm32_adc_dev_s *dev,
FAR struct adc_sample_time_s *time_samples);
void (*stime_set)(struct stm32_adc_dev_s *dev,
struct adc_sample_time_s *time_samples);
/* Write ADC sample time */
void (*stime_write)(FAR struct stm32_adc_dev_s *dev);
void (*stime_write)(struct stm32_adc_dev_s *dev);
#endif
void (*dump_regs)(FAR struct stm32_adc_dev_s *dev);
void (*dump_regs)(struct stm32_adc_dev_s *dev);
};
#endif /* CONFIG_STM32_ADC_LL_OPS */
@@ -2263,7 +2263,7 @@ extern "C"
****************************************************************************/
struct adc_dev_s;
struct adc_dev_s *stm32_adcinitialize(int intf, FAR const uint8_t *chanlist,
struct adc_dev_s *stm32_adcinitialize(int intf, const uint8_t *chanlist,
int channels);
#undef EXTERN
+16 -16
View File
@@ -58,10 +58,10 @@
static void stm32aes_enable(bool on);
static void stm32aes_ccfc(void);
static void stm32aes_setkey(FAR const void *key, size_t key_len);
static void stm32aes_setiv(FAR const void *iv);
static void stm32aes_encryptblock(FAR void *block_out,
FAR const void *block_in);
static void stm32aes_setkey(const void *key, size_t key_len);
static void stm32aes_setiv(const void *iv);
static void stm32aes_encryptblock(void *block_out,
const void *block_in);
static int stm32aes_setup_cr(int mode, int encrypt);
/****************************************************************************
@@ -109,9 +109,9 @@ static void stm32aes_ccfc(void)
/* TODO: Handle other AES key lengths or fail if length is not valid */
static void stm32aes_setkey(FAR const void *key, size_t key_len)
static void stm32aes_setkey(const void *key, size_t key_len)
{
FAR uint32_t *in = (FAR uint32_t *)key;
uint32_t *in = (uint32_t *)key;
putreg32(__builtin_bswap32(*in), STM32_AES_KEYR3);
in++;
@@ -122,9 +122,9 @@ static void stm32aes_setkey(FAR const void *key, size_t key_len)
putreg32(__builtin_bswap32(*in), STM32_AES_KEYR0);
}
static void stm32aes_setiv(FAR const void *iv)
static void stm32aes_setiv(const void *iv)
{
FAR uint32_t *in = (FAR uint32_t *)iv;
uint32_t *in = (uint32_t *)iv;
putreg32(__builtin_bswap32(*in), STM32_AES_IVR3);
in++;
@@ -135,11 +135,11 @@ static void stm32aes_setiv(FAR const void *iv)
putreg32(__builtin_bswap32(*in), STM32_AES_IVR0);
}
static void stm32aes_encryptblock(FAR void *block_out,
FAR const void *block_in)
static void stm32aes_encryptblock(void *block_out,
const void *block_in)
{
FAR uint32_t *in = (FAR uint32_t *)block_in;
FAR uint32_t *out = (FAR uint32_t *)block_out;
uint32_t *in = (uint32_t *)block_in;
uint32_t *out = (uint32_t *)block_out;
putreg32(*in, STM32_AES_DINR);
in++;
@@ -257,8 +257,8 @@ int stm32_aesuninitialize(void)
return OK;
}
int aes_cypher(FAR void *out, FAR const void *in, uint32_t size,
FAR const void *iv, FAR const void *key, uint32_t keysize,
int aes_cypher(void *out, const void *in, uint32_t size,
const void *iv, const void *key, uint32_t keysize,
int mode, int encrypt)
{
int ret = OK;
@@ -311,8 +311,8 @@ int aes_cypher(FAR void *out, FAR const void *in, uint32_t size,
while (size)
{
stm32aes_encryptblock(out, in);
out = (FAR uint8_t *)out + AES_BLOCK_SIZE;
in = (FAR uint8_t *)in + AES_BLOCK_SIZE;
out = (uint8_t *)out + AES_BLOCK_SIZE;
in = (uint8_t *)in + AES_BLOCK_SIZE;
size -= AES_BLOCK_SIZE;
}
+2 -2
View File
@@ -39,7 +39,7 @@
/* The form of an alarm callback */
typedef CODE void (*alarmcb_t)(void);
typedef void (*alarmcb_t)(void);
/****************************************************************************
* Public Function Prototypes
@@ -70,7 +70,7 @@ extern "C"
****************************************************************************/
struct timespec;
int stm32_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback);
int stm32_rtc_setalarm(const struct timespec *tp, alarmcb_t callback);
/****************************************************************************
* Name: stm32_rtc_cancelalarm
+11 -11
View File
@@ -607,7 +607,7 @@
****************************************************************************/
#ifdef CONFIG_HEAP_COLORATION
static inline void up_heap_color(FAR void *start, size_t size)
static inline void up_heap_color(void *start, size_t size)
{
memset(start, HEAP_COLOR, size);
}
@@ -654,7 +654,7 @@ static inline void up_heap_color(FAR void *start, size_t size)
*
****************************************************************************/
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
void up_allocate_heap(void **heap_start, size_t *heap_size)
{
#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_MM_KERNEL_HEAP)
/* Get the unaligned size and position of the user-space heap.
@@ -682,12 +682,12 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
/* Return the user-space heap settings */
board_autoled_on(LED_HEAPALLOCATE);
*heap_start = (FAR void *)ubase;
*heap_start = (void *)ubase;
*heap_size = usize;
/* Colorize the heap for debug */
up_heap_color((FAR void *)ubase, usize);
up_heap_color((void *)ubase, usize);
/* Allow user-mode access to the user heap memory */
@@ -697,7 +697,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
/* Return the heap settings */
board_autoled_on(LED_HEAPALLOCATE);
*heap_start = (FAR void *)g_idle_topstack;
*heap_start = (void *)g_idle_topstack;
*heap_size = SRAM1_END - g_idle_topstack;
/* Colorize the heap for debug */
@@ -717,7 +717,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
****************************************************************************/
#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_MM_KERNEL_HEAP)
void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
void up_allocate_kheap(void **heap_start, size_t *heap_size)
{
/* Get the unaligned size and position of the user-space heap.
* This heap begins after the user-space .bss section at an offset
@@ -745,7 +745,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
* that was not dedicated to the user heap).
*/
*heap_start = (FAR void *)USERSPACE->us_bssend;
*heap_start = (void *)USERSPACE->us_bssend;
*heap_size = ubase - (uintptr_t)USERSPACE->us_bssend;
}
#endif
@@ -773,11 +773,11 @@ void arm_addregion(void)
/* Colorize the heap for debug */
up_heap_color((FAR void *)SRAM2_START, SRAM2_END - SRAM2_START);
up_heap_color((void *)SRAM2_START, SRAM2_END - SRAM2_START);
/* Add the STM32F20xxx/STM32F40xxx CCM SRAM user heap region. */
kumm_addregion((FAR void *)SRAM2_START, SRAM2_END - SRAM2_START);
kumm_addregion((void *)SRAM2_START, SRAM2_END - SRAM2_START);
#endif
#ifdef CONFIG_STM32_EXTERNAL_RAM
@@ -791,11 +791,11 @@ void arm_addregion(void)
/* Colorize the heap for debug */
up_heap_color((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
up_heap_color((void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
/* Add the external FSMC SRAM user heap region. */
kumm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
kumm_addregion((void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
#endif
}
#endif
+58 -58
View File
@@ -86,40 +86,40 @@
struct bbsramfh_s
{
uint32_t crc; /* CRC calculated over data and this struct
* starting at fileno */
uint8_t fileno; /* The minor number */
uint8_t dirty; /* Data has been written to the file */
uint16_t len; /* Total Bytes in this file */
struct timespec lastwrite; /* Last write time */
uint8_t data[]; /* Data in the file */
uint32_t crc; /* CRC calculated over data and this struct
* starting at fileno */
uint8_t fileno; /* The minor number */
uint8_t dirty; /* Data has been written to the file */
uint16_t len; /* Total Bytes in this file */
struct timespec lastwrite; /* Last write time */
uint8_t data[]; /* Data in the file */
};
struct stm32_bbsram_s
{
sem_t exclsem; /* For atomic accesses to this structure */
uint8_t refs; /* Number of references */
FAR struct bbsramfh_s *bbf; /* File in bbram */
sem_t exclsem; /* For atomic accesses to this structure */
uint8_t refs; /* Number of references */
struct bbsramfh_s *bbf; /* File in bbram */
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static int stm32_bbsram_open(FAR struct file *filep);
static int stm32_bbsram_close(FAR struct file *filep);
static off_t stm32_bbsram_seek(FAR struct file *filep, off_t offset,
static int stm32_bbsram_open(struct file *filep);
static int stm32_bbsram_close(struct file *filep);
static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
int whence);
static ssize_t stm32_bbsram_read(FAR struct file *filep, FAR char *buffer,
static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
size_t len);
static ssize_t stm32_bbsram_write(FAR struct file *filep,
FAR const char *buffer, size_t len);
static int stm32_bbsram_ioctl(FAR struct file *filep, int cmd,
static ssize_t stm32_bbsram_write(struct file *filep,
const char *buffer, size_t len);
static int stm32_bbsram_ioctl(struct file *filep, int cmd,
unsigned long arg);
static int stm32_bbsram_poll(FAR struct file *filep,
FAR struct pollfd *fds, bool setup);
static int stm32_bbsram_poll(struct file *filep,
struct pollfd *fds, bool setup);
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
static int stm32_bbsram_unlink(FAR struct inode *inode);
static int stm32_bbsram_unlink(struct inode *inode);
#endif
/****************************************************************************
@@ -166,7 +166,7 @@ static void stm32_bbsram_rd(void)
****************************************************************************/
#if defined(CONFIG_BBSRAM_DEBUG)
static void stm32_bbsram_dump(FAR struct bbsramfh_s *bbf, char *op)
static void stm32_bbsram_dump(struct bbsramfh_s *bbf, char *op)
{
BBSRAM_DEBUG_READ();
_info("%s:\n", op);
@@ -185,7 +185,7 @@ static void stm32_bbsram_dump(FAR struct bbsramfh_s *bbf, char *op)
* Name: stm32_bbsram_semgive
****************************************************************************/
static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv)
static void stm32_bbsram_semgive(struct stm32_bbsram_s *priv)
{
nxsem_post(&priv->exclsem);
}
@@ -204,7 +204,7 @@ static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv)
*
****************************************************************************/
static int stm32_bbsram_semtake(FAR struct stm32_bbsram_s *priv)
static int stm32_bbsram_semtake(struct stm32_bbsram_s *priv)
{
return nxsem_wait_uninterruptible(&priv->exclsem);
}
@@ -263,7 +263,7 @@ static inline void stm32_bbsram_lock(void)
*
****************************************************************************/
static uint32_t stm32_bbsram_crc(FAR struct bbsramfh_s *pf)
static uint32_t stm32_bbsram_crc(struct bbsramfh_s *pf)
{
return crc32((uint8_t *)pf + BBSRAM_CRCED_OFFSET,
BBSRAM_CRCED_SIZE(pf->len));
@@ -276,14 +276,14 @@ static uint32_t stm32_bbsram_crc(FAR struct bbsramfh_s *pf)
*
****************************************************************************/
static int stm32_bbsram_open(FAR struct file *filep)
static int stm32_bbsram_open(struct file *filep)
{
FAR struct inode *inode = filep->f_inode;
FAR struct stm32_bbsram_s *bbr;
struct inode *inode = filep->f_inode;
struct stm32_bbsram_s *bbr;
int ret;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct stm32_bbsram_s *)inode->i_private;
bbr = (struct stm32_bbsram_s *)inode->i_private;
/* Increment the reference count */
@@ -314,7 +314,7 @@ static int stm32_bbsram_open(FAR struct file *filep)
*
****************************************************************************/
static int stm32_bbsram_internal_close(FAR struct bbsramfh_s *bbf)
static int stm32_bbsram_internal_close(struct bbsramfh_s *bbf)
{
bbf->dirty = 0;
clock_gettime(CLOCK_REALTIME, &bbf->lastwrite);
@@ -331,14 +331,14 @@ static int stm32_bbsram_internal_close(FAR struct bbsramfh_s *bbf)
*
****************************************************************************/
static int stm32_bbsram_close(FAR struct file *filep)
static int stm32_bbsram_close(struct file *filep)
{
FAR struct inode *inode = filep->f_inode;
FAR struct stm32_bbsram_s *bbr;
struct inode *inode = filep->f_inode;
struct stm32_bbsram_s *bbr;
int ret = OK;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct stm32_bbsram_s *)inode->i_private;
bbr = (struct stm32_bbsram_s *)inode->i_private;
ret = stm32_bbsram_semtake(bbr);
if (ret < 0)
@@ -377,16 +377,16 @@ static int stm32_bbsram_close(FAR struct file *filep)
* Name: stm32_bbsram_seek
****************************************************************************/
static off_t stm32_bbsram_seek(FAR struct file *filep, off_t offset,
static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
int whence)
{
FAR struct inode *inode = filep->f_inode;
FAR struct stm32_bbsram_s *bbr;
struct inode *inode = filep->f_inode;
struct stm32_bbsram_s *bbr;
off_t newpos;
int ret;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct stm32_bbsram_s *)inode->i_private;
bbr = (struct stm32_bbsram_s *)inode->i_private;
ret = stm32_bbsram_semtake(bbr);
if (ret < 0)
@@ -448,15 +448,15 @@ static off_t stm32_bbsram_seek(FAR struct file *filep, off_t offset,
* Name: stm32_bbsram_read
****************************************************************************/
static ssize_t stm32_bbsram_read(FAR struct file *filep, FAR char *buffer,
static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
size_t len)
{
FAR struct inode *inode = filep->f_inode;
FAR struct stm32_bbsram_s *bbr;
struct inode *inode = filep->f_inode;
struct stm32_bbsram_s *bbr;
int ret;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct stm32_bbsram_s *)inode->i_private;
bbr = (struct stm32_bbsram_s *)inode->i_private;
ret = stm32_bbsram_semtake(bbr);
if (ret < 0)
@@ -481,8 +481,8 @@ static ssize_t stm32_bbsram_read(FAR struct file *filep, FAR char *buffer,
* Name: stm32_bbsram_internal_write
****************************************************************************/
static ssize_t stm32_bbsram_internal_write(FAR struct bbsramfh_s *bbf,
FAR const char *buffer,
static ssize_t stm32_bbsram_internal_write(struct bbsramfh_s *bbf,
const char *buffer,
off_t offset, size_t len)
{
bbf->dirty = 1;
@@ -494,15 +494,15 @@ static ssize_t stm32_bbsram_internal_write(FAR struct bbsramfh_s *bbf,
* Name: stm32_bbsram_write
****************************************************************************/
static ssize_t stm32_bbsram_write(FAR struct file *filep,
FAR const char *buffer, size_t len)
static ssize_t stm32_bbsram_write(struct file *filep,
const char *buffer, size_t len)
{
FAR struct inode *inode = filep->f_inode;
FAR struct stm32_bbsram_s *bbr;
struct inode *inode = filep->f_inode;
struct stm32_bbsram_s *bbr;
int ret = -EFBIG;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct stm32_bbsram_s *)inode->i_private;
bbr = (struct stm32_bbsram_s *)inode->i_private;
/* Forbid writes past the end of the device */
@@ -540,7 +540,7 @@ static ssize_t stm32_bbsram_write(FAR struct file *filep,
* Name: stm32_bbsram_poll
****************************************************************************/
static int stm32_bbsram_poll(FAR struct file *filep, FAR struct pollfd *fds,
static int stm32_bbsram_poll(struct file *filep, struct pollfd *fds,
bool setup)
{
if (setup)
@@ -562,19 +562,19 @@ static int stm32_bbsram_poll(FAR struct file *filep, FAR struct pollfd *fds,
*
****************************************************************************/
static int stm32_bbsram_ioctl(FAR struct file *filep, int cmd,
static int stm32_bbsram_ioctl(struct file *filep, int cmd,
unsigned long arg)
{
FAR struct inode *inode = filep->f_inode;
FAR struct stm32_bbsram_s *bbr;
struct inode *inode = filep->f_inode;
struct stm32_bbsram_s *bbr;
int ret = -ENOTTY;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct stm32_bbsram_s *)inode->i_private;
bbr = (struct stm32_bbsram_s *)inode->i_private;
if (cmd == STM32_BBSRAM_GETDESC_IOCTL)
{
FAR struct bbsramd_s *bbrr = (FAR struct bbsramd_s *)((uintptr_t)arg);
struct bbsramd_s *bbrr = (struct bbsramd_s *)((uintptr_t)arg);
ret = stm32_bbsram_semtake(bbr);
if (ret < 0)
@@ -617,13 +617,13 @@ static int stm32_bbsram_ioctl(FAR struct file *filep, int cmd,
****************************************************************************/
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
static int stm32_bbsram_unlink(FAR struct inode *inode)
static int stm32_bbsram_unlink(struct inode *inode)
{
FAR struct stm32_bbsram_s *bbr;
struct stm32_bbsram_s *bbr;
int ret;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct stm32_bbsram_s *)inode->i_private;
bbr = (struct stm32_bbsram_s *)inode->i_private;
ret = stm32_bbsram_semtake(bbr);
if (ret < 0)
@@ -818,7 +818,7 @@ int stm32_bbsraminitialize(char *devpath, int *sizes)
#if defined(CONFIG_STM32_SAVE_CRASHDUMP)
int stm32_bbsram_savepanic(int fileno, uint8_t *context, int length)
{
FAR struct bbsramfh_s *bbf;
struct bbsramfh_s *bbf;
int fill;
int ret = -ENOSPC;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -121,7 +121,7 @@ extern "C"
****************************************************************************/
struct can_dev_s;
FAR struct can_dev_s *stm32_caninitialize(int port);
struct can_dev_s *stm32_caninitialize(int port);
#endif
#ifdef CONFIG_STM32_CAN_SOCKET
File diff suppressed because it is too large Load Diff
+16 -16
View File
@@ -118,7 +118,7 @@ struct stm32_cap_priv_s
/* Get a 16-bit register value by offset */
static inline
uint16_t stm32_getreg16(FAR const struct stm32_cap_priv_s *priv,
uint16_t stm32_getreg16(const struct stm32_cap_priv_s *priv,
uint8_t offset)
{
return getreg16(priv->base + offset);
@@ -126,7 +126,7 @@ uint16_t stm32_getreg16(FAR const struct stm32_cap_priv_s *priv,
/* Put a 16-bit register value by offset */
static inline void stm32_putreg16(FAR const struct stm32_cap_priv_s *priv,
static inline void stm32_putreg16(const struct stm32_cap_priv_s *priv,
uint8_t offset, uint16_t value)
{
putreg16(value, priv->base + offset);
@@ -134,7 +134,7 @@ static inline void stm32_putreg16(FAR const struct stm32_cap_priv_s *priv,
/* Modify a 16-bit register value by offset */
static inline void stm32_modifyreg16(FAR const struct stm32_cap_priv_s *priv,
static inline void stm32_modifyreg16(const struct stm32_cap_priv_s *priv,
uint8_t offset, uint16_t clearbits,
uint16_t setbits)
{
@@ -146,7 +146,7 @@ static inline void stm32_modifyreg16(FAR const struct stm32_cap_priv_s *priv,
*/
static inline
uint32_t stm32_getreg32(FAR const struct stm32_cap_priv_s *priv,
uint32_t stm32_getreg32(const struct stm32_cap_priv_s *priv,
uint8_t offset)
{
return getreg32(priv->base + offset);
@@ -156,7 +156,7 @@ uint32_t stm32_getreg32(FAR const struct stm32_cap_priv_s *priv,
* 32-bit registers (CNT, ARR, CRR1-4) in the 32-bit timers TIM2 and TIM5.
*/
static inline void stm32_putreg32(FAR const struct stm32_cap_priv_s *priv,
static inline void stm32_putreg32(const struct stm32_cap_priv_s *priv,
uint8_t offset, uint32_t value)
{
putreg32(value, priv->base + offset);
@@ -167,7 +167,7 @@ static inline void stm32_putreg32(FAR const struct stm32_cap_priv_s *priv,
****************************************************************************/
static inline
uint32_t stm32_cap_gpio(FAR const struct stm32_cap_priv_s *priv,
uint32_t stm32_cap_gpio(const struct stm32_cap_priv_s *priv,
int channel)
{
switch (priv->base)
@@ -510,7 +510,7 @@ uint32_t stm32_cap_gpio(FAR const struct stm32_cap_priv_s *priv,
return 0;
}
static inline int stm32_cap_set_rcc(FAR const struct stm32_cap_priv_s *priv,
static inline int stm32_cap_set_rcc(const struct stm32_cap_priv_s *priv,
bool on)
{
uint32_t offset = 0;
@@ -616,7 +616,7 @@ static inline int stm32_cap_set_rcc(FAR const struct stm32_cap_priv_s *priv,
* Basic Functions
****************************************************************************/
static int stm32_cap_setclock(FAR struct stm32_cap_dev_s *dev,
static int stm32_cap_setclock(struct stm32_cap_dev_s *dev,
stm32_cap_clk_t clk,
uint32_t prescaler, uint32_t max)
{
@@ -691,7 +691,7 @@ static int stm32_cap_setclock(FAR struct stm32_cap_dev_s *dev,
return prescaler;
}
static int stm32_cap_setisr(FAR struct stm32_cap_dev_s *dev, xcpt_t handler,
static int stm32_cap_setisr(struct stm32_cap_dev_s *dev, xcpt_t handler,
void *arg)
{
const struct stm32_cap_priv_s *priv = (const struct stm32_cap_priv_s *)dev;
@@ -741,7 +741,7 @@ static int stm32_cap_setisr(FAR struct stm32_cap_dev_s *dev, xcpt_t handler,
return OK;
}
static void stm32_cap_enableint(FAR struct stm32_cap_dev_s *dev,
static void stm32_cap_enableint(struct stm32_cap_dev_s *dev,
stm32_cap_flags_t src, bool on)
{
const struct stm32_cap_priv_s *priv = (const struct stm32_cap_priv_s *)dev;
@@ -786,7 +786,7 @@ static void stm32_cap_enableint(FAR struct stm32_cap_dev_s *dev,
}
}
static void stm32_cap_ackflags(FAR struct stm32_cap_dev_s *dev, int flags)
static void stm32_cap_ackflags(struct stm32_cap_dev_s *dev, int flags)
{
const struct stm32_cap_priv_s *priv = (const struct stm32_cap_priv_s *)dev;
uint16_t mask = 0;
@@ -839,7 +839,7 @@ static void stm32_cap_ackflags(FAR struct stm32_cap_dev_s *dev, int flags)
stm32_putreg16(priv, STM32_BTIM_SR_OFFSET, ~mask);
}
static stm32_cap_flags_t stm32_cap_getflags(FAR struct stm32_cap_dev_s *dev)
static stm32_cap_flags_t stm32_cap_getflags(struct stm32_cap_dev_s *dev)
{
const struct stm32_cap_priv_s *priv = (const struct stm32_cap_priv_s *)dev;
uint16_t regval = 0;
@@ -899,7 +899,7 @@ static stm32_cap_flags_t stm32_cap_getflags(FAR struct stm32_cap_dev_s *dev)
* General Functions
****************************************************************************/
static int stm32_cap_setchannel(FAR struct stm32_cap_dev_s *dev,
static int stm32_cap_setchannel(struct stm32_cap_dev_s *dev,
uint8_t channel,
stm32_cap_ch_cfg_t cfg)
{
@@ -1008,7 +1008,7 @@ static int stm32_cap_setchannel(FAR struct stm32_cap_dev_s *dev,
return OK;
}
static uint32_t stm32_cap_getcapture(FAR struct stm32_cap_dev_s *dev,
static uint32_t stm32_cap_getcapture(struct stm32_cap_dev_s *dev,
uint8_t channel)
{
const struct stm32_cap_priv_s *priv = (const struct stm32_cap_priv_s *)dev;
@@ -1284,7 +1284,7 @@ static inline const struct stm32_cap_priv_s * stm32_cap_get_priv(int timer)
* Public Function - Initialization
****************************************************************************/
FAR struct stm32_cap_dev_s *stm32_cap_init(int timer)
struct stm32_cap_dev_s *stm32_cap_init(int timer)
{
const struct stm32_cap_priv_s *priv = stm32_cap_get_priv(timer);
uint32_t gpio;
@@ -1307,7 +1307,7 @@ FAR struct stm32_cap_dev_s *stm32_cap_init(int timer)
return (struct stm32_cap_dev_s *)priv;
}
int stm32_cap_deinit(FAR struct stm32_cap_dev_s * dev)
int stm32_cap_deinit(struct stm32_cap_dev_s * dev)
{
const struct stm32_cap_priv_s *priv = (struct stm32_cap_priv_s *)dev;
uint32_t gpio;
+9 -9
View File
@@ -159,16 +159,16 @@ typedef enum
struct stm32_cap_ops_s
{
int (*setclock)(FAR struct stm32_cap_dev_s *dev, stm32_cap_clk_t clk,
int (*setclock)(struct stm32_cap_dev_s *dev, stm32_cap_clk_t clk,
uint32_t prescaler, uint32_t max);
int (*setchannel)(FAR struct stm32_cap_dev_s *dev, uint8_t channel,
int (*setchannel)(struct stm32_cap_dev_s *dev, uint8_t channel,
stm32_cap_ch_cfg_t cfg);
uint32_t (*getcapture)(FAR struct stm32_cap_dev_s *dev, uint8_t channel);
int (*setisr)(FAR struct stm32_cap_dev_s *dev, xcpt_t handler, void *arg);
void (*enableint)(FAR struct stm32_cap_dev_s *dev, stm32_cap_flags_t src,
uint32_t (*getcapture)(struct stm32_cap_dev_s *dev, uint8_t channel);
int (*setisr)(struct stm32_cap_dev_s *dev, xcpt_t handler, void *arg);
void (*enableint)(struct stm32_cap_dev_s *dev, stm32_cap_flags_t src,
bool on);
void (*ackflags)(FAR struct stm32_cap_dev_s *dev, int flags);
stm32_cap_flags_t (*getflags)(FAR struct stm32_cap_dev_s *dev);
void (*ackflags)(struct stm32_cap_dev_s *dev, int flags);
stm32_cap_flags_t (*getflags)(struct stm32_cap_dev_s *dev);
};
/****************************************************************************
@@ -177,11 +177,11 @@ struct stm32_cap_ops_s
/* Power-up timer and get its structure */
FAR struct stm32_cap_dev_s *stm32_cap_init(int timer);
struct stm32_cap_dev_s *stm32_cap_init(int timer);
/* Power-down timer, mark it as unused */
int stm32_cap_deinit(FAR struct stm32_cap_dev_s *dev);
int stm32_cap_deinit(struct stm32_cap_dev_s *dev);
#undef EXTERN
#if defined(__cplusplus)
+1 -1
View File
@@ -32,7 +32,7 @@
* Public Data
****************************************************************************/
FAR struct mm_heap_s *g_ccm_heap;
struct mm_heap_s *g_ccm_heap;
/****************************************************************************
* Public Functions
+2 -2
View File
@@ -69,7 +69,7 @@
*/
#define ccm_initialize() \
g_ccm_heap = mm_initialize("ccm", (FAR void *)CCM_START, CCM_END-CCM_START)
g_ccm_heap = mm_initialize("ccm", (void *)CCM_START, CCM_END-CCM_START)
/* The ccm_addregion interface could be used if, for example, you want to
* add some other memory region to the CCM heap. I don't really know why
@@ -107,7 +107,7 @@ extern "C"
#define EXTERN extern
#endif
EXTERN FAR struct mm_heap_s *g_ccm_heap;
EXTERN struct mm_heap_s *g_ccm_heap;
/****************************************************************************
* Public Function Prototypes
+1 -1
View File
@@ -76,7 +76,7 @@ extern "C"
*
****************************************************************************/
FAR struct comp_dev_s *stm32_compinitialize(int intf);
struct comp_dev_s *stm32_compinitialize(int intf);
#undef EXTERN
#ifdef __cplusplus
+26 -26
View File
@@ -156,26 +156,26 @@ struct stm32_comp_s
/* COMP Register access */
static inline void comp_modify_csr(FAR struct stm32_comp_s *priv,
static inline void comp_modify_csr(struct stm32_comp_s *priv,
uint32_t clearbits, uint32_t setbits);
static inline uint32_t comp_getreg_csr(FAR struct stm32_comp_s *priv);
static inline void comp_putreg_csr(FAR struct stm32_comp_s *priv,
static inline uint32_t comp_getreg_csr(struct stm32_comp_s *priv);
static inline void comp_putreg_csr(struct stm32_comp_s *priv,
uint32_t value);
static bool stm32_complock_get(FAR struct stm32_comp_s *priv);
static int stm32_complock(FAR struct stm32_comp_s *priv, bool lock);
static bool stm32_complock_get(struct stm32_comp_s *priv);
static int stm32_complock(struct stm32_comp_s *priv, bool lock);
/* COMP Driver Methods */
static void comp_shutdown(FAR struct comp_dev_s *dev);
static int comp_setup(FAR struct comp_dev_s *dev);
static int comp_read(FAR struct comp_dev_s *dev);
static int comp_ioctl(FAR struct comp_dev_s *dev, int cmd,
static void comp_shutdown(struct comp_dev_s *dev);
static int comp_setup(struct comp_dev_s *dev);
static int comp_read(struct comp_dev_s *dev);
static int comp_ioctl(struct comp_dev_s *dev, int cmd,
unsigned long arg);
/* Initialization */
static int stm32_compconfig(FAR struct stm32_comp_s *priv);
static int stm32_compenable(FAR struct stm32_comp_s *priv, bool enable);
static int stm32_compconfig(struct stm32_comp_s *priv);
static int stm32_compenable(struct stm32_comp_s *priv, bool enable);
/****************************************************************************
* Private Data
@@ -363,7 +363,7 @@ static struct comp_dev_s g_comp7dev =
*
****************************************************************************/
static inline void comp_modify_csr(FAR struct stm32_comp_s *priv,
static inline void comp_modify_csr(struct stm32_comp_s *priv,
uint32_t clearbits, uint32_t setbits)
{
uint32_t csr = priv->csr;
@@ -385,7 +385,7 @@ static inline void comp_modify_csr(FAR struct stm32_comp_s *priv,
*
****************************************************************************/
static inline uint32_t comp_getreg_csr(FAR struct stm32_comp_s *priv)
static inline uint32_t comp_getreg_csr(struct stm32_comp_s *priv)
{
uint32_t csr = priv->csr;
@@ -407,7 +407,7 @@ static inline uint32_t comp_getreg_csr(FAR struct stm32_comp_s *priv)
*
****************************************************************************/
static inline void comp_putreg_csr(FAR struct stm32_comp_s *priv,
static inline void comp_putreg_csr(struct stm32_comp_s *priv,
uint32_t value)
{
uint32_t csr = priv->csr;
@@ -429,7 +429,7 @@ static inline void comp_putreg_csr(FAR struct stm32_comp_s *priv,
*
****************************************************************************/
static bool stm32_complock_get(FAR struct stm32_comp_s *priv)
static bool stm32_complock_get(struct stm32_comp_s *priv)
{
uint32_t regval;
@@ -453,7 +453,7 @@ static bool stm32_complock_get(FAR struct stm32_comp_s *priv)
*
****************************************************************************/
static int stm32_complock(FAR struct stm32_comp_s *priv, bool lock)
static int stm32_complock(struct stm32_comp_s *priv, bool lock)
{
bool current;
@@ -497,7 +497,7 @@ static int stm32_complock(FAR struct stm32_comp_s *priv, bool lock)
*
****************************************************************************/
static int stm32_compconfig(FAR struct stm32_comp_s *priv)
static int stm32_compconfig(struct stm32_comp_s *priv)
{
uint32_t regval = 0;
int index;
@@ -834,7 +834,7 @@ static int stm32_compconfig(FAR struct stm32_comp_s *priv)
*
****************************************************************************/
static int stm32_compenable(FAR struct stm32_comp_s *priv, bool enable)
static int stm32_compenable(struct stm32_comp_s *priv, bool enable)
{
bool lock;
@@ -882,7 +882,7 @@ static int stm32_compenable(FAR struct stm32_comp_s *priv, bool enable)
*
****************************************************************************/
static int comp_setup(FAR struct comp_dev_s *dev)
static int comp_setup(struct comp_dev_s *dev)
{
#warning "Missing logic"
@@ -904,7 +904,7 @@ static int comp_setup(FAR struct comp_dev_s *dev)
*
****************************************************************************/
static void comp_shutdown(FAR struct comp_dev_s *dev)
static void comp_shutdown(struct comp_dev_s *dev)
{
#warning "Missing logic"
}
@@ -923,9 +923,9 @@ static void comp_shutdown(FAR struct comp_dev_s *dev)
*
****************************************************************************/
static int comp_read(FAR struct comp_dev_s *dev)
static int comp_read(struct comp_dev_s *dev)
{
FAR struct stm32_comp_s *priv;
struct stm32_comp_s *priv;
uint32_t regval;
priv = dev->ad_priv;
@@ -950,7 +950,7 @@ static int comp_read(FAR struct comp_dev_s *dev)
*
****************************************************************************/
static int comp_ioctl(FAR struct comp_dev_s *dev, int cmd, unsigned long arg)
static int comp_ioctl(struct comp_dev_s *dev, int cmd, unsigned long arg)
{
#warning "Missing logic"
return -ENOTTY;
@@ -978,10 +978,10 @@ static int comp_ioctl(FAR struct comp_dev_s *dev, int cmd, unsigned long arg)
*
****************************************************************************/
FAR struct comp_dev_s *stm32_compinitialize(int intf)
struct comp_dev_s *stm32_compinitialize(int intf)
{
FAR struct comp_dev_s *dev;
FAR struct stm32_comp_s *comp;
struct comp_dev_s *dev;
struct stm32_comp_s *comp;
int ret;
switch (intf)
+35 -35
View File
@@ -80,31 +80,31 @@ struct stm32_comp_s
/* COMP Register access */
static inline void comp_modify_csr(FAR struct stm32_comp_s *priv,
uint32_t clearbits, uint32_t setbits);
static inline uint32_t comp_getreg_csr(FAR struct stm32_comp_s *priv);
static inline void comp_putreg_csr(FAR struct stm32_comp_s *priv,
uint32_t value);
static inline void comp_modify_csr(struct stm32_comp_s *priv,
uint32_t clearbits, uint32_t setbits);
static inline uint32_t comp_getreg_csr(struct stm32_comp_s *priv);
static inline void comp_putreg_csr(struct stm32_comp_s *priv,
uint32_t value);
/* COMP Driver Methods */
#if defined (CONFIG_COMP)
static void comp_shutdown(FAR struct comp_dev_s *dev);
static int comp_setup(FAR struct comp_dev_s *dev);
static int comp_read(FAR struct comp_dev_s *dev);
static int comp_ioctl(FAR struct comp_dev_s *dev, int cmd,
unsigned long arg);
static void comp_shutdown(struct comp_dev_s *dev);
static int comp_setup(struct comp_dev_s *dev);
static int comp_read(struct comp_dev_s *dev);
static int comp_ioctl(struct comp_dev_s *dev, int cmd,
unsigned long arg);
#endif
static int comp_config(FAR struct stm32_comp_s *priv);
static int comp_enable(FAR struct stm32_comp_s *priv, bool enable);
static bool comp_lock_get(FAR struct stm32_comp_s *priv);
static int comp_lock_set(FAR struct stm32_comp_s *priv, bool lock);
static int comp_config(struct stm32_comp_s *priv);
static int comp_enable(struct stm32_comp_s *priv, bool enable);
static bool comp_lock_get(struct stm32_comp_s *priv);
static int comp_lock_set(struct stm32_comp_s *priv, bool lock);
static int comp_config_inmpin(FAR struct stm32_comp_s *priv);
static int comp_config_inppin(FAR struct stm32_comp_s *priv);
static int comp_config_inmpin(struct stm32_comp_s *priv);
static int comp_config_inppin(struct stm32_comp_s *priv);
#if defined(COMP_OUT_GPIO)
static int comp_config_outpin(FAR struct stm32_comp_s *priv);
static int comp_config_outpin(struct stm32_comp_s *priv);
#endif
/****************************************************************************
@@ -295,7 +295,7 @@ static struct comp_dev_s g_comp7dev =
*
****************************************************************************/
static inline void comp_modify_csr(FAR struct stm32_comp_s *priv,
static inline void comp_modify_csr(struct stm32_comp_s *priv,
uint32_t clearbits, uint32_t setbits)
{
uint32_t csr = priv->csr;
@@ -317,7 +317,7 @@ static inline void comp_modify_csr(FAR struct stm32_comp_s *priv,
*
****************************************************************************/
static inline uint32_t comp_getreg_csr(FAR struct stm32_comp_s *priv)
static inline uint32_t comp_getreg_csr(struct stm32_comp_s *priv)
{
uint32_t csr = priv->csr;
@@ -339,7 +339,7 @@ static inline uint32_t comp_getreg_csr(FAR struct stm32_comp_s *priv)
*
****************************************************************************/
static inline void comp_putreg_csr(FAR struct stm32_comp_s *priv,
static inline void comp_putreg_csr(struct stm32_comp_s *priv,
uint32_t value)
{
uint32_t csr = priv->csr;
@@ -361,7 +361,7 @@ static inline void comp_putreg_csr(FAR struct stm32_comp_s *priv,
*
****************************************************************************/
static bool comp_lock_get(FAR struct stm32_comp_s *priv)
static bool comp_lock_get(struct stm32_comp_s *priv)
{
uint32_t regval;
@@ -385,7 +385,7 @@ static bool comp_lock_get(FAR struct stm32_comp_s *priv)
*
****************************************************************************/
static int comp_lock_set(FAR struct stm32_comp_s *priv, bool lock)
static int comp_lock_set(struct stm32_comp_s *priv, bool lock)
{
if (comp_lock_get(priv))
{
@@ -425,7 +425,7 @@ static int comp_lock_set(FAR struct stm32_comp_s *priv, bool lock)
*
****************************************************************************/
static int comp_config_inmpin(FAR struct stm32_comp_s *priv)
static int comp_config_inmpin(struct stm32_comp_s *priv)
{
# if defined(CONFIG_STM32_COMP1)
if (priv->csr == STM32_COMP1_CSR)
@@ -495,7 +495,7 @@ static int comp_config_inmpin(FAR struct stm32_comp_s *priv)
*
****************************************************************************/
static int comp_config_inppin(FAR struct stm32_comp_s *priv)
static int comp_config_inppin(struct stm32_comp_s *priv)
{
# if defined(CONFIG_STM32_COMP1)
if (priv->csr == STM32_COMP1_CSR)
@@ -564,7 +564,7 @@ static int comp_config_inppin(FAR struct stm32_comp_s *priv)
****************************************************************************/
#if defined(COMP_OUT_GPIO)
static int comp_config_outpin(FAR struct stm32_comp_s *priv)
static int comp_config_outpin(struct stm32_comp_s *priv)
{
# if defined(CONFIG_STM32_COMP1_OUT)
if (priv->csr == STM32_COMP1_CSR)
@@ -637,7 +637,7 @@ static int comp_config_outpin(FAR struct stm32_comp_s *priv)
*
****************************************************************************/
static int comp_config(FAR struct stm32_comp_s *priv)
static int comp_config(struct stm32_comp_s *priv)
{
uint32_t regval = 0;
uint32_t value = 0;
@@ -774,7 +774,7 @@ static int comp_config(FAR struct stm32_comp_s *priv)
*
****************************************************************************/
static int comp_enable(FAR struct stm32_comp_s *priv, bool enable)
static int comp_enable(struct stm32_comp_s *priv, bool enable)
{
bool lock;
@@ -823,7 +823,7 @@ static int comp_enable(FAR struct stm32_comp_s *priv, bool enable)
****************************************************************************/
#ifdef CONFIG_COMP
static int comp_setup(FAR struct comp_dev_s *dev)
static int comp_setup(struct comp_dev_s *dev)
{
#warning "Missing logic"
@@ -847,7 +847,7 @@ static int comp_setup(FAR struct comp_dev_s *dev)
****************************************************************************/
#ifdef CONFIG_COMP
static void comp_shutdown(FAR struct comp_dev_s *dev)
static void comp_shutdown(struct comp_dev_s *dev)
{
# warning "Missing logic"
}
@@ -868,9 +868,9 @@ static void comp_shutdown(FAR struct comp_dev_s *dev)
****************************************************************************/
#ifdef CONFIG_COMP
static int comp_read(FAR struct comp_dev_s *dev)
static int comp_read(struct comp_dev_s *dev)
{
FAR struct stm32_comp_s *priv;
struct stm32_comp_s *priv;
uint32_t regval;
priv = dev->ad_priv;
@@ -897,7 +897,7 @@ static int comp_read(FAR struct comp_dev_s *dev)
****************************************************************************/
#ifdef CONFIG_COMP
static int comp_ioctl(FAR struct comp_dev_s *dev, int cmd, unsigned long arg)
static int comp_ioctl(struct comp_dev_s *dev, int cmd, unsigned long arg)
{
#warning "Missing logic"
return -ENOTTY;
@@ -926,10 +926,10 @@ static int comp_ioctl(FAR struct comp_dev_s *dev, int cmd, unsigned long arg)
*
****************************************************************************/
FAR struct comp_dev_s *stm32_compinitialize(int intf)
struct comp_dev_s *stm32_compinitialize(int intf)
{
FAR struct comp_dev_s *dev;
FAR struct stm32_comp_s *comp;
struct comp_dev_s *dev;
struct stm32_comp_s *comp;
int ret;
switch (intf)
+19 -19
View File
@@ -55,9 +55,9 @@
struct stm32_cordic_s
{
FAR const struct cordic_ops_s *ops; /* Lower half operations */
uint32_t base; /* The base address of the CORDIC */
bool inuse; /* True: driver is in-use */
const struct cordic_ops_s *ops; /* Lower half operations */
uint32_t base; /* The base address of the CORDIC */
bool inuse; /* True: driver is in-use */
};
/****************************************************************************
@@ -66,14 +66,14 @@ struct stm32_cordic_s
/* Register access */
static uint32_t cordic_getreg(FAR struct stm32_cordic_s *priv, int offset);
static void cordic_putreg(FAR struct stm32_cordic_s *priv, int offset,
static uint32_t cordic_getreg(struct stm32_cordic_s *priv, int offset);
static void cordic_putreg(struct stm32_cordic_s *priv, int offset,
uint32_t value);
/* Ops */
int cordic_calc(FAR struct cordic_lowerhalf_s *lower,
FAR struct cordic_calc_s *calc);
int cordic_calc(struct cordic_lowerhalf_s *lower,
struct cordic_calc_s *calc);
/****************************************************************************
* Private Data
@@ -103,7 +103,7 @@ struct stm32_cordic_s g_stm32_cordic_dev =
* Name: cordic_getreg
****************************************************************************/
static uint32_t cordic_getreg(FAR struct stm32_cordic_s *priv, int offset)
static uint32_t cordic_getreg(struct stm32_cordic_s *priv, int offset)
{
return getreg32(priv->base + offset);
}
@@ -112,7 +112,7 @@ static uint32_t cordic_getreg(FAR struct stm32_cordic_s *priv, int offset)
* Name: cordic_putreg
****************************************************************************/
static void cordic_putreg(FAR struct stm32_cordic_s *priv, int offset,
static void cordic_putreg(struct stm32_cordic_s *priv, int offset,
uint32_t value)
{
putreg32(value, priv->base + offset);
@@ -122,14 +122,14 @@ static void cordic_putreg(FAR struct stm32_cordic_s *priv, int offset,
* Name: cordic_calc
****************************************************************************/
int cordic_calc(FAR struct cordic_lowerhalf_s *lower,
FAR struct cordic_calc_s *calc)
int cordic_calc(struct cordic_lowerhalf_s *lower,
struct cordic_calc_s *calc)
{
FAR struct stm32_cordic_s *priv = (FAR struct stm32_cordic_s *)lower;
int ret = OK;
uint32_t csr = 0;
bool arg2_inc = false;
uint8_t scale = 0;
struct stm32_cordic_s *priv = (struct stm32_cordic_s *)lower;
int ret = OK;
uint32_t csr = 0;
bool arg2_inc = false;
uint8_t scale = 0;
DEBUGASSERT(lower);
DEBUGASSERT(calc);
@@ -306,9 +306,9 @@ errout:
*
****************************************************************************/
FAR struct cordic_lowerhalf_s *stm32_cordicinitialize(void)
struct cordic_lowerhalf_s *stm32_cordicinitialize(void)
{
FAR struct cordic_lowerhalf_s *lower = NULL;
struct cordic_lowerhalf_s *lower = NULL;
if (g_stm32_cordic_dev.inuse == true)
{
@@ -319,7 +319,7 @@ FAR struct cordic_lowerhalf_s *stm32_cordicinitialize(void)
/* Get lower-half device */
lower = (FAR struct cordic_lowerhalf_s *) &g_stm32_cordic_dev;
lower = (struct cordic_lowerhalf_s *) &g_stm32_cordic_dev;
/* The driver is now in-use */
+1 -1
View File
@@ -50,6 +50,6 @@
*
****************************************************************************/
FAR struct cordic_lowerhalf_s *stm32_cordicinitialize(void);
struct cordic_lowerhalf_s *stm32_cordicinitialize(void);
#endif /* __ARCH_ARM_SRC_STM32_STM32_CORDIC_H */
+35 -35
View File
@@ -592,39 +592,39 @@ struct stm32_chan_s
/* DAC Register access */
#ifdef HAVE_TIMER
static uint32_t tim_getreg(FAR struct stm32_chan_s *chan, int offset);
static void tim_putreg(FAR struct stm32_chan_s *chan, int offset,
static uint32_t tim_getreg(struct stm32_chan_s *chan, int offset);
static void tim_putreg(struct stm32_chan_s *chan, int offset,
uint32_t value);
static void tim_modifyreg(FAR struct stm32_chan_s *chan, int offset,
static void tim_modifyreg(struct stm32_chan_s *chan, int offset,
uint32_t clearbits, uint32_t setbits);
#endif
/* Interrupt handler */
#if 0 /* defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) */
static int dac_interrupt(int irq, FAR void *context, FAR void *arg);
static int dac_interrupt(int irq, void *context, void *arg);
#endif
/* DAC methods */
static void dac_reset(FAR struct dac_dev_s *dev);
static int dac_setup(FAR struct dac_dev_s *dev);
static void dac_shutdown(FAR struct dac_dev_s *dev);
static void dac_txint(FAR struct dac_dev_s *dev, bool enable);
static int dac_send(FAR struct dac_dev_s *dev, FAR struct dac_msg_s *msg);
static int dac_ioctl(FAR struct dac_dev_s *dev, int cmd, unsigned long arg);
static void dac_reset(struct dac_dev_s *dev);
static int dac_setup(struct dac_dev_s *dev);
static void dac_shutdown(struct dac_dev_s *dev);
static void dac_txint(struct dac_dev_s *dev, bool enable);
static int dac_send(struct dac_dev_s *dev, struct dac_msg_s *msg);
static int dac_ioctl(struct dac_dev_s *dev, int cmd, unsigned long arg);
/* Initialization */
#ifdef HAVE_DMA
# ifdef HAVE_TIMER
static int dac_timinit(FAR struct stm32_chan_s *chan);
static int dac_timinit(struct stm32_chan_s *chan);
# endif
static int dma_remap(FAR struct stm32_chan_s *chan);
static void dma_bufferinit(FAR struct stm32_chan_s *chan, uint16_t *buffer,
static int dma_remap(struct stm32_chan_s *chan);
static void dma_bufferinit(struct stm32_chan_s *chan, uint16_t *buffer,
uint16_t len);
#endif
static int dac_chaninit(FAR struct stm32_chan_s *chan);
static int dac_chaninit(struct stm32_chan_s *chan);
static int dac_blockinit(void);
/****************************************************************************
@@ -870,7 +870,7 @@ static struct stm32_dac_s g_dacblock;
*
****************************************************************************/
static inline void stm32_dac_modify_cr(FAR struct stm32_chan_s *chan,
static inline void stm32_dac_modify_cr(struct stm32_chan_s *chan,
uint32_t clearbits, uint32_t setbits)
{
unsigned int shift;
@@ -905,7 +905,7 @@ static inline void stm32_dac_modify_cr(FAR struct stm32_chan_s *chan,
*
****************************************************************************/
static uint32_t tim_getreg(FAR struct stm32_chan_s *chan, int offset)
static uint32_t tim_getreg(struct stm32_chan_s *chan, int offset)
{
return getreg32(chan->tbase + offset);
}
@@ -925,7 +925,7 @@ static uint32_t tim_getreg(FAR struct stm32_chan_s *chan, int offset)
*
****************************************************************************/
static void tim_putreg(FAR struct stm32_chan_s *chan, int offset,
static void tim_putreg(struct stm32_chan_s *chan, int offset,
uint32_t value)
{
putreg32(value, chan->tbase + offset);
@@ -948,7 +948,7 @@ static void tim_putreg(FAR struct stm32_chan_s *chan, int offset,
*
****************************************************************************/
static void tim_modifyreg(FAR struct stm32_chan_s *chan, int offset,
static void tim_modifyreg(struct stm32_chan_s *chan, int offset,
uint32_t clearbits, uint32_t setbits)
{
modifyreg32(chan->tbase + offset, clearbits, setbits);
@@ -970,7 +970,7 @@ static void tim_modifyreg(FAR struct stm32_chan_s *chan, int offset,
****************************************************************************/
#if 0 /* defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) */
static int dac_interrupt(int irq, FAR void *context, FAR void *arg)
static int dac_interrupt(int irq, void *context, void *arg)
{
#warning "Missing logic"
return OK;
@@ -993,7 +993,7 @@ static int dac_interrupt(int irq, FAR void *context, FAR void *arg)
*
****************************************************************************/
static void dac_reset(FAR struct dac_dev_s *dev)
static void dac_reset(struct dac_dev_s *dev)
{
irqstate_t flags;
@@ -1024,7 +1024,7 @@ static void dac_reset(FAR struct dac_dev_s *dev)
*
****************************************************************************/
static int dac_setup(FAR struct dac_dev_s *dev)
static int dac_setup(struct dac_dev_s *dev)
{
#warning "Missing logic"
return OK;
@@ -1044,7 +1044,7 @@ static int dac_setup(FAR struct dac_dev_s *dev)
*
****************************************************************************/
static void dac_shutdown(FAR struct dac_dev_s *dev)
static void dac_shutdown(struct dac_dev_s *dev)
{
#warning "Missing logic"
}
@@ -1062,7 +1062,7 @@ static void dac_shutdown(FAR struct dac_dev_s *dev)
*
****************************************************************************/
static void dac_txint(FAR struct dac_dev_s *dev, bool enable)
static void dac_txint(struct dac_dev_s *dev, bool enable)
{
#warning "Missing logic"
}
@@ -1081,7 +1081,7 @@ static void dac_txint(FAR struct dac_dev_s *dev, bool enable)
****************************************************************************/
#ifdef HAVE_DMA
static void dac_dmatxcallback(DMA_HANDLE handle, uint8_t isr, FAR void *arg)
static void dac_dmatxcallback(DMA_HANDLE handle, uint8_t isr, void *arg)
{
}
#endif
@@ -1099,9 +1099,9 @@ static void dac_dmatxcallback(DMA_HANDLE handle, uint8_t isr, FAR void *arg)
*
****************************************************************************/
static int dac_send(FAR struct dac_dev_s *dev, FAR struct dac_msg_s *msg)
static int dac_send(struct dac_dev_s *dev, struct dac_msg_s *msg)
{
FAR struct stm32_chan_s *chan = dev->ad_priv;
struct stm32_chan_s *chan = dev->ad_priv;
/* Enable DAC Channel */
@@ -1200,9 +1200,9 @@ static int dac_send(FAR struct dac_dev_s *dev, FAR struct dac_msg_s *msg)
*
****************************************************************************/
static int dac_ioctl(FAR struct dac_dev_s *dev, int cmd, unsigned long arg)
static int dac_ioctl(struct dac_dev_s *dev, int cmd, unsigned long arg)
{
FAR struct stm32_chan_s *chan = dev->ad_priv;
struct stm32_chan_s *chan = dev->ad_priv;
int ret = OK;
switch (cmd)
@@ -1239,7 +1239,7 @@ static int dac_ioctl(FAR struct dac_dev_s *dev, int cmd, unsigned long arg)
* Name: dma_bufferinit
****************************************************************************/
static void dma_bufferinit(FAR struct stm32_chan_s *chan, uint16_t *buffer,
static void dma_bufferinit(struct stm32_chan_s *chan, uint16_t *buffer,
uint16_t len)
{
memcpy(chan->dmabuffer, buffer, len);
@@ -1249,7 +1249,7 @@ static void dma_bufferinit(FAR struct stm32_chan_s *chan, uint16_t *buffer,
* Name: dma_remap
****************************************************************************/
static int dma_remap(FAR struct stm32_chan_s *chan)
static int dma_remap(struct stm32_chan_s *chan)
{
#if defined(CONFIG_STM32_STM32F33XX) || defined(CONFIG_STM32_STM32F30XX) || \
defined(CONFIG_STM32_STM32F37XX)
@@ -1330,7 +1330,7 @@ static int dma_remap(FAR struct stm32_chan_s *chan)
****************************************************************************/
#ifdef HAVE_TIMER
static int dac_timinit(FAR struct stm32_chan_s *chan)
static int dac_timinit(struct stm32_chan_s *chan)
{
uint32_t pclk;
uint32_t prescaler;
@@ -1499,7 +1499,7 @@ static int dac_timinit(FAR struct stm32_chan_s *chan)
*
****************************************************************************/
static int dac_chaninit(FAR struct stm32_chan_s *chan)
static int dac_chaninit(struct stm32_chan_s *chan)
{
uint16_t clearbits;
uint16_t setbits;
@@ -1719,10 +1719,10 @@ static int dac_blockinit(void)
*
****************************************************************************/
FAR struct dac_dev_s *stm32_dacinitialize(int intf)
struct dac_dev_s *stm32_dacinitialize(int intf)
{
FAR struct dac_dev_s *dev;
FAR struct stm32_chan_s *chan;
struct dac_dev_s *dev;
struct stm32_chan_s *chan;
int ret;
#ifdef CONFIG_STM32_DAC1CH1
+1 -1
View File
@@ -126,7 +126,7 @@ extern "C"
****************************************************************************/
struct dac_dev_s;
FAR struct dac_dev_s *stm32_dacinitialize(int intf);
struct dac_dev_s *stm32_dacinitialize(int intf);
#undef EXTERN
#ifdef __cplusplus
+1 -1
View File
@@ -65,7 +65,7 @@
* DMA channel (F1) or a DMA stream (F4).
*/
typedef FAR void *DMA_HANDLE;
typedef void *DMA_HANDLE;
/* Description:
* This is the type of the callback that is used to inform the user of the
+44 -44
View File
@@ -187,24 +187,24 @@ static const uintptr_t stm32_cmar_layer_t[DMA2D_NLAYERS - 1] =
/* Private functions */
static void stm32_dma2d_control(uint32_t setbits, uint32_t clrbits);
static int stm32_dma2dirq(int irq, void *context, FAR void *arg);
static int stm32_dma2dirq(int irq, void *context, void *arg);
static int stm32_dma2d_waitforirq(void);
static int stm32_dma2d_start(void);
#ifdef CONFIG_STM32_FB_CMAP
static int stm32_dma2d_loadclut(uintptr_t reg);
#endif
static uint32_t stm32_dma2d_memaddress(
FAR struct stm32_dma2d_overlay_s *oinfo,
struct stm32_dma2d_overlay_s *oinfo,
uint32_t xpos, uint32_t ypos);
static uint32_t stm32_dma2d_lineoffset(
FAR struct stm32_dma2d_overlay_s *oinfo,
FAR const struct fb_area_s *area);
static void stm32_dma2d_lfifo(FAR struct stm32_dma2d_overlay_s *oinfo,
struct stm32_dma2d_overlay_s *oinfo,
const struct fb_area_s *area);
static void stm32_dma2d_lfifo(struct stm32_dma2d_overlay_s *oinfo,
int lid,
uint32_t xpos, uint32_t ypos,
FAR const struct fb_area_s *area);
const struct fb_area_s *area);
static void stm32_dma2d_lcolor(int lid, uint32_t argb);
static void stm32_dma2d_llnr(FAR const struct fb_area_s *area);
static void stm32_dma2d_llnr(const struct fb_area_s *area);
static int stm32_dma2d_loutpfc(uint8_t fmt);
static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
uint8_t fmt);
@@ -212,21 +212,21 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
/* Public Functions */
#ifdef CONFIG_STM32_FB_CMAP
static int stm32_dma2d_setclut(FAR const struct fb_cmap_s *cmap);
static int stm32_dma2d_setclut(const struct fb_cmap_s *cmap);
#endif
static int stm32_dma2d_fillcolor(FAR struct stm32_dma2d_overlay_s *oinfo,
FAR const struct fb_area_s *area,
static int stm32_dma2d_fillcolor(struct stm32_dma2d_overlay_s *oinfo,
const struct fb_area_s *area,
uint32_t argb);
static int stm32_dma2d_blit(FAR struct stm32_dma2d_overlay_s *doverlay,
static int stm32_dma2d_blit(struct stm32_dma2d_overlay_s *doverlay,
uint32_t destxpos, uint32_t destypos,
FAR struct stm32_dma2d_overlay_s *soverlay,
FAR const struct fb_area_s *sarea);
static int stm32_dma2d_blend(FAR struct stm32_dma2d_overlay_s *doverlay,
struct stm32_dma2d_overlay_s *soverlay,
const struct fb_area_s *sarea);
static int stm32_dma2d_blend(struct stm32_dma2d_overlay_s *doverlay,
uint32_t destxpos, uint32_t destypos,
FAR struct stm32_dma2d_overlay_s *foverlay,
struct stm32_dma2d_overlay_s *foverlay,
uint32_t forexpos, uint32_t foreypos,
FAR struct stm32_dma2d_overlay_s *boverlay,
FAR const struct fb_area_s *barea);
struct stm32_dma2d_overlay_s *boverlay,
const struct fb_area_s *barea);
/****************************************************************************
* Private Data
@@ -325,11 +325,11 @@ static void stm32_dma2d_control(uint32_t setbits, uint32_t clrbits)
*
****************************************************************************/
static int stm32_dma2dirq(int irq, void *context, FAR void *arg)
static int stm32_dma2dirq(int irq, void *context, void *arg)
{
int ret;
uint32_t regval = getreg32(STM32_DMA2D_ISR);
FAR struct stm32_interrupt_s *priv = &g_interrupt;
struct stm32_interrupt_s *priv = &g_interrupt;
reginfo("irq = %d, regval = %08x\n", irq, regval);
@@ -430,7 +430,7 @@ static int stm32_dma2dirq(int irq, void *context, FAR void *arg)
static int stm32_dma2d_waitforirq(void)
{
int ret;
FAR struct stm32_interrupt_s *priv = &g_interrupt;
struct stm32_interrupt_s *priv = &g_interrupt;
ret = nxsem_wait(priv->sem);
@@ -527,11 +527,11 @@ static int stm32_dma2d_start(void)
****************************************************************************/
static uint32_t stm32_dma2d_memaddress(
FAR struct stm32_dma2d_overlay_s *oinfo,
struct stm32_dma2d_overlay_s *oinfo,
uint32_t xpos, uint32_t ypos)
{
uint32_t offset;
FAR struct fb_overlayinfo_s *poverlay = oinfo->oinfo;
struct fb_overlayinfo_s *poverlay = oinfo->oinfo;
offset = xpos * DMA2D_PF_BYPP(poverlay->bpp) + poverlay->stride * ypos;
@@ -555,8 +555,8 @@ static uint32_t stm32_dma2d_memaddress(
****************************************************************************/
static uint32_t stm32_dma2d_lineoffset(
FAR struct stm32_dma2d_overlay_s *oinfo,
FAR const struct fb_area_s *area)
struct stm32_dma2d_overlay_s *oinfo,
const struct fb_area_s *area)
{
uint32_t loffset;
@@ -581,9 +581,9 @@ static uint32_t stm32_dma2d_lineoffset(
*
****************************************************************************/
static void stm32_dma2d_lfifo(FAR struct stm32_dma2d_overlay_s *oinfo,
static void stm32_dma2d_lfifo(struct stm32_dma2d_overlay_s *oinfo,
int lid, uint32_t xpos, uint32_t ypos,
FAR const struct fb_area_s *area)
const struct fb_area_s *area)
{
lcdinfo("oinfo=%p, lid=%d, xpos=%" PRId32 ", ypos=%" PRId32 ", area=%p\n",
oinfo, lid, xpos, ypos, area);
@@ -622,7 +622,7 @@ static void stm32_dma2d_lcolor(int lid, uint32_t argb)
*
****************************************************************************/
static void stm32_dma2d_llnr(FAR const struct fb_area_s *area)
static void stm32_dma2d_llnr(const struct fb_area_s *area)
{
uint32_t nlrreg;
@@ -683,7 +683,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
#ifdef CONFIG_STM32_FB_CMAP
if (fmt == DMA2D_PF_L8)
{
FAR struct stm32_dma2d_s * layer = &g_dma2ddev;
struct stm32_dma2d_s * layer = &g_dma2ddev;
/* Load CLUT automatically */
@@ -744,10 +744,10 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
****************************************************************************/
#ifdef CONFIG_STM32_FB_CMAP
static int stm32_dma2d_setclut(FAR const struct fb_cmap_s *cmap)
static int stm32_dma2d_setclut(const struct fb_cmap_s *cmap)
{
int n;
FAR struct stm32_dma2d_s * priv = &g_dma2ddev;
struct stm32_dma2d_s * priv = &g_dma2ddev;
lcdinfo("cmap=%p\n", cmap);
@@ -812,12 +812,12 @@ static int stm32_dma2d_setclut(FAR const struct fb_cmap_s *cmap)
*
****************************************************************************/
static int stm32_dma2d_fillcolor(FAR struct stm32_dma2d_overlay_s *oinfo,
FAR const struct fb_area_s *area,
static int stm32_dma2d_fillcolor(struct stm32_dma2d_overlay_s *oinfo,
const struct fb_area_s *area,
uint32_t argb)
{
int ret;
FAR struct stm32_dma2d_s * priv = &g_dma2ddev;
struct stm32_dma2d_s * priv = &g_dma2ddev;
DEBUGASSERT(oinfo != NULL && oinfo->oinfo != NULL && area != NULL);
lcdinfo("oinfo=%p, argb=%08" PRIx32 "\n", oinfo, argb);
@@ -893,14 +893,14 @@ static int stm32_dma2d_fillcolor(FAR struct stm32_dma2d_overlay_s *oinfo,
*
****************************************************************************/
static int stm32_dma2d_blit(FAR struct stm32_dma2d_overlay_s *doverlay,
static int stm32_dma2d_blit(struct stm32_dma2d_overlay_s *doverlay,
uint32_t destxpos, uint32_t destypos,
FAR struct stm32_dma2d_overlay_s *soverlay,
FAR const struct fb_area_s *sarea)
struct stm32_dma2d_overlay_s *soverlay,
const struct fb_area_s *sarea)
{
int ret;
uint32_t mode;
FAR struct stm32_dma2d_s * priv = &g_dma2ddev;
struct stm32_dma2d_s * priv = &g_dma2ddev;
lcdinfo("doverlay=%p, destxpos=%" PRId32 ", destypos=%" PRId32
", soverlay=%p, sarea=%p\n",
@@ -991,15 +991,15 @@ static int stm32_dma2d_blit(FAR struct stm32_dma2d_overlay_s *doverlay,
*
****************************************************************************/
static int stm32_dma2d_blend(FAR struct stm32_dma2d_overlay_s *doverlay,
static int stm32_dma2d_blend(struct stm32_dma2d_overlay_s *doverlay,
uint32_t destxpos, uint32_t destypos,
FAR struct stm32_dma2d_overlay_s *foverlay,
struct stm32_dma2d_overlay_s *foverlay,
uint32_t forexpos, uint32_t foreypos,
FAR struct stm32_dma2d_overlay_s *boverlay,
FAR const struct fb_area_s *barea)
struct stm32_dma2d_overlay_s *boverlay,
const struct fb_area_s *barea)
{
int ret;
FAR struct stm32_dma2d_s * priv = &g_dma2ddev;
int ret;
struct stm32_dma2d_s * priv = &g_dma2ddev;
lcdinfo("doverlay=%p, destxpos=%" PRId32 ", destypos=%" PRId32 ", "
"foverlay=%p, forexpos=%" PRId32 ", foreypos=%" PRId32 ", "
@@ -1176,7 +1176,7 @@ void stm32_dma2duninitialize(void)
*
****************************************************************************/
FAR struct dma2d_layer_s *stm32_dma2ddev(void)
struct dma2d_layer_s *stm32_dma2ddev(void)
{
return &g_dma2ddev.dma2d;
}
+16 -16
View File
@@ -38,11 +38,11 @@
struct stm32_dma2d_overlay_s
{
uint8_t fmt; /* DMA2D pixel format */
uint8_t transp_mode; /* DMA2D transparency mode */
fb_coord_t xres; /* X-resolution overlay */
fb_coord_t yres; /* Y-resolution overlay */
FAR struct fb_overlayinfo_s *oinfo; /* Framebuffer overlay information */
uint8_t fmt; /* DMA2D pixel format */
uint8_t transp_mode; /* DMA2D transparency mode */
fb_coord_t xres; /* X-resolution overlay */
fb_coord_t yres; /* Y-resolution overlay */
struct fb_overlayinfo_s *oinfo; /* Framebuffer overlay information */
};
/* DMA2D is controlled by the following interface */
@@ -64,7 +64,7 @@ struct dma2d_layer_s
*/
#ifdef CONFIG_STM32_FB_CMAP
int (*setclut)(FAR const struct fb_cmap_s * cmap);
int (*setclut)(const struct fb_cmap_s * cmap);
#endif
/* Name: fillcolor
@@ -84,8 +84,8 @@ struct dma2d_layer_s
* On error - -EINVAL
*/
int (*fillcolor)(FAR struct stm32_dma2d_overlay_s *oinfo,
FAR const struct fb_area_s *area, uint32_t argb);
int (*fillcolor)(struct stm32_dma2d_overlay_s *oinfo,
const struct fb_area_s *area, uint32_t argb);
/* Name: blit
*
@@ -107,10 +107,10 @@ struct dma2d_layer_s
* On error - -EINVAL
*/
int (*blit)(FAR struct stm32_dma2d_overlay_s *doverlay,
int (*blit)(struct stm32_dma2d_overlay_s *doverlay,
uint32_t destxpos, uint32_t destypos,
FAR struct stm32_dma2d_overlay_s *soverlay,
FAR const struct fb_area_s *sarea);
struct stm32_dma2d_overlay_s *soverlay,
const struct fb_area_s *sarea);
/* Name: blend
*
@@ -135,12 +135,12 @@ struct dma2d_layer_s
* On error - -EINVAL or -ECANCELED
*/
int (*blend)(FAR struct stm32_dma2d_overlay_s *doverlay,
int (*blend)(struct stm32_dma2d_overlay_s *doverlay,
uint32_t destxpos, uint32_t destypos,
FAR struct stm32_dma2d_overlay_s *foverlay,
struct stm32_dma2d_overlay_s *foverlay,
uint32_t forexpos, uint32_t foreypos,
FAR struct stm32_dma2d_overlay_s *boverlay,
FAR const struct fb_area_s *barea);
struct stm32_dma2d_overlay_s *boverlay,
const struct fb_area_s *barea);
};
/****************************************************************************
@@ -160,7 +160,7 @@ struct dma2d_layer_s
*
****************************************************************************/
FAR struct dma2d_layer_s *stm32_dma2ddev(void);
struct dma2d_layer_s *stm32_dma2ddev(void);
/****************************************************************************
* Name: up_dma2dinitialize
+3 -3
View File
@@ -277,12 +277,12 @@ static inline void dmachan_putreg(struct stm32_dma_s *dmach,
*
****************************************************************************/
static int stm32_dmatake(FAR struct stm32_dma_s *dmach)
static int stm32_dmatake(struct stm32_dma_s *dmach)
{
return nxsem_wait_uninterruptible(&dmach->sem);
}
static inline void stm32_dmagive(FAR struct stm32_dma_s *dmach)
static inline void stm32_dmagive(struct stm32_dma_s *dmach)
{
nxsem_post(&dmach->sem);
}
@@ -358,7 +358,7 @@ static int irq_to_channel_index(int irq)
*
****************************************************************************/
static int stm32_dmainterrupt(int irq, void *context, FAR void *arg)
static int stm32_dmainterrupt(int irq, void *context, void *arg)
{
struct stm32_dma_s *dmach;
uint32_t isr;
+20 -20
View File
@@ -109,7 +109,7 @@ struct stm32_dmamux_s
uint32_t base; /* DMAMUX base address */
};
typedef FAR const struct stm32_dmamux_s *DMA_MUX;
typedef const struct stm32_dmamux_s *DMA_MUX;
/* This structure describes one DMA controller */
@@ -137,7 +137,7 @@ struct stm32_dmach_s
void *arg; /* Argument passed to callback function */
};
typedef FAR struct stm32_dmach_s *DMA_CHANNEL;
typedef struct stm32_dmach_s *DMA_CHANNEL;
/* DMA operations */
@@ -145,40 +145,40 @@ struct stm32_dma_ops_s
{
/* Disable the DMA transfer */
CODE void (*dma_disable)(DMA_CHANNEL dmachan);
void (*dma_disable)(DMA_CHANNEL dmachan);
/* DMA interrupt */
CODE int (*dma_interrupt)(int irq, void *context, FAR void *arg);
int (*dma_interrupt)(int irq, void *context, void *arg);
/* Setup the DMA */
CODE void (*dma_setup)(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
size_t ntransfers, uint32_t ccr);
void (*dma_setup)(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
size_t ntransfers, uint32_t ccr);
/* Start the DMA */
CODE void (*dma_start)(DMA_HANDLE handle, dma_callback_t callback,
void *arg, bool half);
void (*dma_start)(DMA_HANDLE handle, dma_callback_t callback,
void *arg, bool half);
/* Read remaining DMA bytes */
CODE size_t (*dma_residual)(DMA_HANDLE handle);
size_t (*dma_residual)(DMA_HANDLE handle);
/* Check the DMA configuration */
CODE bool (*dma_capable)(uint32_t maddr, uint32_t count, uint32_t ccr);
bool (*dma_capable)(uint32_t maddr, uint32_t count, uint32_t ccr);
#ifdef CONFIG_DEBUG_DMA_INFO
/* Sample the DMA registers */
CODE void (*dma_sample)(DMA_HANDLE handle, struct stm32_dmaregs_s *regs);
void (*dma_sample)(DMA_HANDLE handle, struct stm32_dmaregs_s *regs);
/* Dump the DMA registers */
CODE void (*dma_dump)(DMA_HANDLE handle,
const struct stm32_dmaregs_s *regs,
const char *msg);
void (*dma_dump)(DMA_HANDLE handle,
const struct stm32_dmaregs_s *regs,
const char *msg);
#endif
};
@@ -188,7 +188,7 @@ struct stm32_dma_ops_s
#if defined(CONFIG_STM32_DMA1) || defined(CONFIG_STM32_DMA2)
static void stm32_dma12_disable(DMA_CHANNEL dmachan);
static int stm32_dma12_interrupt(int irq, void *context, FAR void *arg);
static int stm32_dma12_interrupt(int irq, void *context, void *arg);
static void stm32_dma12_setup(DMA_HANDLE handle, uint32_t paddr,
uint32_t maddr, size_t ntransfers,
uint32_t ccr);
@@ -221,8 +221,8 @@ static void stm32_dmamux_dump(DMA_MUX dmamux, uint8_t channel,
#endif
static DMA_CHANNEL stm32_dma_channel_get(uint8_t channel,
uint8_t controller);
static void stm32_gdma_limits_get(uint8_t controller, FAR uint8_t *first,
FAR uint8_t *last);
static void stm32_gdma_limits_get(uint8_t controller, uint8_t *first,
uint8_t *last);
/****************************************************************************
* Private Data
@@ -597,8 +597,8 @@ static DMA_CHANNEL stm32_dma_channel_get(uint8_t channel,
*
****************************************************************************/
static void stm32_gdma_limits_get(uint8_t controller, FAR uint8_t *first,
FAR uint8_t *nchan)
static void stm32_gdma_limits_get(uint8_t controller, uint8_t *first,
uint8_t *nchan)
{
DEBUGASSERT(first != NULL);
DEBUGASSERT(nchan != NULL);
@@ -653,7 +653,7 @@ static void stm32_dma12_disable(DMA_CHANNEL dmachan)
*
****************************************************************************/
static int stm32_dma12_interrupt(int irq, void *context, FAR void *arg)
static int stm32_dma12_interrupt(int irq, void *context, void *arg)
{
DMA_CHANNEL dmachan;
uint32_t isr;
+6 -6
View File
@@ -235,12 +235,12 @@ static inline void dmast_putreg(struct stm32_dma_s *dmast, uint32_t offset,
*
****************************************************************************/
static int stm32_dmatake(FAR struct stm32_dma_s *dmast)
static int stm32_dmatake(struct stm32_dma_s *dmast)
{
return nxsem_wait_uninterruptible(&dmast->sem);
}
static inline void stm32_dmagive(FAR struct stm32_dma_s *dmast)
static inline void stm32_dmagive(struct stm32_dma_s *dmast)
{
nxsem_post(&dmast->sem);
}
@@ -254,8 +254,8 @@ static inline void stm32_dmagive(FAR struct stm32_dma_s *dmast)
*
****************************************************************************/
static inline FAR struct stm32_dma_s *stm32_dmastream(unsigned int stream,
unsigned int controller)
static inline struct stm32_dma_s *stm32_dmastream(unsigned int stream,
unsigned int controller)
{
int index;
@@ -284,7 +284,7 @@ static inline FAR struct stm32_dma_s *stm32_dmastream(unsigned int stream,
*
****************************************************************************/
static inline FAR struct stm32_dma_s *stm32_dmamap(unsigned long dmamap)
static inline struct stm32_dma_s *stm32_dmamap(unsigned long dmamap)
{
/* Extract the DMA controller number from the bit encoded value */
@@ -511,7 +511,7 @@ void weak_function arm_dma_initialize(void)
DMA_HANDLE stm32_dmachannel(unsigned int dmamap)
{
FAR struct stm32_dma_s *dmast;
struct stm32_dma_s *dmast;
int ret;
/* Get the stream index from the bit-encoded channel value */
+88 -88
View File
@@ -608,7 +608,7 @@
* header
*/
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
@@ -678,41 +678,41 @@ static void stm32_checksetup(void);
/* Free buffer management */
static void stm32_initbuffer(FAR struct stm32_ethmac_s *priv);
static inline uint8_t *stm32_allocbuffer(FAR struct stm32_ethmac_s *priv);
static inline void stm32_freebuffer(FAR struct stm32_ethmac_s *priv,
static void stm32_initbuffer(struct stm32_ethmac_s *priv);
static inline uint8_t *stm32_allocbuffer(struct stm32_ethmac_s *priv);
static inline void stm32_freebuffer(struct stm32_ethmac_s *priv,
uint8_t *buffer);
static inline bool stm32_isfreebuffer(FAR struct stm32_ethmac_s *priv);
static inline bool stm32_isfreebuffer(struct stm32_ethmac_s *priv);
/* Common TX logic */
static int stm32_transmit(FAR struct stm32_ethmac_s *priv);
static int stm32_transmit(struct stm32_ethmac_s *priv);
static int stm32_txpoll(struct net_driver_s *dev);
static void stm32_dopoll(FAR struct stm32_ethmac_s *priv);
static void stm32_dopoll(struct stm32_ethmac_s *priv);
/* Interrupt handling */
static void stm32_enableint(FAR struct stm32_ethmac_s *priv,
static void stm32_enableint(struct stm32_ethmac_s *priv,
uint32_t ierbit);
static void stm32_disableint(FAR struct stm32_ethmac_s *priv,
static void stm32_disableint(struct stm32_ethmac_s *priv,
uint32_t ierbit);
static void stm32_freesegment(FAR struct stm32_ethmac_s *priv,
FAR struct eth_rxdesc_s *rxfirst, int segments);
static int stm32_recvframe(FAR struct stm32_ethmac_s *priv);
static void stm32_receive(FAR struct stm32_ethmac_s *priv);
static void stm32_freeframe(FAR struct stm32_ethmac_s *priv);
static void stm32_txdone(FAR struct stm32_ethmac_s *priv);
static void stm32_freesegment(struct stm32_ethmac_s *priv,
struct eth_rxdesc_s *rxfirst, int segments);
static int stm32_recvframe(struct stm32_ethmac_s *priv);
static void stm32_receive(struct stm32_ethmac_s *priv);
static void stm32_freeframe(struct stm32_ethmac_s *priv);
static void stm32_txdone(struct stm32_ethmac_s *priv);
static void stm32_interrupt_work(FAR void *arg);
static int stm32_interrupt(int irq, FAR void *context, FAR void *arg);
static void stm32_interrupt_work(void *arg);
static int stm32_interrupt(int irq, void *context, void *arg);
/* Watchdog timer expirations */
static void stm32_txtimeout_work(FAR void *arg);
static void stm32_txtimeout_work(void *arg);
static void stm32_txtimeout_expiry(wdparm_t arg);
static void stm32_poll_work(FAR void *arg);
static void stm32_poll_work(void *arg);
static void stm32_poll_expiry(wdparm_t arg);
/* NuttX callback functions */
@@ -720,14 +720,14 @@ static void stm32_poll_expiry(wdparm_t arg);
static int stm32_ifup(struct net_driver_s *dev);
static int stm32_ifdown(struct net_driver_s *dev);
static void stm32_txavail_work(FAR void *arg);
static void stm32_txavail_work(void *arg);
static int stm32_txavail(struct net_driver_s *dev);
#if defined(CONFIG_NET_MCASTGROUP) || defined(CONFIG_NET_ICMPv6)
static int stm32_addmac(struct net_driver_s *dev, FAR const uint8_t *mac);
static int stm32_addmac(struct net_driver_s *dev, const uint8_t *mac);
#endif
#ifdef CONFIG_NET_MCASTGROUP
static int stm32_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
static int stm32_rmmac(struct net_driver_s *dev, const uint8_t *mac);
#endif
#ifdef CONFIG_NETDEV_IOCTL
static int stm32_ioctl(struct net_driver_s *dev, int cmd,
@@ -736,13 +736,13 @@ static int stm32_ioctl(struct net_driver_s *dev, int cmd,
/* Descriptor Initialization */
static void stm32_txdescinit(FAR struct stm32_ethmac_s *priv);
static void stm32_rxdescinit(FAR struct stm32_ethmac_s *priv);
static void stm32_txdescinit(struct stm32_ethmac_s *priv);
static void stm32_rxdescinit(struct stm32_ethmac_s *priv);
/* PHY Initialization */
#if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT)
static int stm32_phyintenable(FAR struct stm32_ethmac_s *priv);
static int stm32_phyintenable(struct stm32_ethmac_s *priv);
#endif
#if defined(CONFIG_STM32_AUTONEG) || defined(CONFIG_NETDEV_PHY_IOCTL) || \
defined(CONFIG_ETH0_PHY_DM9161)
@@ -752,9 +752,9 @@ static int stm32_phyread(uint16_t phydevaddr, uint16_t phyregaddr,
static int stm32_phywrite(uint16_t phydevaddr, uint16_t phyregaddr,
uint16_t value);
#ifdef CONFIG_ETH0_PHY_DM9161
static inline int stm32_dm9161(FAR struct stm32_ethmac_s *priv);
static inline int stm32_dm9161(struct stm32_ethmac_s *priv);
#endif
static int stm32_phyinit(FAR struct stm32_ethmac_s *priv);
static int stm32_phyinit(struct stm32_ethmac_s *priv);
/* MAC/DMA Initialization */
@@ -764,15 +764,15 @@ static inline void stm32_selectmii(void);
#ifdef CONFIG_STM32_RMII
static inline void stm32_selectrmii(void);
#endif
static inline void stm32_ethgpioconfig(FAR struct stm32_ethmac_s *priv);
static int stm32_ethreset(FAR struct stm32_ethmac_s *priv);
static int stm32_macconfig(FAR struct stm32_ethmac_s *priv);
static void stm32_macaddress(FAR struct stm32_ethmac_s *priv);
static inline void stm32_ethgpioconfig(struct stm32_ethmac_s *priv);
static int stm32_ethreset(struct stm32_ethmac_s *priv);
static int stm32_macconfig(struct stm32_ethmac_s *priv);
static void stm32_macaddress(struct stm32_ethmac_s *priv);
#ifdef CONFIG_NET_ICMPv6
static void stm32_ipv6multicast(FAR struct stm32_ethmac_s *priv);
static void stm32_ipv6multicast(struct stm32_ethmac_s *priv);
#endif
static int stm32_macenable(FAR struct stm32_ethmac_s *priv);
static int stm32_ethconfig(FAR struct stm32_ethmac_s *priv);
static int stm32_macenable(struct stm32_ethmac_s *priv);
static int stm32_ethconfig(struct stm32_ethmac_s *priv);
/****************************************************************************
* Private Functions
@@ -917,7 +917,7 @@ static void stm32_checksetup(void)
*
****************************************************************************/
static void stm32_initbuffer(FAR struct stm32_ethmac_s *priv)
static void stm32_initbuffer(struct stm32_ethmac_s *priv)
{
uint8_t *buffer;
int i;
@@ -932,7 +932,7 @@ static void stm32_initbuffer(FAR struct stm32_ethmac_s *priv)
i < STM32_ETH_NFREEBUFFERS;
i++, buffer += CONFIG_STM32_ETH_BUFSIZE)
{
sq_addlast((FAR sq_entry_t *)buffer, &priv->freeb);
sq_addlast((sq_entry_t *)buffer, &priv->freeb);
}
}
@@ -955,7 +955,7 @@ static void stm32_initbuffer(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static inline uint8_t *stm32_allocbuffer(FAR struct stm32_ethmac_s *priv)
static inline uint8_t *stm32_allocbuffer(struct stm32_ethmac_s *priv)
{
/* Allocate a buffer by returning the head of the free buffer list */
@@ -982,12 +982,12 @@ static inline uint8_t *stm32_allocbuffer(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static inline void stm32_freebuffer(FAR struct stm32_ethmac_s *priv,
static inline void stm32_freebuffer(struct stm32_ethmac_s *priv,
uint8_t *buffer)
{
/* Free the buffer by adding it to the end of the free buffer list */
sq_addlast((FAR sq_entry_t *)buffer, &priv->freeb);
sq_addlast((sq_entry_t *)buffer, &priv->freeb);
}
/****************************************************************************
@@ -1008,7 +1008,7 @@ static inline void stm32_freebuffer(FAR struct stm32_ethmac_s *priv,
*
****************************************************************************/
static inline bool stm32_isfreebuffer(FAR struct stm32_ethmac_s *priv)
static inline bool stm32_isfreebuffer(struct stm32_ethmac_s *priv)
{
/* Return TRUE if the free buffer list is not empty */
@@ -1035,7 +1035,7 @@ static inline bool stm32_isfreebuffer(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static int stm32_transmit(FAR struct stm32_ethmac_s *priv)
static int stm32_transmit(struct stm32_ethmac_s *priv)
{
struct eth_txdesc_s *txdesc;
struct eth_txdesc_s *txfirst;
@@ -1251,8 +1251,8 @@ static int stm32_transmit(FAR struct stm32_ethmac_s *priv)
static int stm32_txpoll(struct net_driver_s *dev)
{
FAR struct stm32_ethmac_s *priv =
(FAR struct stm32_ethmac_s *)dev->d_private;
struct stm32_ethmac_s *priv =
(struct stm32_ethmac_s *)dev->d_private;
DEBUGASSERT(priv->dev.d_buf != NULL);
@@ -1358,9 +1358,9 @@ static int stm32_txpoll(struct net_driver_s *dev)
*
****************************************************************************/
static void stm32_dopoll(FAR struct stm32_ethmac_s *priv)
static void stm32_dopoll(struct stm32_ethmac_s *priv)
{
FAR struct net_driver_s *dev = &priv->dev;
struct net_driver_s *dev = &priv->dev;
/* Check if the next TX descriptor is owned by the Ethernet DMA or
* CPU. We cannot perform the TX poll if we are unable to accept
@@ -1419,7 +1419,7 @@ static void stm32_dopoll(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static void stm32_enableint(FAR struct stm32_ethmac_s *priv,
static void stm32_enableint(struct stm32_ethmac_s *priv,
uint32_t ierbit)
{
uint32_t regval;
@@ -1448,7 +1448,7 @@ static void stm32_enableint(FAR struct stm32_ethmac_s *priv,
*
****************************************************************************/
static void stm32_disableint(FAR struct stm32_ethmac_s *priv,
static void stm32_disableint(struct stm32_ethmac_s *priv,
uint32_t ierbit)
{
uint32_t regval;
@@ -1488,8 +1488,8 @@ static void stm32_disableint(FAR struct stm32_ethmac_s *priv,
*
****************************************************************************/
static void stm32_freesegment(FAR struct stm32_ethmac_s *priv,
FAR struct eth_rxdesc_s *rxfirst, int segments)
static void stm32_freesegment(struct stm32_ethmac_s *priv,
struct eth_rxdesc_s *rxfirst, int segments)
{
struct eth_rxdesc_s *rxdesc;
int i;
@@ -1545,7 +1545,7 @@ static void stm32_freesegment(FAR struct stm32_ethmac_s *priv,
*
****************************************************************************/
static int stm32_recvframe(FAR struct stm32_ethmac_s *priv)
static int stm32_recvframe(struct stm32_ethmac_s *priv)
{
struct eth_rxdesc_s *rxdesc;
struct eth_rxdesc_s *rxcurr;
@@ -1724,7 +1724,7 @@ static int stm32_recvframe(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static void stm32_receive(FAR struct stm32_ethmac_s *priv)
static void stm32_receive(struct stm32_ethmac_s *priv)
{
struct net_driver_s *dev = &priv->dev;
@@ -1896,7 +1896,7 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static void stm32_freeframe(FAR struct stm32_ethmac_s *priv)
static void stm32_freeframe(struct stm32_ethmac_s *priv)
{
struct eth_txdesc_s *txdesc;
int i;
@@ -1995,7 +1995,7 @@ static void stm32_freeframe(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static void stm32_txdone(FAR struct stm32_ethmac_s *priv)
static void stm32_txdone(struct stm32_ethmac_s *priv)
{
DEBUGASSERT(priv->txtail != NULL);
@@ -2038,9 +2038,9 @@ static void stm32_txdone(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static void stm32_interrupt_work(FAR void *arg)
static void stm32_interrupt_work(void *arg)
{
FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg;
struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg;
uint32_t dmasr;
DEBUGASSERT(priv);
@@ -2145,9 +2145,9 @@ static void stm32_interrupt_work(FAR void *arg)
*
****************************************************************************/
static int stm32_interrupt(int irq, FAR void *context, FAR void *arg)
static int stm32_interrupt(int irq, void *context, void *arg)
{
FAR struct stm32_ethmac_s *priv = &g_stm32ethmac[0];
struct stm32_ethmac_s *priv = &g_stm32ethmac[0];
uint32_t dmasr;
/* Get the DMA interrupt status bits (no MAC interrupts are expected) */
@@ -2199,9 +2199,9 @@ static int stm32_interrupt(int irq, FAR void *context, FAR void *arg)
*
****************************************************************************/
static void stm32_txtimeout_work(FAR void *arg)
static void stm32_txtimeout_work(void *arg)
{
FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg;
struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg;
/* Reset the hardware. Just take the interface down, then back up again. */
@@ -2235,7 +2235,7 @@ static void stm32_txtimeout_work(FAR void *arg)
static void stm32_txtimeout_expiry(wdparm_t arg)
{
FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg;
struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg;
nerr("ERROR: Timeout!\n");
@@ -2272,10 +2272,10 @@ static void stm32_txtimeout_expiry(wdparm_t arg)
*
****************************************************************************/
static void stm32_poll_work(FAR void *arg)
static void stm32_poll_work(void *arg)
{
FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg;
FAR struct net_driver_s *dev = &priv->dev;
struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg;
struct net_driver_s *dev = &priv->dev;
/* Check if the next TX descriptor is owned by the Ethernet DMA or
* CPU. We cannot perform the TX poll if we are unable to accept
@@ -2346,7 +2346,7 @@ static void stm32_poll_work(FAR void *arg)
static void stm32_poll_expiry(wdparm_t arg)
{
FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg;
struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg;
/* Schedule to perform the interrupt processing on the worker thread. */
@@ -2373,8 +2373,8 @@ static void stm32_poll_expiry(wdparm_t arg)
static int stm32_ifup(struct net_driver_s *dev)
{
FAR struct stm32_ethmac_s *priv =
(FAR struct stm32_ethmac_s *)dev->d_private;
struct stm32_ethmac_s *priv =
(struct stm32_ethmac_s *)dev->d_private;
int ret;
#ifdef CONFIG_NET_IPv4
@@ -2432,8 +2432,8 @@ static int stm32_ifup(struct net_driver_s *dev)
static int stm32_ifdown(struct net_driver_s *dev)
{
FAR struct stm32_ethmac_s *priv =
(FAR struct stm32_ethmac_s *)dev->d_private;
struct stm32_ethmac_s *priv =
(struct stm32_ethmac_s *)dev->d_private;
irqstate_t flags;
int ret = OK;
@@ -2485,9 +2485,9 @@ static int stm32_ifdown(struct net_driver_s *dev)
*
****************************************************************************/
static void stm32_txavail_work(FAR void *arg)
static void stm32_txavail_work(void *arg)
{
FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg;
struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg;
ninfo("ifup: %d\n", priv->ifup);
@@ -2525,8 +2525,8 @@ static void stm32_txavail_work(FAR void *arg)
static int stm32_txavail(struct net_driver_s *dev)
{
FAR struct stm32_ethmac_s *priv =
(FAR struct stm32_ethmac_s *)dev->d_private;
struct stm32_ethmac_s *priv =
(struct stm32_ethmac_s *)dev->d_private;
/* Is our single work structure available? It may not be if there are
* pending interrupt actions and we will have to ignore the Tx
@@ -2607,7 +2607,7 @@ static uint32_t stm32_calcethcrc(const uint8_t *data, size_t length)
****************************************************************************/
#if defined(CONFIG_NET_MCASTGROUP) || defined(CONFIG_NET_ICMPv6)
static int stm32_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
static int stm32_addmac(struct net_driver_s *dev, const uint8_t *mac)
{
uint32_t crc;
uint32_t hashindex;
@@ -2664,7 +2664,7 @@ static int stm32_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
****************************************************************************/
#ifdef CONFIG_NET_MCASTGROUP
static int stm32_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
static int stm32_rmmac(struct net_driver_s *dev, const uint8_t *mac)
{
uint32_t crc;
uint32_t hashindex;
@@ -2724,7 +2724,7 @@ static int stm32_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
*
****************************************************************************/
static void stm32_txdescinit(FAR struct stm32_ethmac_s *priv)
static void stm32_txdescinit(struct stm32_ethmac_s *priv)
{
struct eth_txdesc_s *txdesc;
int i;
@@ -2808,7 +2808,7 @@ static void stm32_txdescinit(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static void stm32_rxdescinit(FAR struct stm32_ethmac_s *priv)
static void stm32_rxdescinit(struct stm32_ethmac_s *priv)
{
struct eth_rxdesc_s *rxdesc;
int i;
@@ -2906,8 +2906,8 @@ static void stm32_rxdescinit(FAR struct stm32_ethmac_s *priv)
static int stm32_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
{
#if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT)
FAR struct stm32_ethmac_s *priv =
(FAR struct stm32_ethmac_s *)dev->d_private;
struct stm32_ethmac_s *priv =
(struct stm32_ethmac_s *)dev->d_private;
#endif
int ret;
@@ -3151,7 +3151,7 @@ static int stm32_phywrite(uint16_t phydevaddr,
****************************************************************************/
#ifdef CONFIG_ETH0_PHY_DM9161
static inline int stm32_dm9161(FAR struct stm32_ethmac_s *priv)
static inline int stm32_dm9161(struct stm32_ethmac_s *priv)
{
uint16_t phyval;
int ret;
@@ -3216,7 +3216,7 @@ static inline int stm32_dm9161(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static int stm32_phyinit(FAR struct stm32_ethmac_s *priv)
static int stm32_phyinit(struct stm32_ethmac_s *priv)
{
#ifdef CONFIG_STM32_AUTONEG
volatile uint32_t timeout;
@@ -3500,7 +3500,7 @@ static inline void stm32_selectrmii(void)
*
****************************************************************************/
static inline void stm32_ethgpioconfig(FAR struct stm32_ethmac_s *priv)
static inline void stm32_ethgpioconfig(struct stm32_ethmac_s *priv)
{
/* Configure GPIO pins to support Ethernet */
@@ -3653,7 +3653,7 @@ static inline void stm32_ethgpioconfig(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static int stm32_ethreset(FAR struct stm32_ethmac_s *priv)
static int stm32_ethreset(struct stm32_ethmac_s *priv)
{
uint32_t regval;
uint32_t retries;
@@ -3723,7 +3723,7 @@ static int stm32_ethreset(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static int stm32_macconfig(FAR struct stm32_ethmac_s *priv)
static int stm32_macconfig(struct stm32_ethmac_s *priv)
{
uint32_t regval;
@@ -3807,9 +3807,9 @@ static int stm32_macconfig(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static void stm32_macaddress(FAR struct stm32_ethmac_s *priv)
static void stm32_macaddress(struct stm32_ethmac_s *priv)
{
FAR struct net_driver_s *dev = &priv->dev;
struct net_driver_s *dev = &priv->dev;
uint32_t regval;
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
@@ -3853,7 +3853,7 @@ static void stm32_macaddress(FAR struct stm32_ethmac_s *priv)
****************************************************************************/
#ifdef CONFIG_NET_ICMPv6
static void stm32_ipv6multicast(FAR struct stm32_ethmac_s *priv)
static void stm32_ipv6multicast(struct stm32_ethmac_s *priv)
{
struct net_driver_s *dev;
uint16_t tmp16;
@@ -3925,7 +3925,7 @@ static void stm32_ipv6multicast(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static int stm32_macenable(FAR struct stm32_ethmac_s *priv)
static int stm32_macenable(struct stm32_ethmac_s *priv)
{
uint32_t regval;
@@ -4012,7 +4012,7 @@ static int stm32_macenable(FAR struct stm32_ethmac_s *priv)
*
****************************************************************************/
static int stm32_ethconfig(FAR struct stm32_ethmac_s *priv)
static int stm32_ethconfig(struct stm32_ethmac_s *priv)
{
int ret;
+1 -1
View File
@@ -58,7 +58,7 @@ static void *g_callback_arg;
*
****************************************************************************/
static int stm32_exti_alarm_isr(int irq, void *context, FAR void *arg)
static int stm32_exti_alarm_isr(int irq, void *context, void *arg)
{
int ret = OK;
+1 -1
View File
@@ -250,7 +250,7 @@ static int stm32_exti1510_isr(int irq, void *context, void *arg)
int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
bool event, xcpt_t func, void *arg)
{
FAR struct gpio_callback_s *shared_cbs;
struct gpio_callback_s *shared_cbs;
uint32_t pin = pinset & GPIO_PIN_MASK;
uint32_t exti = STM32_EXTI_BIT(pin);
int irq;
+1 -1
View File
@@ -63,7 +63,7 @@ static void *g_callback_arg;
*
****************************************************************************/
static int stm32_exti_pvd_isr(int irq, void *context, FAR void *arg)
static int stm32_exti_pvd_isr(int irq, void *context, void *arg)
{
int ret = OK;
+1 -1
View File
@@ -58,7 +58,7 @@ static void *g_callback_arg;
*
****************************************************************************/
static int stm32_exti_wakeup_isr(int irq, void *context, FAR void *arg)
static int stm32_exti_wakeup_isr(int irq, void *context, void *arg)
{
int ret = OK;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -81,7 +81,7 @@ extern "C"
*
****************************************************************************/
FAR struct can_dev_s *stm32_fdcaninitialize(int port);
struct can_dev_s *stm32_fdcaninitialize(int port);
#endif
#ifdef CONFIG_STM32_FDCAN_SOCKET
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+18 -18
View File
@@ -62,15 +62,15 @@ struct stm32_foc_adc_s
/* The list of ADC channels (regular first, then injected) */
FAR uint8_t *chan;
uint8_t *chan;
/* The list of ADC pins */
FAR uint32_t *pins;
uint32_t *pins;
/* The list of ADC channels sample time configuration */
FAR adc_channel_t *stime;
adc_channel_t *stime;
};
/* Board-specific operations.
@@ -83,37 +83,37 @@ struct stm32_foc_board_ops_s
{
/* Board-specific setup */
CODE int (*setup)(FAR struct foc_dev_s *dev);
int (*setup)(struct foc_dev_s *dev);
/* Board-specific shutdown */
CODE int (*shutdown)(FAR struct foc_dev_s *dev);
int (*shutdown)(struct foc_dev_s *dev);
/* Board-specific calibration setup */
CODE int (*calibration)(FAR struct foc_dev_s *dev, bool state);
int (*calibration)(struct foc_dev_s *dev, bool state);
/* Board-specific fault clear */
CODE int (*fault_clear)(FAR struct foc_dev_s *dev);
int (*fault_clear)(struct foc_dev_s *dev);
/* Board-specific PWM start */
CODE int (*pwm_start)(FAR struct foc_dev_s *dev, bool state);
int (*pwm_start)(struct foc_dev_s *dev, bool state);
/* Get phase currents */
CODE int (*current_get)(FAR struct foc_dev_s *dev, FAR int16_t *curr_raw,
FAR foc_current_t *curr);
int (*current_get)(struct foc_dev_s *dev, int16_t *curr_raw,
foc_current_t *curr);
#ifdef CONFIG_MOTOR_FOC_TRACE
/* FOC trace interface setup */
CODE int (*trace_init)(FAR struct foc_dev_s *dev);
int (*trace_init)(struct foc_dev_s *dev);
/* FOC trace */
CODE void (*trace)(FAR struct foc_dev_s *dev, int type, bool state);
void (*trace)(struct foc_dev_s *dev, int type, bool state);
#endif
};
@@ -123,7 +123,7 @@ struct stm32_foc_board_data_s
{
/* ADC configuration */
FAR struct stm32_foc_adc_s *adc_cfg;
struct stm32_foc_adc_s *adc_cfg;
/* PWM deadtime register value */
@@ -144,11 +144,11 @@ struct stm32_foc_board_s
{
/* Board-specific FOC operations */
FAR struct stm32_foc_board_ops_s *ops;
struct stm32_foc_board_ops_s *ops;
/* Board-specific FOC data */
FAR struct stm32_foc_board_data_s *data;
struct stm32_foc_board_data_s *data;
};
/****************************************************************************
@@ -170,14 +170,14 @@ extern "C"
* Name: stm32_foc_initialize
****************************************************************************/
FAR struct foc_dev_s *
stm32_foc_initialize(int inst, FAR struct stm32_foc_board_s *board);
struct foc_dev_s *
stm32_foc_initialize(int inst, struct stm32_foc_board_s *board);
/****************************************************************************
* Name: stm32_foc_adcget
****************************************************************************/
FAR struct adc_dev_s *stm32_foc_adcget(FAR struct foc_dev_s *dev);
struct adc_dev_s *stm32_foc_adcget(struct foc_dev_s *dev);
#undef EXTERN
#if defined(__cplusplus)
+3 -3
View File
@@ -47,9 +47,9 @@
struct stm32_freerun_s
{
uint8_t chan; /* The timer/counter in use */
uint8_t width; /* Width of timer (16- or 32-bits) */
FAR struct stm32_tim_dev_s *tch; /* Handle returned by stm32_tim_init() */
uint8_t chan; /* The timer/counter in use */
uint8_t width; /* Width of timer (16- or 32-bits) */
struct stm32_tim_dev_s *tch; /* Handle returned by stm32_tim_init() */
uint32_t frequency;
#ifndef CONFIG_CLOCK_TIMEKEEPING
+24 -24
View File
@@ -47,18 +47,18 @@ struct stm32_lowerhalf_s
* half callback structure:
*/
FAR const struct hall3_ops_s *ops; /* Lower half callback structure */
struct stm32_hall3ph_cfg_s cfg; /* Configuration */
const struct hall3_ops_s *ops; /* Lower half callback structure */
struct stm32_hall3ph_cfg_s cfg; /* Configuration */
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
int stm32_hall3ph_setup(FAR struct hall3_lowerhalf_s *lower);
int stm32_hall3ph_shutdown(FAR struct hall3_lowerhalf_s *lower);
int stm32_hall3ph_position(FAR struct hall3_lowerhalf_s *lower,
FAR uint8_t *pos);
int stm32_hall3ph_setup(struct hall3_lowerhalf_s *lower);
int stm32_hall3ph_shutdown(struct hall3_lowerhalf_s *lower);
int stm32_hall3ph_position(struct hall3_lowerhalf_s *lower,
uint8_t *pos);
/****************************************************************************
* Private Data
@@ -83,9 +83,9 @@ struct hall3_ops_s g_hall3ph_ops =
*
****************************************************************************/
int stm32_hall3ph_setup(FAR struct hall3_lowerhalf_s *lower)
int stm32_hall3ph_setup(struct hall3_lowerhalf_s *lower)
{
FAR struct stm32_lowerhalf_s *priv = (FAR struct stm32_lowerhalf_s *)lower;
struct stm32_lowerhalf_s *priv = (struct stm32_lowerhalf_s *)lower;
DEBUGASSERT(priv);
@@ -106,9 +106,9 @@ int stm32_hall3ph_setup(FAR struct hall3_lowerhalf_s *lower)
*
****************************************************************************/
int stm32_hall3ph_shutdown(FAR struct hall3_lowerhalf_s *lower)
int stm32_hall3ph_shutdown(struct hall3_lowerhalf_s *lower)
{
FAR struct stm32_lowerhalf_s *priv = (FAR struct stm32_lowerhalf_s *)lower;
struct stm32_lowerhalf_s *priv = (struct stm32_lowerhalf_s *)lower;
DEBUGASSERT(priv);
@@ -129,15 +129,15 @@ int stm32_hall3ph_shutdown(FAR struct hall3_lowerhalf_s *lower)
*
****************************************************************************/
int stm32_hall3ph_position(FAR struct hall3_lowerhalf_s *lower,
FAR uint8_t *pos)
int stm32_hall3ph_position(struct hall3_lowerhalf_s *lower,
uint8_t *pos)
{
FAR struct stm32_lowerhalf_s *priv = (FAR struct stm32_lowerhalf_s *)lower;
uint8_t ha = 0;
uint8_t hb = 0;
uint8_t hc = 0;
uint8_t i = 0;
uint8_t thr = (priv->cfg.samples / 2);
struct stm32_lowerhalf_s *priv = (struct stm32_lowerhalf_s *)lower;
uint8_t ha = 0;
uint8_t hb = 0;
uint8_t hc = 0;
uint8_t i = 0;
uint8_t thr = (priv->cfg.samples / 2);
DEBUGASSERT(priv);
@@ -171,15 +171,15 @@ int stm32_hall3ph_position(FAR struct hall3_lowerhalf_s *lower,
*
****************************************************************************/
int stm32_hall3ph_initialize(FAR const char *devpath,
FAR struct stm32_hall3ph_cfg_s *cfg)
int stm32_hall3ph_initialize(const char *devpath,
struct stm32_hall3ph_cfg_s *cfg)
{
FAR struct stm32_lowerhalf_s *priv = NULL;
int ret = OK;
struct stm32_lowerhalf_s *priv = NULL;
int ret = OK;
/* Allocate the lower-half data structure */
priv = (FAR struct stm32_lowerhalf_s *)
priv = (struct stm32_lowerhalf_s *)
kmm_zalloc(sizeof(struct stm32_lowerhalf_s));
if (priv == NULL)
{
@@ -198,7 +198,7 @@ int stm32_hall3ph_initialize(FAR const char *devpath,
/* Initialize a Hall effect sensor interface. */
ret = hall3_register(devpath, (FAR struct hall3_lowerhalf_s *)priv);
ret = hall3_register(devpath, (struct hall3_lowerhalf_s *)priv);
if (ret < 0)
{
snerr("ERROR: hall3ph_register failed: %d\n", ret);
+2 -2
View File
@@ -57,7 +57,7 @@ struct stm32_hall3ph_cfg_s
*
****************************************************************************/
int stm32_hall3ph_initialize(FAR const char *devpath,
FAR struct stm32_hall3ph_cfg_s *cfg);
int stm32_hall3ph_initialize(const char *devpath,
struct stm32_hall3ph_cfg_s *cfg);
#endif /* __ARCH_ARM_SRC_STM32_STM32_HALL3PH_H */
File diff suppressed because it is too large Load Diff
+32 -32
View File
@@ -1008,59 +1008,59 @@ enum stm32_hrtim_capture_triggers_e
struct hrtim_dev_s;
struct stm32_hrtim_ops_s
{
int (*cmp_update)(FAR struct hrtim_dev_s *dev, uint8_t timer,
int (*cmp_update)(struct hrtim_dev_s *dev, uint8_t timer,
uint8_t index, uint16_t cmp);
int (*per_update)(FAR struct hrtim_dev_s *dev,
int (*per_update)(struct hrtim_dev_s *dev,
uint8_t timer, uint16_t per);
int (*rep_update)(FAR struct hrtim_dev_s *dev,
int (*rep_update)(struct hrtim_dev_s *dev,
uint8_t timer, uint8_t rep);
uint16_t (*per_get)(FAR struct hrtim_dev_s *dev, uint8_t timer);
uint16_t (*cmp_get)(FAR struct hrtim_dev_s *dev, uint8_t timer,
uint16_t (*per_get)(struct hrtim_dev_s *dev, uint8_t timer);
uint16_t (*cmp_get)(struct hrtim_dev_s *dev, uint8_t timer,
uint8_t index);
uint64_t (*fclk_get)(FAR struct hrtim_dev_s *dev, uint8_t timer);
int (*soft_update)(FAR struct hrtim_dev_s *dev, uint8_t timer);
int (*soft_reset)(FAR struct hrtim_dev_s *dev, uint8_t timer);
int (*freq_set)(FAR struct hrtim_dev_s *dev, uint8_t timer,
uint64_t (*fclk_get)(struct hrtim_dev_s *dev, uint8_t timer);
int (*soft_update)(struct hrtim_dev_s *dev, uint8_t timer);
int (*soft_reset)(struct hrtim_dev_s *dev, uint8_t timer);
int (*freq_set)(struct hrtim_dev_s *dev, uint8_t timer,
uint64_t freq);
int (*tim_enable)(FAR struct hrtim_dev_s *dev, uint8_t timers,
int (*tim_enable)(struct hrtim_dev_s *dev, uint8_t timers,
bool state);
#ifdef CONFIG_STM32_HRTIM_INTERRUPTS
int (*irq_ack)(FAR struct hrtim_dev_s *dev,
int (*irq_ack)(struct hrtim_dev_s *dev,
uint8_t timer, int source);
uint16_t (*irq_get)(FAR struct hrtim_dev_s *dev, uint8_t timer);
uint16_t (*irq_get)(struct hrtim_dev_s *dev, uint8_t timer);
#endif
#ifdef CONFIG_STM32_HRTIM_PWM
int (*outputs_enable)(FAR struct hrtim_dev_s *dev, uint16_t outputs,
int (*outputs_enable)(struct hrtim_dev_s *dev, uint16_t outputs,
bool state);
int (*output_set_set)(FAR struct hrtim_dev_s *dev, uint16_t output,
int (*output_set_set)(struct hrtim_dev_s *dev, uint16_t output,
uint32_t set);
int (*output_rst_set)(FAR struct hrtim_dev_s *dev, uint16_t output,
int (*output_rst_set)(struct hrtim_dev_s *dev, uint16_t output,
uint32_t rst);
#endif
#ifdef CONFIG_STM32_HRTIM_BURST
int (*burst_enable)(FAR struct hrtim_dev_s *dev, bool state);
int (*burst_cmp_set)(FAR struct hrtim_dev_s *dev, uint16_t cmp);
int (*burst_per_set)(FAR struct hrtim_dev_s *dev, uint16_t per);
int (*burst_pre_set)(FAR struct hrtim_dev_s *dev, uint8_t pre);
uint16_t (*burst_cmp_get)(FAR struct hrtim_dev_s *dev);
uint16_t (*burst_per_get)(FAR struct hrtim_dev_s *dev);
int (*burst_pre_get)(FAR struct hrtim_dev_s *dev);
int (*burst_enable)(struct hrtim_dev_s *dev, bool state);
int (*burst_cmp_set)(struct hrtim_dev_s *dev, uint16_t cmp);
int (*burst_per_set)(struct hrtim_dev_s *dev, uint16_t per);
int (*burst_pre_set)(struct hrtim_dev_s *dev, uint8_t pre);
uint16_t (*burst_cmp_get)(struct hrtim_dev_s *dev);
uint16_t (*burst_per_get)(struct hrtim_dev_s *dev);
int (*burst_pre_get)(struct hrtim_dev_s *dev);
#endif
#ifdef CONFIG_STM32_HRTIM_CHOPPER
int (*chopper_enable)(FAR struct hrtim_dev_s *dev, uint8_t timer,
int (*chopper_enable)(struct hrtim_dev_s *dev, uint8_t timer,
uint8_t chan, bool state);
#endif
#ifdef CONFIG_STM32_HRTIM_DEADTIME
int (*deadtime_update)(FAR struct hrtim_dev_s *dev, uint8_t timer,
int (*deadtime_update)(struct hrtim_dev_s *dev, uint8_t timer,
uint8_t dt, uint16_t value);
uint16_t (*deadtime_get)(FAR struct hrtim_dev_s *dev, uint8_t timer,
uint16_t (*deadtime_get)(struct hrtim_dev_s *dev, uint8_t timer,
uint8_t dt);
#endif
#ifdef CONFIG_STM32_HRTIM_CAPTURE
uint16_t (*capture_get)(FAR struct hrtim_dev_s *dev, uint8_t timer,
uint16_t (*capture_get)(struct hrtim_dev_s *dev, uint8_t timer,
uint8_t index);
int (*soft_capture)(FAR struct hrtim_dev_s *dev, uint8_t timer,
int (*soft_capture)(struct hrtim_dev_s *dev, uint8_t timer,
uint8_t index);
#endif
@@ -1079,9 +1079,9 @@ struct hrtim_dev_s
/* Fields provided by lower half HRTIM logic */
FAR const struct stm32_hrtim_ops_s *hd_ops; /* HRTIM operations */
FAR void *hd_priv; /* Used by the arch-specific logic */
bool initialized; /* true: HRTIM driver has been initialized */
const struct stm32_hrtim_ops_s *hd_ops; /* HRTIM operations */
void *hd_priv; /* Used by the arch-specific logic */
bool initialized; /* true: HRTIM driver has been initialized */
};
/****************************************************************************
@@ -1115,14 +1115,14 @@ extern "C"
*
****************************************************************************/
FAR struct hrtim_dev_s *stm32_hrtiminitialize(void);
struct hrtim_dev_s *stm32_hrtiminitialize(void);
/****************************************************************************
* Name: hrtim_register
****************************************************************************/
#ifndef CONFIG_STM32_HRTIM_DISABLE_CHARDRV
int hrtim_register(FAR const char *path, FAR struct hrtim_dev_s *dev);
int hrtim_register(const char *path, struct hrtim_dev_s *dev);
#endif
#undef EXTERN
+56 -56
View File
@@ -263,59 +263,59 @@ struct stm32_i2c_priv_s
* Private Function Prototypes
****************************************************************************/
static inline uint16_t stm32_i2c_getreg(FAR struct stm32_i2c_priv_s *priv,
static inline uint16_t stm32_i2c_getreg(struct stm32_i2c_priv_s *priv,
uint8_t offset);
static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_putreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t value);
static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_modifyreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t clearbits,
uint16_t setbits);
#ifdef CONFIG_STM32_I2C_DYNTIMEO
static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs);
static useconds_t stm32_i2c_tousecs(int msgc, struct i2c_msg_s *msgs);
#endif /* CONFIG_STM32_I2C_DYNTIMEO */
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_post(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_init(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_destroy(FAR struct stm32_i2c_priv_s *priv);
static inline int stm32_i2c_sem_waitdone(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_waitstop(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_post(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_init(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_destroy(struct stm32_i2c_priv_s *priv);
#ifdef CONFIG_I2C_TRACE
static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv);
static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_tracereset(struct stm32_i2c_priv_s *priv);
static void stm32_i2c_tracenew(struct stm32_i2c_priv_s *priv,
uint32_t status);
static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_traceevent(struct stm32_i2c_priv_s *priv,
enum stm32_trace_e event, uint32_t parm);
static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv);
static void stm32_i2c_tracedump(struct stm32_i2c_priv_s *priv);
#endif /* CONFIG_I2C_TRACE */
static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_setclock(struct stm32_i2c_priv_s *priv,
uint32_t frequency);
static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_clrstart(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sendstop(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sendstart(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_clrstart(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sendstop(struct stm32_i2c_priv_s *priv);
static inline
uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv);
uint32_t stm32_i2c_getstatus(struct stm32_i2c_priv_s *priv);
#ifdef I2C1_FSMC_CONFLICT
static inline
uint32_t stm32_i2c_disablefsmc(FAR struct stm32_i2c_priv_s *priv);
uint32_t stm32_i2c_disablefsmc(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_enablefsmc(uint32_t ahbenr);
#endif /* I2C1_FSMC_CONFLICT */
static int stm32_i2c_isr_process(struct stm32_i2c_priv_s * priv);
#ifndef CONFIG_I2C_POLLED
static int stm32_i2c_isr(int irq, void *context, FAR void *arg);
static int stm32_i2c_isr(int irq, void *context, void *arg);
#endif /* !CONFIG_I2C_POLLED */
static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv);
static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv);
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
static int stm32_i2c_init(struct stm32_i2c_priv_s *priv);
static int stm32_i2c_deinit(struct stm32_i2c_priv_s *priv);
static int stm32_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
#ifdef CONFIG_I2C_RESET
static int stm32_i2c_reset(FAR struct i2c_master_s *dev);
static int stm32_i2c_reset(struct i2c_master_s *dev);
#endif
/****************************************************************************
@@ -452,7 +452,7 @@ static struct stm32_i2c_priv_s stm32_i2c3_priv =
*
****************************************************************************/
static inline uint16_t stm32_i2c_getreg(FAR struct stm32_i2c_priv_s *priv,
static inline uint16_t stm32_i2c_getreg(struct stm32_i2c_priv_s *priv,
uint8_t offset)
{
return getreg16(priv->config->base + offset);
@@ -466,7 +466,7 @@ static inline uint16_t stm32_i2c_getreg(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_putreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t value)
{
putreg16(value, priv->config->base + offset);
@@ -480,7 +480,7 @@ static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_modifyreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t clearbits,
uint16_t setbits)
{
@@ -497,7 +497,7 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv,
****************************************************************************/
#ifdef CONFIG_STM32_I2C_DYNTIMEO
static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
static useconds_t stm32_i2c_tousecs(int msgc, struct i2c_msg_s *msgs)
{
size_t bytecount = 0;
int i;
@@ -526,7 +526,7 @@ static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
****************************************************************************/
#ifndef CONFIG_I2C_POLLED
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
static inline int stm32_i2c_sem_waitdone(struct stm32_i2c_priv_s *priv)
{
struct timespec abstime;
irqstate_t flags;
@@ -609,7 +609,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
return ret;
}
#else
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
static inline int stm32_i2c_sem_waitdone(struct stm32_i2c_priv_s *priv)
{
clock_t timeout;
clock_t start;
@@ -668,7 +668,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sem_waitstop(struct stm32_i2c_priv_s *priv)
{
clock_t start;
clock_t elapsed;
@@ -746,7 +746,7 @@ static inline void stm32_i2c_sem_post(struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sem_init(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sem_init(struct stm32_i2c_priv_s *priv)
{
nxsem_init(&priv->sem_excl, 0, 1);
@@ -768,7 +768,7 @@ static inline void stm32_i2c_sem_init(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sem_destroy(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sem_destroy(struct stm32_i2c_priv_s *priv)
{
nxsem_destroy(&priv->sem_excl);
#ifndef CONFIG_I2C_POLLED
@@ -785,7 +785,7 @@ static inline void stm32_i2c_sem_destroy(FAR struct stm32_i2c_priv_s *priv)
****************************************************************************/
#ifdef CONFIG_I2C_TRACE
static void stm32_i2c_traceclear(FAR struct stm32_i2c_priv_s *priv)
static void stm32_i2c_traceclear(struct stm32_i2c_priv_s *priv)
{
struct stm32_trace_s *trace = &priv->trace[priv->tndx];
@@ -796,7 +796,7 @@ static void stm32_i2c_traceclear(FAR struct stm32_i2c_priv_s *priv)
trace->time = 0; /* Time of first status or event */
}
static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
static void stm32_i2c_tracereset(struct stm32_i2c_priv_s *priv)
{
/* Reset the trace info for a new data collection */
@@ -805,7 +805,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
stm32_i2c_traceclear(priv);
}
static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_tracenew(struct stm32_i2c_priv_s *priv,
uint32_t status)
{
struct stm32_trace_s *trace = &priv->trace[priv->tndx];
@@ -847,7 +847,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
}
}
static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_traceevent(struct stm32_i2c_priv_s *priv,
enum stm32_trace_e event, uint32_t parm)
{
struct stm32_trace_s *trace;
@@ -874,7 +874,7 @@ static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
}
}
static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
static void stm32_i2c_tracedump(struct stm32_i2c_priv_s *priv)
{
struct stm32_trace_s *trace;
int i;
@@ -901,7 +901,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_setclock(struct stm32_i2c_priv_s *priv,
uint32_t frequency)
{
uint16_t cr1;
@@ -1013,7 +1013,7 @@ static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sendstart(struct stm32_i2c_priv_s *priv)
{
/* Disable ACK on receive by default and generate START */
@@ -1029,7 +1029,7 @@ static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_clrstart(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_clrstart(struct stm32_i2c_priv_s *priv)
{
/* "Note: When the STOP, START or PEC bit is set, the software must
* not perform any write access to I2C_CR1 before this bit is
@@ -1060,7 +1060,7 @@ static inline void stm32_i2c_clrstart(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sendstop(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sendstop(struct stm32_i2c_priv_s *priv)
{
stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, I2C_CR1_ACK, I2C_CR1_STOP);
}
@@ -1073,7 +1073,7 @@ static inline void stm32_i2c_sendstop(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv)
static inline uint32_t stm32_i2c_getstatus(struct stm32_i2c_priv_s *priv)
{
uint32_t status = stm32_i2c_getreg(priv, STM32_I2C_SR1_OFFSET);
status |= (stm32_i2c_getreg(priv, STM32_I2C_SR2_OFFSET) << 16);
@@ -1095,7 +1095,7 @@ static inline uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv)
#ifdef I2C1_FSMC_CONFLICT
static inline
uint32_t stm32_i2c_disablefsmc(FAR struct stm32_i2c_priv_s *priv)
uint32_t stm32_i2c_disablefsmc(struct stm32_i2c_priv_s *priv)
{
uint32_t ret = 0;
uint32_t regval;
@@ -1445,7 +1445,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv)
****************************************************************************/
#ifndef CONFIG_I2C_POLLED
static int stm32_i2c_isr(int irq, void *context, FAR void *arg)
static int stm32_i2c_isr(int irq, void *context, void *arg)
{
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)arg;
@@ -1462,7 +1462,7 @@ static int stm32_i2c_isr(int irq, void *context, FAR void *arg)
*
****************************************************************************/
static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
static int stm32_i2c_init(struct stm32_i2c_priv_s *priv)
{
/* Power-up and configure GPIOs */
@@ -1521,7 +1521,7 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv)
static int stm32_i2c_deinit(struct stm32_i2c_priv_s *priv)
{
/* Disable I2C */
@@ -1559,10 +1559,10 @@ static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
static int stm32_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count)
{
FAR struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
uint32_t status = 0;
#ifdef I2C1_FSMC_CONFLICT
uint32_t ahbenr;
@@ -1782,9 +1782,9 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev,
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int stm32_i2c_reset(FAR struct i2c_master_s *dev)
static int stm32_i2c_reset(struct i2c_master_s *dev)
{
FAR struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
unsigned int clock_count;
unsigned int stretch_count;
uint32_t scl_gpio;
@@ -1917,7 +1917,7 @@ out:
*
****************************************************************************/
FAR struct i2c_master_s *stm32_i2cbus_initialize(int port)
struct i2c_master_s *stm32_i2cbus_initialize(int port)
{
struct stm32_i2c_priv_s * priv = NULL;
irqstate_t flags;
@@ -1978,9 +1978,9 @@ FAR struct i2c_master_s *stm32_i2cbus_initialize(int port)
*
****************************************************************************/
int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev)
int stm32_i2cbus_uninitialize(struct i2c_master_s *dev)
{
FAR struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
irqstate_t flags;
DEBUGASSERT(dev);
+2 -2
View File
@@ -67,7 +67,7 @@
*
****************************************************************************/
FAR struct i2c_master_s *stm32_i2cbus_initialize(int port);
struct i2c_master_s *stm32_i2cbus_initialize(int port);
/****************************************************************************
* Name: stm32_i2cbus_uninitialize
@@ -84,6 +84,6 @@ FAR struct i2c_master_s *stm32_i2cbus_initialize(int port);
*
****************************************************************************/
int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev);
int stm32_i2cbus_uninitialize(struct i2c_master_s *dev);
#endif /* __ARCH_ARM_SRC_STM32_STM32_I2C_H */
+57 -57
View File
@@ -314,59 +314,59 @@ struct stm32_i2c_priv_s
* Private Function Prototypes
****************************************************************************/
static inline uint16_t stm32_i2c_getreg(FAR struct stm32_i2c_priv_s *priv,
static inline uint16_t stm32_i2c_getreg(struct stm32_i2c_priv_s *priv,
uint8_t offset);
static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_putreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t value);
static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_modifyreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t clearbits,
uint16_t setbits);
#ifdef CONFIG_STM32_I2C_DYNTIMEO
static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs);
static useconds_t stm32_i2c_tousecs(int msgc, struct i2c_msg_s *msgs);
#endif /* CONFIG_STM32_I2C_DYNTIMEO */
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_post(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_init(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_destroy(FAR struct stm32_i2c_priv_s *priv);
static inline int stm32_i2c_sem_waitdone(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_waitstop(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_post(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_init(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_destroy(struct stm32_i2c_priv_s *priv);
#ifdef CONFIG_I2C_TRACE
static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv);
static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_tracereset(struct stm32_i2c_priv_s *priv);
static void stm32_i2c_tracenew(struct stm32_i2c_priv_s *priv,
uint16_t status);
static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_traceevent(struct stm32_i2c_priv_s *priv,
uint16_t event, uint32_t parm);
static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv);
static void stm32_i2c_tracedump(struct stm32_i2c_priv_s *priv);
#endif /* CONFIG_I2C_TRACE */
static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_setclock(struct stm32_i2c_priv_s *priv,
uint32_t frequency);
static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_clrstart(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sendstop(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sendstart(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_clrstart(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sendstop(struct stm32_i2c_priv_s *priv);
static inline
uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv);
uint32_t stm32_i2c_getstatus(struct stm32_i2c_priv_s *priv);
#ifdef I2C1_FSMC_CONFLICT
static inline
uint32_t stm32_i2c_disablefsmc(FAR struct stm32_i2c_priv_s *priv);
uint32_t stm32_i2c_disablefsmc(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_enablefsmc(uint32_t ahbenr);
#endif /* I2C1_FSMC_CONFLICT */
static int stm32_i2c_isr_process(struct stm32_i2c_priv_s * priv);
#ifndef CONFIG_I2C_POLLED
static int stm32_i2c_isr(int irq, void *context, FAR void *arg);
static int stm32_i2c_isr(int irq, void *context, void *arg);
#endif /* !CONFIG_I2C_POLLED */
static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv);
static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv);
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
static int stm32_i2c_init(struct stm32_i2c_priv_s *priv);
static int stm32_i2c_deinit(struct stm32_i2c_priv_s *priv);
static int stm32_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
#ifdef CONFIG_I2C_RESET
static int stm32_i2c_reset(FAR struct i2c_master_s *dev);
static int stm32_i2c_reset(struct i2c_master_s *dev);
#endif
/****************************************************************************
@@ -482,7 +482,7 @@ static struct stm32_i2c_priv_s stm32_i2c3_priv =
*
****************************************************************************/
static inline uint16_t stm32_i2c_getreg(FAR struct stm32_i2c_priv_s *priv,
static inline uint16_t stm32_i2c_getreg(struct stm32_i2c_priv_s *priv,
uint8_t offset)
{
return getreg16(priv->config->base + offset);
@@ -496,7 +496,7 @@ static inline uint16_t stm32_i2c_getreg(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_putreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t value)
{
putreg16(value, priv->config->base + offset);
@@ -510,7 +510,7 @@ static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_modifyreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t clearbits,
uint16_t setbits)
{
@@ -527,7 +527,7 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv,
****************************************************************************/
#ifdef CONFIG_STM32_I2C_DYNTIMEO
static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
static useconds_t stm32_i2c_tousecs(int msgc, struct i2c_msg_s *msgs)
{
size_t bytecount = 0;
int i;
@@ -556,7 +556,7 @@ static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
****************************************************************************/
#ifndef CONFIG_I2C_POLLED
static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
static int stm32_i2c_sem_waitdone(struct stm32_i2c_priv_s *priv)
{
struct timespec abstime;
irqstate_t flags;
@@ -639,7 +639,7 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
return ret;
}
#else
static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
static int stm32_i2c_sem_waitdone(struct stm32_i2c_priv_s *priv)
{
clock_t timeout;
clock_t start;
@@ -698,7 +698,7 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sem_waitstop(struct stm32_i2c_priv_s *priv)
{
clock_t start;
clock_t elapsed;
@@ -763,7 +763,7 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sem_post(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sem_post(struct stm32_i2c_priv_s *priv)
{
nxsem_post(&priv->sem_excl);
}
@@ -776,7 +776,7 @@ static inline void stm32_i2c_sem_post(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sem_init(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sem_init(struct stm32_i2c_priv_s *priv)
{
nxsem_init(&priv->sem_excl, 0, 1);
@@ -798,7 +798,7 @@ static inline void stm32_i2c_sem_init(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sem_destroy(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sem_destroy(struct stm32_i2c_priv_s *priv)
{
nxsem_destroy(&priv->sem_excl);
#ifndef CONFIG_I2C_POLLED
@@ -815,7 +815,7 @@ static inline void stm32_i2c_sem_destroy(FAR struct stm32_i2c_priv_s *priv)
****************************************************************************/
#ifdef CONFIG_I2C_TRACE
static void stm32_i2c_traceclear(FAR struct stm32_i2c_priv_s *priv)
static void stm32_i2c_traceclear(struct stm32_i2c_priv_s *priv)
{
struct stm32_trace_s *trace = &priv->trace[priv->tndx];
@@ -826,7 +826,7 @@ static void stm32_i2c_traceclear(FAR struct stm32_i2c_priv_s *priv)
trace->time = 0; /* Time of first status or event */
}
static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
static void stm32_i2c_tracereset(struct stm32_i2c_priv_s *priv)
{
/* Reset the trace info for a new data collection */
@@ -835,7 +835,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
stm32_i2c_traceclear(priv);
}
static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_tracenew(struct stm32_i2c_priv_s *priv,
uint16_t status)
{
struct stm32_trace_s *trace = &priv->trace[priv->tndx];
@@ -877,7 +877,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
}
}
static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_traceevent(struct stm32_i2c_priv_s *priv,
uint16_t event, uint32_t parm)
{
struct stm32_trace_s *trace;
@@ -904,7 +904,7 @@ static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
}
}
static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
static void stm32_i2c_tracedump(struct stm32_i2c_priv_s *priv)
{
struct stm32_trace_s *trace;
int i;
@@ -931,7 +931,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_setclock(struct stm32_i2c_priv_s *priv,
uint32_t frequency)
{
uint16_t cr1;
@@ -1043,7 +1043,7 @@ static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sendstart(struct stm32_i2c_priv_s *priv)
{
/* Disable ACK on receive by default and generate START */
@@ -1059,7 +1059,7 @@ static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_clrstart(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_clrstart(struct stm32_i2c_priv_s *priv)
{
/* "Note: When the STOP, START or PEC bit is set, the software must
* not perform any write access to I2C_CR1 before this bit is
@@ -1090,7 +1090,7 @@ static inline void stm32_i2c_clrstart(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sendstop(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sendstop(struct stm32_i2c_priv_s *priv)
{
stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, I2C_CR1_ACK, I2C_CR1_STOP);
}
@@ -1103,7 +1103,7 @@ static inline void stm32_i2c_sendstop(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv)
static inline uint32_t stm32_i2c_getstatus(struct stm32_i2c_priv_s *priv)
{
uint32_t status = stm32_i2c_getreg(priv, STM32_I2C_SR1_OFFSET);
status |= (stm32_i2c_getreg(priv, STM32_I2C_SR2_OFFSET) << 16);
@@ -1124,7 +1124,7 @@ static inline uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv)
#ifdef I2C1_FSMC_CONFLICT
static inline
uint32_t stm32_i2c_disablefsmc(FAR struct stm32_i2c_priv_s *priv)
uint32_t stm32_i2c_disablefsmc(struct stm32_i2c_priv_s *priv)
{
uint32_t ret = 0;
uint32_t regval;
@@ -1947,7 +1947,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv)
****************************************************************************/
#ifndef CONFIG_I2C_POLLED
static int stm32_i2c_isr(int irq, void *context, FAR void *arg)
static int stm32_i2c_isr(int irq, void *context, void *arg)
{
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)arg;
@@ -1964,7 +1964,7 @@ static int stm32_i2c_isr(int irq, void *context, FAR void *arg)
*
****************************************************************************/
static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
static int stm32_i2c_init(struct stm32_i2c_priv_s *priv)
{
/* Power-up and configure GPIOs */
@@ -2023,7 +2023,7 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv)
static int stm32_i2c_deinit(struct stm32_i2c_priv_s *priv)
{
/* Disable I2C */
@@ -2061,10 +2061,10 @@ static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
static int stm32_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count)
{
FAR struct stm32_i2c_priv_s *priv = (FAR struct stm32_i2c_priv_s *)dev;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
uint32_t status = 0;
#ifdef I2C1_FSMC_CONFLICT
uint32_t ahbenr;
@@ -2297,9 +2297,9 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev,
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int stm32_i2c_reset(FAR struct i2c_master_s * dev)
static int stm32_i2c_reset(struct i2c_master_s * dev)
{
FAR struct stm32_i2c_priv_s *priv = (FAR struct stm32_i2c_priv_s *)dev;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
unsigned int clock_count;
unsigned int stretch_count;
uint32_t scl_gpio;
@@ -2429,7 +2429,7 @@ out:
*
****************************************************************************/
FAR struct i2c_master_s *stm32_i2cbus_initialize(int port)
struct i2c_master_s *stm32_i2cbus_initialize(int port)
{
struct stm32_i2c_priv_s *priv = NULL;
irqstate_t flags;
@@ -2490,9 +2490,9 @@ FAR struct i2c_master_s *stm32_i2cbus_initialize(int port)
*
****************************************************************************/
int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev)
int stm32_i2cbus_uninitialize(struct i2c_master_s *dev)
{
FAR struct stm32_i2c_priv_s *priv = (FAR struct stm32_i2c_priv_s *)dev;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
irqstate_t flags;
DEBUGASSERT(dev);
+67 -67
View File
@@ -444,53 +444,53 @@ struct stm32_i2c_inst_s
* Private Function Prototypes
****************************************************************************/
static inline uint16_t stm32_i2c_getreg(FAR struct stm32_i2c_priv_s *priv,
static inline uint16_t stm32_i2c_getreg(struct stm32_i2c_priv_s *priv,
uint8_t offset);
static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_putreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t value);
static inline void stm32_i2c_putreg32(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_putreg32(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint32_t value);
static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_modifyreg32(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint32_t clearbits,
uint32_t setbits);
#ifdef CONFIG_STM32_I2C_DYNTIMEO
static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs);
static useconds_t stm32_i2c_tousecs(int msgc, struct i2c_msg_s *msgs);
#endif /* CONFIG_STM32_I2C_DYNTIMEO */
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_post(FAR struct i2c_master_s *dev);
static inline void stm32_i2c_sem_init(FAR struct i2c_master_s *dev);
static inline void stm32_i2c_sem_destroy(FAR struct i2c_master_s *dev);
static inline int stm32_i2c_sem_waitdone(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_waitstop(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sem_post(struct i2c_master_s *dev);
static inline void stm32_i2c_sem_init(struct i2c_master_s *dev);
static inline void stm32_i2c_sem_destroy(struct i2c_master_s *dev);
#ifdef CONFIG_I2C_TRACE
static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv);
static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_tracereset(struct stm32_i2c_priv_s *priv);
static void stm32_i2c_tracenew(struct stm32_i2c_priv_s *priv,
uint32_t status);
static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_traceevent(struct stm32_i2c_priv_s *priv,
enum stm32_trace_e event, uint32_t parm);
static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv);
static void stm32_i2c_tracedump(struct stm32_i2c_priv_s *priv);
#endif /* CONFIG_I2C_TRACE */
static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_setclock(struct stm32_i2c_priv_s *priv,
uint32_t frequency);
static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sendstop(FAR struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sendstart(struct stm32_i2c_priv_s *priv);
static inline void stm32_i2c_sendstop(struct stm32_i2c_priv_s *priv);
static inline
uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv);
uint32_t stm32_i2c_getstatus(struct stm32_i2c_priv_s *priv);
static int stm32_i2c_isr_process(struct stm32_i2c_priv_s * priv);
#ifndef CONFIG_I2C_POLLED
static int stm32_i2c_isr(int irq, void *context, FAR void *arg);
static int stm32_i2c_isr(int irq, void *context, void *arg);
#endif
static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv);
static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv);
static int stm32_i2c_init(struct stm32_i2c_priv_s *priv);
static int stm32_i2c_deinit(struct stm32_i2c_priv_s *priv);
static int stm32_i2c_process(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
static int stm32_i2c_process(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
static int stm32_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
#ifdef CONFIG_I2C_RESET
static int stm32_i2c_reset(FAR struct i2c_master_s * dev);
static int stm32_i2c_reset(struct i2c_master_s * dev);
#endif
#ifdef CONFIG_PM
static int stm32_i2c_pm_prepare(FAR struct pm_callback_s *cb, int domain,
static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain,
enum pm_state_e pmstate);
#endif
@@ -648,7 +648,7 @@ static const struct i2c_ops_s stm32_i2c_ops =
*
****************************************************************************/
static inline uint16_t stm32_i2c_getreg(FAR struct stm32_i2c_priv_s *priv,
static inline uint16_t stm32_i2c_getreg(struct stm32_i2c_priv_s *priv,
uint8_t offset)
{
return getreg16(priv->config->base + offset);
@@ -662,7 +662,7 @@ static inline uint16_t stm32_i2c_getreg(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline uint32_t stm32_i2c_getreg32(FAR struct stm32_i2c_priv_s *priv,
static inline uint32_t stm32_i2c_getreg32(struct stm32_i2c_priv_s *priv,
uint8_t offset)
{
return getreg32(priv->config->base + offset);
@@ -676,7 +676,7 @@ static inline uint32_t stm32_i2c_getreg32(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_putreg(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint16_t value)
{
putreg16(value, priv->config->base + offset);
@@ -690,7 +690,7 @@ static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_putreg32(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_putreg32(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint32_t value)
{
putreg32(value, priv->config->base + offset);
@@ -704,7 +704,7 @@ static inline void stm32_i2c_putreg32(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv,
static inline void stm32_i2c_modifyreg32(struct stm32_i2c_priv_s *priv,
uint8_t offset, uint32_t clearbits,
uint32_t setbits)
{
@@ -721,7 +721,7 @@ static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv,
****************************************************************************/
#ifdef CONFIG_STM32_I2C_DYNTIMEO
static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
static useconds_t stm32_i2c_tousecs(int msgc, struct i2c_msg_s *msgs)
{
size_t bytecount = 0;
int i;
@@ -769,7 +769,7 @@ static inline void stm32_i2c_enableinterrupts(struct stm32_i2c_priv_s *priv)
****************************************************************************/
#ifndef CONFIG_I2C_POLLED
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
static inline int stm32_i2c_sem_waitdone(struct stm32_i2c_priv_s *priv)
{
struct timespec abstime;
irqstate_t flags;
@@ -850,7 +850,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
return ret;
}
#else
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
static inline int stm32_i2c_sem_waitdone(struct stm32_i2c_priv_s *priv)
{
clock_t timeout;
clock_t start;
@@ -909,7 +909,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
****************************************************************************/
static inline void
stm32_i2c_set_7bit_address(FAR struct stm32_i2c_priv_s *priv)
stm32_i2c_set_7bit_address(struct stm32_i2c_priv_s *priv)
{
stm32_i2c_modifyreg32(priv, STM32_I2C_CR2_OFFSET, I2C_CR2_SADD7_MASK,
((priv->msgv->addr & 0x7f) << I2C_CR2_SADD7_SHIFT));
@@ -923,8 +923,8 @@ stm32_i2c_set_7bit_address(FAR struct stm32_i2c_priv_s *priv)
****************************************************************************/
static inline void
stm32_i2c_set_bytes_to_transfer(FAR struct stm32_i2c_priv_s *priv,
uint8_t n_bytes)
stm32_i2c_set_bytes_to_transfer(struct stm32_i2c_priv_s *priv,
uint8_t n_bytes)
{
stm32_i2c_modifyreg32(priv, STM32_I2C_CR2_OFFSET, I2C_CR2_NBYTES_MASK,
(n_bytes << I2C_CR2_NBYTES_SHIFT));
@@ -938,7 +938,7 @@ stm32_i2c_set_bytes_to_transfer(FAR struct stm32_i2c_priv_s *priv,
****************************************************************************/
static inline void
stm32_i2c_set_write_transfer_dir(FAR struct stm32_i2c_priv_s *priv)
stm32_i2c_set_write_transfer_dir(struct stm32_i2c_priv_s *priv)
{
stm32_i2c_modifyreg32(priv, STM32_I2C_CR2_OFFSET, I2C_CR2_RD_WRN, 0);
}
@@ -951,7 +951,7 @@ stm32_i2c_set_write_transfer_dir(FAR struct stm32_i2c_priv_s *priv)
****************************************************************************/
static inline void
stm32_i2c_set_read_transfer_dir(FAR struct stm32_i2c_priv_s *priv)
stm32_i2c_set_read_transfer_dir(struct stm32_i2c_priv_s *priv)
{
stm32_i2c_modifyreg32(priv, STM32_I2C_CR2_OFFSET, 0, I2C_CR2_RD_WRN);
}
@@ -964,7 +964,7 @@ stm32_i2c_set_read_transfer_dir(FAR struct stm32_i2c_priv_s *priv)
****************************************************************************/
static inline void
stm32_i2c_enable_reload(FAR struct stm32_i2c_priv_s *priv)
stm32_i2c_enable_reload(struct stm32_i2c_priv_s *priv)
{
stm32_i2c_modifyreg32(priv, STM32_I2C_CR2_OFFSET, 0, I2C_CR2_RELOAD);
}
@@ -977,7 +977,7 @@ stm32_i2c_enable_reload(FAR struct stm32_i2c_priv_s *priv)
****************************************************************************/
static inline void
stm32_i2c_disable_reload(FAR struct stm32_i2c_priv_s *priv)
stm32_i2c_disable_reload(struct stm32_i2c_priv_s *priv)
{
stm32_i2c_modifyreg32(priv, STM32_I2C_CR2_OFFSET, I2C_CR2_RELOAD, 0);
}
@@ -990,7 +990,7 @@ stm32_i2c_disable_reload(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sem_waitstop(struct stm32_i2c_priv_s *priv)
{
clock_t start;
clock_t elapsed;
@@ -1051,7 +1051,7 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sem_post(FAR struct i2c_master_s *dev)
static inline void stm32_i2c_sem_post(struct i2c_master_s *dev)
{
nxsem_post(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl);
}
@@ -1064,7 +1064,7 @@ static inline void stm32_i2c_sem_post(FAR struct i2c_master_s *dev)
*
****************************************************************************/
static inline void stm32_i2c_sem_init(FAR struct i2c_master_s *dev)
static inline void stm32_i2c_sem_init(struct i2c_master_s *dev)
{
nxsem_init(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl, 0, 1);
@@ -1087,7 +1087,7 @@ static inline void stm32_i2c_sem_init(FAR struct i2c_master_s *dev)
*
****************************************************************************/
static inline void stm32_i2c_sem_destroy(FAR struct i2c_master_s *dev)
static inline void stm32_i2c_sem_destroy(struct i2c_master_s *dev)
{
nxsem_destroy(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl);
#ifndef CONFIG_I2C_POLLED
@@ -1104,7 +1104,7 @@ static inline void stm32_i2c_sem_destroy(FAR struct i2c_master_s *dev)
****************************************************************************/
#ifdef CONFIG_I2C_TRACE
static void stm32_i2c_traceclear(FAR struct stm32_i2c_priv_s *priv)
static void stm32_i2c_traceclear(struct stm32_i2c_priv_s *priv)
{
struct stm32_trace_s *trace = &priv->trace[priv->tndx];
@@ -1115,7 +1115,7 @@ static void stm32_i2c_traceclear(FAR struct stm32_i2c_priv_s *priv)
trace->time = 0; /* Time of first status or event */
}
static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
static void stm32_i2c_tracereset(struct stm32_i2c_priv_s *priv)
{
/* Reset the trace info for a new data collection */
@@ -1124,7 +1124,7 @@ static void stm32_i2c_tracereset(FAR struct stm32_i2c_priv_s *priv)
stm32_i2c_traceclear(priv);
}
static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_tracenew(struct stm32_i2c_priv_s *priv,
uint32_t status)
{
struct stm32_trace_s *trace = &priv->trace[priv->tndx];
@@ -1166,7 +1166,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv,
}
}
static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_traceevent(struct stm32_i2c_priv_s *priv,
enum stm32_trace_e event, uint32_t parm)
{
struct stm32_trace_s *trace;
@@ -1193,7 +1193,7 @@ static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
}
}
static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
static void stm32_i2c_tracedump(struct stm32_i2c_priv_s *priv)
{
struct stm32_trace_s *trace;
int i;
@@ -1264,7 +1264,7 @@ static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
static void stm32_i2c_setclock(struct stm32_i2c_priv_s *priv,
uint32_t frequency)
{
uint8_t presc;
@@ -1365,7 +1365,7 @@ static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
*
****************************************************************************/
static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sendstart(struct stm32_i2c_priv_s *priv)
{
bool next_norestart = false;
@@ -1491,7 +1491,7 @@ static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline void stm32_i2c_sendstop(FAR struct stm32_i2c_priv_s *priv)
static inline void stm32_i2c_sendstop(struct stm32_i2c_priv_s *priv)
{
i2cinfo("Sending STOP\n");
stm32_i2c_traceevent(priv, I2CEVENT_WRITE_STOP, 0);
@@ -1507,7 +1507,7 @@ static inline void stm32_i2c_sendstop(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static inline uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv)
static inline uint32_t stm32_i2c_getstatus(struct stm32_i2c_priv_s *priv)
{
return getreg32(priv->config->base + STM32_I2C_ISR_OFFSET);
}
@@ -2185,7 +2185,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv)
****************************************************************************/
#ifndef CONFIG_I2C_POLLED
static int stm32_i2c_isr(int irq, void *context, FAR void *arg)
static int stm32_i2c_isr(int irq, void *context, void *arg)
{
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)arg;
@@ -2202,7 +2202,7 @@ static int stm32_i2c_isr(int irq, void *context, FAR void *arg)
*
****************************************************************************/
static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
static int stm32_i2c_init(struct stm32_i2c_priv_s *priv)
{
/* Power-up and configure GPIOs */
@@ -2255,7 +2255,7 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv)
static int stm32_i2c_deinit(struct stm32_i2c_priv_s *priv)
{
/* Disable I2C */
@@ -2294,11 +2294,11 @@ static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv)
*
****************************************************************************/
static int stm32_i2c_process(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
static int stm32_i2c_process(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count)
{
struct stm32_i2c_inst_s *inst = (struct stm32_i2c_inst_s *)dev;
FAR struct stm32_i2c_priv_s *priv = inst->priv;
struct stm32_i2c_priv_s *priv = inst->priv;
uint32_t status = 0;
uint32_t cr1;
uint32_t cr2;
@@ -2526,8 +2526,8 @@ static int stm32_i2c_process(FAR struct i2c_master_s *dev,
*
****************************************************************************/
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
static int stm32_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count)
{
int ret;
@@ -2551,7 +2551,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev,
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int stm32_i2c_reset(FAR struct i2c_master_s * dev)
static int stm32_i2c_reset(struct i2c_master_s * dev)
{
struct stm32_i2c_priv_s * priv;
unsigned int clock_count;
@@ -2708,7 +2708,7 @@ out:
****************************************************************************/
#ifdef CONFIG_PM
static int stm32_i2c_pm_prepare(FAR struct pm_callback_s *cb, int domain,
static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain,
enum pm_state_e pmstate)
{
struct stm32_i2c_priv_s *priv =
@@ -2769,7 +2769,7 @@ static int stm32_i2c_pm_prepare(FAR struct pm_callback_s *cb, int domain,
*
****************************************************************************/
FAR struct i2c_master_s *stm32_i2cbus_initialize(int port)
struct i2c_master_s *stm32_i2cbus_initialize(int port)
{
struct stm32_i2c_priv_s * priv = NULL; /* private data of device with multiple instances */
struct stm32_i2c_inst_s * inst = NULL; /* device, single instance */
@@ -2855,7 +2855,7 @@ FAR struct i2c_master_s *stm32_i2cbus_initialize(int port)
*
****************************************************************************/
int stm32_i2cbus_uninitialize(FAR struct i2c_master_s * dev)
int stm32_i2cbus_uninitialize(struct i2c_master_s * dev)
{
irqstate_t irqs;
+4 -4
View File
@@ -531,7 +531,7 @@ static bool i2s_checkreg(struct stm32_i2s_s *priv, bool wr, uint16_t regval,
*
****************************************************************************/
static inline uint16_t i2s_getreg(FAR struct stm32_i2s_s *priv,
static inline uint16_t i2s_getreg(struct stm32_i2s_s *priv,
uint8_t offset)
{
uint32_t regaddr = priv->base + offset;
@@ -563,7 +563,7 @@ static inline uint16_t i2s_getreg(FAR struct stm32_i2s_s *priv,
*
****************************************************************************/
static inline void i2s_putreg(FAR struct stm32_i2s_s *priv, uint8_t offset,
static inline void i2s_putreg(struct stm32_i2s_s *priv, uint8_t offset,
uint16_t regval)
{
uint32_t regaddr = priv->base + offset;
@@ -2565,9 +2565,9 @@ static void i2s3_configure(struct stm32_i2s_s *priv)
*
****************************************************************************/
FAR struct i2s_dev_s *stm32_i2sbus_initialize(int port)
struct i2s_dev_s *stm32_i2sbus_initialize(int port)
{
FAR struct stm32_i2s_s *priv = NULL;
struct stm32_i2s_s *priv = NULL;
irqstate_t flags;
int ret;
+1 -1
View File
@@ -63,7 +63,7 @@ extern "C"
*
****************************************************************************/
FAR struct i2s_dev_s *stm32_i2sbus_initialize(int port);
struct i2s_dev_s *stm32_i2sbus_initialize(int port);
#undef EXTERN
#if defined(__cplusplus)
+6 -6
View File
@@ -163,7 +163,7 @@ static void stm32_dumpnvic(const char *msg, int irq)
****************************************************************************/
#ifdef CONFIG_DEBUG_FEATURES
static int stm32_nmi(int irq, FAR void *context, FAR void *arg)
static int stm32_nmi(int irq, void *context, void *arg)
{
up_irq_save();
_err("PANIC!!! NMI received\n");
@@ -171,7 +171,7 @@ static int stm32_nmi(int irq, FAR void *context, FAR void *arg)
return 0;
}
static int stm32_busfault(int irq, FAR void *context, FAR void *arg)
static int stm32_busfault(int irq, void *context, void *arg)
{
up_irq_save();
_err("PANIC!!! Bus fault received: %08" PRIx32 "\n",
@@ -180,7 +180,7 @@ static int stm32_busfault(int irq, FAR void *context, FAR void *arg)
return 0;
}
static int stm32_usagefault(int irq, FAR void *context, FAR void *arg)
static int stm32_usagefault(int irq, void *context, void *arg)
{
up_irq_save();
_err("PANIC!!! Usage fault received: %08" PRIx32 "\n",
@@ -189,7 +189,7 @@ static int stm32_usagefault(int irq, FAR void *context, FAR void *arg)
return 0;
}
static int stm32_pendsv(int irq, FAR void *context, FAR void *arg)
static int stm32_pendsv(int irq, void *context, void *arg)
{
up_irq_save();
_err("PANIC!!! PendSV received\n");
@@ -197,7 +197,7 @@ static int stm32_pendsv(int irq, FAR void *context, FAR void *arg)
return 0;
}
static int stm32_dbgmonitor(int irq, FAR void *context, FAR void *arg)
static int stm32_dbgmonitor(int irq, void *context, void *arg)
{
up_irq_save();
_err("PANIC!!! Debug Monitor received\n");
@@ -205,7 +205,7 @@ static int stm32_dbgmonitor(int irq, FAR void *context, FAR void *arg)
return 0;
}
static int stm32_reserved(int irq, FAR void *context, FAR void *arg)
static int stm32_reserved(int irq, void *context, void *arg)
{
up_irq_save();
_err("PANIC!!! Reserved interrupt\n");

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