Merged nuttx/nuttx into master

This commit is contained in:
Masayuki Ishikawa 2017-04-24 09:39:20 +09:00
commit 33923d962d
294 changed files with 2175 additions and 1285 deletions

View File

@ -190,6 +190,10 @@ config ARCH_HAVE_RESET
bool
default n
config ARCH_HAVE_RTC_SUBSECONDS
bool
default n
config ARCH_USE_MMU
bool "Enable MMU"
default n

View File

@ -52,6 +52,7 @@
#if defined(CONFIG_ARCH_CHIP_STM32F051R8)
# define STM32F051x 1 /* STM32F051x family */
# undef STM32F072x /* Not STM32F072x family */
# undef STM32F091x /* Not STM32F091x family */
# define STM32F0_FLASH_SIZE (64*1024) /* 64Kb */
# define STM32F0_SRAM_SIZE (8*1024) /* 8Kb */
@ -71,6 +72,7 @@
#elif defined(CONFIG_ARCH_CHIP_STM32F072C8) || defined(CONFIG_ARCH_CHIP_STM32F072CB)
# undef STM32F051x /* Not STM32F051x family */
# define STM32F072x 1 /* STM32F072x family */
# undef STM32F091x /* Not STM32F091x family */
# ifdef CONFIG_ARCH_CHIP_STM32F072C8
# define STM32F0_FLASH_SIZE (64*1024) /* 64Kb */
@ -90,9 +92,9 @@
# define STM32F0_NCAN 1 /* One CAN controller */
# define STM32F0_NUSBDEV 1 /* One USB device controller */
# define STM32F0_NCEC 1 /* One HDMI-CEC controller */
# define STM32F0_NADC16 1 /* One 16-bit module */
# define STM32F0_NADC12 1 /* One 12-bit module */
# define STM32F0_NADCCHAN 10 /* Ten external channels */
# define STM32F0_NADCEXT 3 /* Three external channels */
# define STM32F0_NADCINT 3 /* Three internal channels */
# define STM32F0_NDAC 1 /* One DAC module */
# define STM32F0_NDACCHAN 2 /* Two DAC channels */
# define STM32F0_NCOMP 2 /* Two Analog Comparators */
@ -102,6 +104,7 @@
#elif defined(CONFIG_ARCH_CHIP_STM32F072R8) || defined(CONFIG_ARCH_CHIP_STM32F072RB)
# undef STM32F051x /* Not STM32F051x family */
# define STM32F072x 1 /* STM32F072x family */
# undef STM32F091x /* Not STM32F091x family */
# ifdef CONFIG_ARCH_CHIP_STM32F072R8
# define STM32F0_FLASH_SIZE (64*1024) /* 64Kb */
@ -121,9 +124,9 @@
# define STM32F0_NCAN 1 /* One CAN controller */
# define STM32F0_NUSBDEV 1 /* One USB device controller */
# define STM32F0_NCEC 1 /* One HDMI-CEC controller */
# define STM32F0_NADC16 1 /* One 16-bit module */
# define STM32F0_NADC12 1 /* One 12-bit module */
# define STM32F0_NADCCHAN 16 /* 16 external channels */
# define STM32F0_NADCEXT 3 /* Three external channels */
# define STM32F0_NADCINT 3 /* Three internal channels */
# define STM32F0_NDAC 1 /* One DAC module */
# define STM32F0_NDACCHAN 2 /* Two DAC channels */
# define STM32F0_NCOMP 2 /* Two Analog Comparators */
@ -133,6 +136,7 @@
#elif defined(CONFIG_ARCH_CHIP_STM32F072V8) || defined(CONFIG_ARCH_CHIP_STM32F072VB)
# undef STM32F051x /* Not STM32F051x family */
# define STM32F072x 1 /* STM32F072x family */
# undef STM32F091x /* Not STM32F091x family */
# ifdef CONFIG_ARCH_CHIP_STM32F072V8
# define STM32F0_FLASH_SIZE (64*1024) /* 64Kb */
@ -152,15 +156,84 @@
# define STM32F0_NCAN 1 /* One CAN controller */
# define STM32F0_NUSBDEV 1 /* One USB device controller */
# define STM32F0_NCEC 1 /* One HDMI-CEC controller */
# define STM32F0_NADC16 1 /* One 16-bit module */
# define STM32F0_NADC12 1 /* One 12-bit module */
# define STM32F0_NADCCHAN 16 /* 16 external channels */
# define STM32F0_NADCEXT 3 /* Three external channels */
# define STM32F0_NADCINT 3 /* Three internal channels */
# define STM32F0_NDAC 1 /* One DAC module */
# define STM32F0_NDACCHAN 2 /* Two DAC channels */
# define STM32F0_NCOMP 2 /* Two Analog Comparators */
# define STM32F0_NCAP 24 /* Capacitive sensing channels */
# define STM32F0_NPORTS 6 /* Six GPIO ports, GPIOA-F */
#elif defined(CONFIG_ARCH_CHIP_STM32F091CB) || defined(CONFIG_ARCH_CHIP_STM32F091CC)
# undef STM32F051x /* Not STM32F051x family */
# undef STM32F072x /* Not STM32F072x family */
# define STM32F091x 1 /* STM32F091x family */
# ifdef CONFIG_ARCH_CHIP_STM32F091CB
# define STM32F0_FLASH_SIZE (128*1024) /* 128Kb */
# else
# define STM32F0_FLASH_SIZE (256*1024) /* 256Kb */
# endif
# define STM32F0_SRAM_SIZE (32*1024) /* 32Kb */
# define STM32F0_NATIM 1 /* One advanced timer TIM1 */
# define STM32F0_NGTIM16 5 /* 16-bit general up/down timers TIM3, TIM14-17 */
# define STM32F0_NGTIM32 1 /* 32-bit general up/down timers TIM2 */
# define STM32F0_NBTIM 2 /* 2 basic timers: TIM6, TIM7 */
# define STM32F0_NSPI 2 /* Two SPI modules (SPI or I2S) */
# define STM32F0_NI2S 2 /* Two I2S modules (SPI or I2S) */
# define STM32F0_NI2C 2 /* Two I2C modules */
# define STM32F0_NUSART 6 /* Six USARTs modules */
# define STM32F0_NCAN 1 /* One CAN controller */
# define STM32F0_NUSBDEV 0 /* No USB device controller */
# define STM32F0_NCEC 1 /* One HDMI-CEC controller */
# define STM32F0_NADC12 1 /* One 12-bit module */
# define STM32F0_NADCCHAN 10 /* 10 external channels */
# define STM32F0_NADCINT 3 /* Three internal channels */
# define STM32F0_NDAC 1 /* One DAC module */
# define STM32F0_NDACCHAN 2 /* Two DAC channels */
# define STM32F0_NCOMP 2 /* Two Analog Comparators */
# define STM32F0_NCAP 17 /* Capacitive sensing channels */
# define STM32F0_NPORTS 6 /* Six GPIO ports, GPIOA-F */
#elif defined(CONFIG_ARCH_CHIP_STM32F091RB) || defined(CONFIG_ARCH_CHIP_STM32F091RC) \
|| defined(CONFIG_ARCH_CHIP_STM32F091VB) || defined(CONFIG_ARCH_CHIP_STM32F091VC)
# undef STM32F051x /* Not STM32F051x family */
# undef STM32F072x /* Not STM32F072x family */
# define STM32F091x 1 /* STM32F091x family */
# if defined(CONFIG_ARCH_CHIP_STM32F091RB) || defined(CONFIG_ARCH_CHIP_STM32F091VB)
# define STM32F0_FLASH_SIZE (128*1024) /* 128Kb */
# else
# define STM32F0_FLASH_SIZE (256*1024) /* 256Kb */
# endif
# define STM32F0_SRAM_SIZE (32*1024) /* 32Kb */
# define STM32F0_NATIM 1 /* One advanced timer TIM1 */
# define STM32F0_NGTIM16 5 /* 16-bit general up/down timers TIM3, TIM14-17 */
# define STM32F0_NGTIM32 1 /* 32-bit general up/down timers TIM2 */
# define STM32F0_NBTIM 2 /* 2 basic timers: TIM6, TIM7 */
# define STM32F0_NSPI 2 /* Two SPI modules (SPI or I2S) */
# define STM32F0_NI2S 2 /* Two I2S modules (SPI or I2S) */
# define STM32F0_NI2C 2 /* Two I2C modules */
# define STM32F0_NUSART 8 /* Eight USARTs modules */
# define STM32F0_NCAN 1 /* One CAN controller */
# define STM32F0_NUSBDEV 0 /* No USB device controller */
# define STM32F0_NCEC 1 /* One HDMI-CEC controller */
# define STM32F0_NADC12 1 /* One 12-bit module */
# define STM32F0_NADCCHAN 16 /* 16 external channels */
# define STM32F0_NADCINT 3 /* Three internal channels */
# define STM32F0_NDAC 1 /* One DAC module */
# define STM32F0_NDACCHAN 2 /* Two DAC channels */
# define STM32F0_NCOMP 2 /* Two Analog Comparators */
# if defined(CONFIG_ARCH_CHIP_STM32F091VB) || defined(CONFIG_ARCH_CHIP_STM32F091VC)
# define STM32F0_NCAP 24 /* Capacitive sensing channels */
# else
# define STM32F0_NCAP 18 /* Capacitive sensing channels */
# endif
# define STM32F0_NPORTS 6 /* Six GPIO ports, GPIOA-F */
#else
# error "Unsupported STM32F0xx chip"
#endif

View File

@ -2364,7 +2364,7 @@ static void c5471_reset(struct c5471_driver_s *priv)
static void c5471_macassign(struct c5471_driver_s *priv)
{
struct net_driver_s *dev = &priv->c_dev;
uint8_t *mptr = dev->d_mac.ether_addr_octet;
uint8_t *mptr = dev->d_mac.ether.ether_addr_octet;
register uint32_t tmp;
ninfo("MAC: %0x:%0x:%0x:%0x:%0x:%0x\n",

View File

@ -59,7 +59,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -1125,7 +1125,7 @@ static int kinetis_ifup(struct net_driver_s *dev)
{
FAR struct kinetis_driver_s *priv =
(FAR struct kinetis_driver_s *)dev->d_private;
uint8_t *mac = dev->d_mac.ether_addr_octet;
uint8_t *mac = dev->d_mac.ether.ether_addr_octet;
uint32_t regval;
int ret;
@ -2144,7 +2144,7 @@ int kinetis_netinitialize(int intf)
uidl = getreg32(KINETIS_SIM_UIDL);
uidml = getreg32(KINETIS_SIM_UIDML);
mac = priv->dev.d_mac.ether_addr_octet;
mac = priv->dev.d_mac.ether.ether_addr_octet;
uidml |= 0x00000200;
uidml &= 0x0000FEFF;

View File

@ -222,7 +222,7 @@ config CAN_SAM
The bus is sampled 3 times (recommended for low to medium speed buses to spikes on the bus-line).
config CAN_LOOPBACK
bool "CAN looopback mode"
bool "CAN loopback mode"
default n
---help---
Enable CAN loopback mode

View File

@ -589,7 +589,7 @@ config CAN_SAM
The bus is sampled 3 times (recommended for low to medium speed buses to spikes on the bus-line).
config CAN_LOOPBACK
bool "CAN looopback mode"
bool "CAN loopback mode"
default n
---help---
Enable CAN loopback mode

View File

@ -1591,16 +1591,16 @@ static int lpc17_ifup(struct net_driver_s *dev)
/* Configure the MAC station address */
regval = (uint32_t)priv->lp_dev.d_mac.ether_addr_octet[5] << 8 |
(uint32_t)priv->lp_dev.d_mac.ether_addr_octet[4];
regval = (uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[5] << 8 |
(uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[4];
lpc17_putreg(regval, LPC17_ETH_SA0);
regval = (uint32_t)priv->lp_dev.d_mac.ether_addr_octet[3] << 8 |
(uint32_t)priv->lp_dev.d_mac.ether_addr_octet[2];
regval = (uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[3] << 8 |
(uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[2];
lpc17_putreg(regval, LPC17_ETH_SA1);
regval = (uint32_t)priv->lp_dev.d_mac.ether_addr_octet[1] << 8 |
(uint32_t)priv->lp_dev.d_mac.ether_addr_octet[0];
regval = (uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[1] << 8 |
(uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[0];
lpc17_putreg(regval, LPC17_ETH_SA2);
#ifdef CONFIG_NET_ICMPv6

View File

@ -3535,22 +3535,22 @@ static void lpc43_macaddress(FAR struct lpc43_ethmac_s *priv)
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
/* Set the MAC address high register */
regval = ((uint32_t)dev->d_mac.ether_addr_octet[5] << 8) |
(uint32_t)dev->d_mac.ether_addr_octet[4];
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8) |
(uint32_t)dev->d_mac.ether.ether_addr_octet[4];
lpc43_putreg(regval, LPC43_ETH_MACA0HI);
/* Set the MAC address low register */
regval = ((uint32_t)dev->d_mac.ether_addr_octet[3] << 24) |
((uint32_t)dev->d_mac.ether_addr_octet[2] << 16) |
((uint32_t)dev->d_mac.ether_addr_octet[1] << 8) |
(uint32_t)dev->d_mac.ether_addr_octet[0];
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24) |
((uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16) |
((uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8) |
(uint32_t)dev->d_mac.ether.ether_addr_octet[0];
lpc43_putreg(regval, LPC43_ETH_MACA0LO);
}

View File

@ -572,7 +572,6 @@ config SAM34_TWIS
bool
default n
config SAM34_TWIM0
bool "Two-wire Master Interface 0 (TWIM0)"
default n
@ -1142,6 +1141,41 @@ config SAM34_SPI_REGDEBUG
endmenu # AT91SAM3/4 SPI device driver options
endif # SAM34_SPI0 || SAM34_SPI1
if SAM34_TWIM
menu "AT91SAM3/4 TWI master device driver options"
config SAM34_TWIM0_FREQUENCY
int "TWI0 Frequency"
default 100000
depends on SAM34_TWIM0
config SAM34_TWIM1_FREQUENCY
int "TWI1 Frequency"
default 100000
depends on SAM34_TWIM1
config SAM34_TWIM2_FREQUENCY
int "TWI2 Frequency"
default 100000
depends on SAM34_TWIM2
config SAM34_TWIM3_FREQUENCY
int "TWI3 Frequency"
default 100000
depends on SAM34_TWIM3
config SAM34_TWI_REGDEBUG
bool "TWI register level debug"
depends on DEBUG_I2C_INFO
default n
---help---
Output detailed register-level TWI device debug information.
Very invasive! Requires also CONFIG_DEBUG_I2C_INFO.
endmenu # TWI device driver options
endif # SAM34_TWIM
menu "AT91SAM3/4 EMAC device driver options"
depends on SAM34_EMAC

View File

@ -3416,20 +3416,20 @@ static void sam_macaddress(struct sam_emac_s *priv)
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
/* Set the MAC address */
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
sam_putreg(priv, SAM_EMAC_SAB1, regval);
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
sam_putreg(priv, SAM_EMAC_SAT1, regval);
}

View File

@ -71,19 +71,21 @@
#include "sam_gpio.h"
#include "sam_twi.h"
#if defined(CONFIG_SAM34_TWI0) || defined(CONFIG_SAM34_TWI1)
/* REVISIT: Missing support for TWI2 master */
#if defined(CONFIG_SAM34_TWIM0) || defined(CONFIG_SAM34_TWIM1)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ***************************************************************/
#ifndef CONFIG_SAM34_TWI0_FREQUENCY
# define CONFIG_SAM34_TWI0_FREQUENCY 100000
#ifndef CONFIG_SAM34_TWIM0_FREQUENCY
# define CONFIG_SAM34_TWIM0_FREQUENCY 100000
#endif
#ifndef CONFIG_SAM34_TWI1_FREQUENCY
# define CONFIG_SAM34_TWI1_FREQUENCY 100000
#ifndef CONFIG_SAM34_TWIM1_FREQUENCY
# define CONFIG_SAM34_TWIM1_FREQUENCY 100000
#endif
#ifndef CONFIG_DEBUG_I2C_INFO
@ -187,11 +189,11 @@ static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid,
* Private Data
****************************************************************************/
#ifdef CONFIG_SAM34_TWI0
#ifdef CONFIG_SAM34_TWIM0
static struct twi_dev_s g_twi0;
#endif
#ifdef CONFIG_SAM34_TWI1
#ifdef CONFIG_SAM34_TWIM1
static struct twi_dev_s g_twi1;
#endif
@ -430,7 +432,7 @@ static void twi_wakeup(struct twi_dev_s *priv, int result)
*
****************************************************************************/
static int twi_interrupt(int irq, FAR void *context, FAR void *arg);
static int twi_interrupt(int irq, FAR void *context, FAR void *arg)
{
struct twi_dev_s *priv = (struct twi_dev_s *)arg;
struct i2c_msg_s *msg;
@ -901,7 +903,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus)
flags = enter_critical_section();
#ifdef CONFIG_SAM34_TWI0
#ifdef CONFIG_SAM34_TWIM0
if (bus == 0)
{
/* Set up TWI0 register base address and IRQ number */
@ -922,18 +924,18 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus)
/* Select the TWI frequency, and peripheral ID */
frequency = CONFIG_SAM34_TWI0_FREQUENCY;
frequency = CONFIG_SAM34_TWIM0_FREQUENCY;
pid = SAM_PID_TWI0;
}
else
#endif
#ifdef CONFIG_SAM34_TWI1
#ifdef CONFIG_SAM34_TWIM1
if (bus == 1)
{
/* Set up TWI1 register base address and IRQ number */
priv = &g_twi1;
priv->base = SAM_TWI0_BASE;
priv->base = SAM_TWI1_BASE;
priv->irq = SAM_IRQ_TWI1;
priv->twi = 1;
@ -948,7 +950,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus)
/* Select the TWI frequency, and peripheral ID */
frequency = CONFIG_SAMA5_TWI1_FREQUENCY;
frequency = CONFIG_SAM34_TWIM1_FREQUENCY;
pid = SAM_PID_TWI1;
}
else
@ -1029,4 +1031,4 @@ int sam_i2cbus_uninitialize(FAR struct i2c_master_s * dev)
return OK;
}
#endif /* CONFIG_SAM34_TWI0 || CONFIG_SAM34_TWI1 */
#endif /* CONFIG_SAM34_TWIM0 || CONFIG_SAM34_TWIM1 */

View File

@ -3458,20 +3458,20 @@ static void sam_macaddress(struct sam_emac_s *priv)
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
/* Set the MAC address */
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
sam_putreg(priv, SAM_EMAC_SA1B, regval);
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
sam_putreg(priv, SAM_EMAC_SA1T, regval);
}

View File

@ -4106,20 +4106,20 @@ static void sam_macaddress(struct sam_emac_s *priv)
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
/* Set the MAC address */
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
sam_putreg(priv, SAM_EMAC_SAB1_OFFSET, regval);
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
sam_putreg(priv, SAM_EMAC_SAT1_OFFSET, regval);
}

View File

@ -3506,20 +3506,20 @@ static void sam_macaddress(struct sam_gmac_s *priv)
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
/* Set the MAC address */
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
sam_putreg(priv, SAM_GMAC_SAB1, regval);
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
sam_putreg(priv, SAM_GMAC_SAT1, regval);
}

View File

@ -4668,20 +4668,20 @@ static void sam_macaddress(struct sam_emac_s *priv)
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
/* Set the MAC address */
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
sam_putreg(priv, SAM_EMAC_SAB1_OFFSET, regval);
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
sam_putreg(priv, SAM_EMAC_SAT1_OFFSET, regval);
}
@ -5160,13 +5160,13 @@ int sam_emac_setmacaddr(int intf, uint8_t mac[6])
/* Copy the MAC address into the device structure */
dev = &priv->dev;
memcpy(dev->d_mac.ether_addr_octet, mac, 6);
memcpy(dev->d_mac.ether.ether_addr_octet, mac, 6);
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
return OK;
}

View File

@ -6362,6 +6362,7 @@ config STM32_HAVE_RTC_COUNTER
config STM32_HAVE_RTC_SUBSECONDS
bool
select ARCH_HAVE_RTC_SUBSECONDS
default n
config RTC_MAGIC_REG

View File

@ -3674,22 +3674,22 @@ static void stm32_macaddress(FAR struct stm32_ethmac_s *priv)
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
/* Set the MAC address high register */
regval = ((uint32_t)dev->d_mac.ether_addr_octet[5] << 8) |
(uint32_t)dev->d_mac.ether_addr_octet[4];
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8) |
(uint32_t)dev->d_mac.ether.ether_addr_octet[4];
stm32_putreg(regval, STM32_ETH_MACA0HR);
/* Set the MAC address low register */
regval = ((uint32_t)dev->d_mac.ether_addr_octet[3] << 24) |
((uint32_t)dev->d_mac.ether_addr_octet[2] << 16) |
((uint32_t)dev->d_mac.ether_addr_octet[1] << 8) |
(uint32_t)dev->d_mac.ether_addr_octet[0];
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24) |
((uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16) |
((uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8) |
(uint32_t)dev->d_mac.ether.ether_addr_octet[0];
stm32_putreg(regval, STM32_ETH_MACA0LR);
}

View File

@ -928,6 +928,40 @@ int up_rtc_getdatetime(FAR struct tm *tp)
}
#endif
/************************************************************************************
* Name: up_rtc_getdatetime_with_subseconds
*
* Description:
* Get the current date and time from the date/time RTC. This interface
* is only supported by the date/time RTC hardware implementation.
* It is used to replace the system timer. It is only used by the RTOS during
* initialization to set up the system time when CONFIG_RTC and CONFIG_RTC_DATETIME
* are selected (and CONFIG_RTC_HIRES is not).
*
* NOTE: This interface exposes sub-second accuracy capability of RTC hardware.
* This interface allow maintaining timing accuracy when system time needs constant
* resynchronization with RTC, for example on MCU with low-power state that
* stop system timer.
*
* Input Parameters:
* tp - The location to return the high resolution time value.
* nsec - The location to return the subsecond time value.
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
************************************************************************************/
#ifdef CONFIG_ARCH_HAVE_RTC_SUBSECONDS
# ifndef CONFIG_STM32_HAVE_RTC_SUBSECONDS
# error "Invalid config, enable CONFIG_STM32_HAVE_RTC_SUBSECONDS."
# endif
int up_rtc_getdatetime_with_subseconds(FAR struct tm *tp, FAR long *nsec)
{
return stm32_rtc_getdatetime_with_subseconds(tp, nsec);
}
#endif
/************************************************************************************
* Name: stm32_rtc_setdatetime
*

View File

@ -1,5 +1,5 @@
/************************************************************************************
* arch/arm/src/stm32f0/chip/stm32f05xf07x_memorymap.h
* arch/arm/src/stm32f0/chip/stm32f05xf07xf09x_memorymap.h
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -34,8 +34,8 @@
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32F0_CHIP_ST32F05XF07X_MEMORYMAP_H
#define __ARCH_ARM_SRC_STM32F0_CHIP_ST32F05XF07X_MEMORYMAP_H
#ifndef __ARCH_ARM_SRC_STM32F0_CHIP_ST32F05XF07XF09X_MEMORYMAP_H
#define __ARCH_ARM_SRC_STM32F0_CHIP_ST32F05XF07XF09X_MEMORYMAP_H
/************************************************************************************
* Pre-processor Definitions
@ -154,4 +154,4 @@
#define STM32F0_SCS_BASE 0xe000e000
#define STM32F0_DEBUGMCU_BASE 0xe0042000
#endif /* __ARCH_ARM_SRC_STM32F0_CHIP_ST32F05XF07X_MEMORYMAP_H */
#endif /* __ARCH_ARM_SRC_STM32F0_CHIP_ST32F05XF07XF09X_MEMORYMAP_H */

View File

@ -0,0 +1,430 @@
/************************************************************************************
* arch/arm/src/stm32f0/chip/stm32f09x_pinmap.h
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Alan Carvalho de Assis <acassis@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32F0_CHIP_STM32F09X_PINMAP_H
#define __ARCH_ARM_SRC_STM32F0_CHIP_STM32F09X_PINMAP_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include "stm32f0_gpio.h"
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* Alternate Pin Functions.
*
* Alternative pin selections are provided with a numeric suffix like _1, _2, etc.
* Drivers, however, will use the pin selection without the numeric suffix.
* Additional definitions are required in the board.h file. For example, if
* CAN1_RX connects vis PD0 on some board, then the following definition should
* appear inthe board.h header file for that board:
*
* #define GPIO_CAN1_RX GPIO_CAN1_RX_1
*
* The driver will then automatically configre PD0 as the CAN1 RX pin.
*/
/* WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!!
* Additional effort is required to select specific GPIO options such as frequency,
* open-drain/push-pull, and pull-up/down! Just the basics are defined for most
* pins in this file.
*/
/* ADC */
#define GPIO_ADC_IN0 (GPIO_ANALOG | GPIO_PORTA | GPIO_PIN0)
#define GPIO_ADC_IN1 (GPIO_ANALOG | GPIO_PORTA | GPIO_PIN1)
#define GPIO_ADC_IN2 (GPIO_ANALOG | GPIO_PORTA | GPIO_PIN2)
#define GPIO_ADC_IN3 (GPIO_ANALOG | GPIO_PORTA | GPIO_PIN3)
#define GPIO_ADC_IN4 (GPIO_ANALOG | GPIO_PORTA | GPIO_PIN4)
#define GPIO_ADC_IN5 (GPIO_ANALOG | GPIO_PORTA | GPIO_PIN5)
#define GPIO_ADC_IN6 (GPIO_ANALOG | GPIO_PORTA | GPIO_PIN6)
#define GPIO_ADC_IN7 (GPIO_ANALOG | GPIO_PORTA | GPIO_PIN7)
#define GPIO_ADC_IN8 (GPIO_ANALOG | GPIO_PORTB | GPIO_PIN0)
#define GPIO_ADC_IN9 (GPIO_ANALOG | GPIO_PORTB | GPIO_PIN1)
#define GPIO_ADC_IN10 (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN0)
#define GPIO_ADC_IN11 (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN1)
#define GPIO_ADC_IN12 (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN2)
#define GPIO_ADC_IN13 (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN3)
#define GPIO_ADC_IN14 (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN4)
#define GPIO_ADC_IN15 (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN5)
/* CAN */
#define GPIO_CAN_RX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN0)
#define GPIO_CAN_RX_2 (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN11)
#define GPIO_CAN_RX_3 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN8)
#define GPIO_CAN_TX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN1)
#define GPIO_CAN_TX_3 (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN12)
#define GPIO_CAN_TX_4 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN9)
/* HDMI-CEC */
#define GPIO_CEC_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN10)
#define GPIO_CEC_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN8)
#define GPIO_CEC_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN5)
/* Analog Comparators */
#define GPIO_COMP1_OUT_1 (GPIO_ALT | GPIO_AF7 | GPIO_PORTA | GPIO_PIN0)
#define GPIO_COMP1_OUT_2 (GPIO_ALT | GPIO_AF7 | GPIO_PORTA | GPIO_PIN11)
#define GPIO_COMP1_OUT_3 (GPIO_ALT | GPIO_AF7 | GPIO_PORTA | GPIO_PIN6)
#define GPIO_COMP2_OUT_1 (GPIO_ALT | GPIO_AF7 | GPIO_PORTA | GPIO_PIN12)
#define GPIO_COMP2_OUT_2 (GPIO_ALT | GPIO_AF7 | GPIO_PORTA | GPIO_PIN2)
#define GPIO_COMP2_OUT_3 (GPIO_ALT | GPIO_AF7 | GPIO_PORTA | GPIO_PIN7)
/* CRS */
#define GPIO_CRS_SYNC_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN15)
#define GPIO_CRS_SYNC_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTF | GPIO_PIN0)
#define GPIO_CRS_SYNC_3 (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN8)
/* Events */
#define GPIO_EVENTOUT_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN1)
#define GPIO_EVENTOUT_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN11)
#define GPIO_EVENTOUT_3 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN12)
#define GPIO_EVENTOUT_4 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN0)
#define GPIO_EVENTOUT_5 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN11)
#define GPIO_EVENTOUT_6 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN0)
#define GPIO_EVENTOUT_7 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN1)
#define GPIO_EVENTOUT_8 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN2)
#define GPIO_EVENTOUT_9 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN3)
#define GPIO_EVENTOUT_10 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN4)
#define GPIO_EVENTOUT_11 (GPIO_ALT | GPIO_AF0 | GPIO_PORTF | GPIO_PIN2)
#define GPIO_EVENTOUT_12 (GPIO_ALT | GPIO_AF0 | GPIO_PORTF | GPIO_PIN3)
#define GPIO_EVENTOUT_13 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN12)
#define GPIO_EVENTOUT_14 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN3)
#define GPIO_EVENTOUT_15 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN0)
#define GPIO_EVENTOUT_16 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN1)
#define GPIO_EVENTOUT_17 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN4)
#define GPIO_EVENTOUT_18 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN15)
#define GPIO_EVENTOUT_19 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN8)
#define GPIO_EVENTOUT_20 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN9)
#define GPIO_EVENTOUT_21 (GPIO_ALT | GPIO_AF6 | GPIO_PORTA | GPIO_PIN6)
#define GPIO_EVENTOUT_22 (GPIO_ALT | GPIO_AF6 | GPIO_PORTA | GPIO_PIN7)
/* I2C */
#define GPIO_I2C1_SCL_1 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN6)
#define GPIO_I2C1_SCL_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN8)
#define GPIO_I2C1_SDA_1 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN7)
#define GPIO_I2C1_SDA_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN9)
#define GPIO_I2C1_SMBA (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN5)
#define GPIO_I2C2_SCL_1 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN10)
#define GPIO_I2C2_SCL_2 (GPIO_ALT | GPIO_AF5 | GPIO_PORTB | GPIO_PIN13)
#define GPIO_I2C2_SDA_1 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN11)
#define GPIO_I2C2_SDA_2 (GPIO_ALT | GPIO_AF5 | GPIO_PORTB | GPIO_PIN14)
/* I2S */
#define GPIO_I2S1_CK_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN5)
#define GPIO_I2S1_CK_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN3)
#define GPIO_I2S1_CK_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN13)
#define GPIO_I2S1_MCK_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN6)
#define GPIO_I2S1_MCK_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN4)
#define GPIO_I2S1_MCK_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN14)
#define GPIO_I2S1_SD_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN7)
#define GPIO_I2S1_SD_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN5)
#define GPIO_I2S1_SD_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN15)
#define GPIO_I2S1_WS_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN15)
#define GPIO_I2S1_WS_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN4)
#define GPIO_I2S1_WS_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN12)
#define GPIO_I2S2_CK_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN13)
#define GPIO_I2S2_CK_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN1)
#define GPIO_I2S2_CK_3 (GPIO_ALT | GPIO_AF5 | GPIO_PORTB | GPIO_PIN10)
#define GPIO_I2S2_MCK_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN14)
#define GPIO_I2S2_MCK_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN2)
#define GPIO_I2S2_MCK_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN3)
#define GPIO_I2S2_SD_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN15)
#define GPIO_I2S2_SD_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN3)
#define GPIO_I2S2_SD_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN4)
#define GPIO_I2S2_WS_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN12)
#define GPIO_I2S2_WS_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN0)
#define GPIO_I2S2_WS_3 (GPIO_ALT | GPIO_AF5 | GPIO_PORTB | GPIO_PIN9)
/* IR */
#define GPIO_IR_OUT_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN9)
#define GPIO_IR_OUT_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN13)
/* Clock output */
#define GPIO_MCO (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN8)
/* SPI */
#define GPIO_SPI1_MISO_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN6)
#define GPIO_SPI1_MISO_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN4)
#define GPIO_SPI1_MISO_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN14)
#define GPIO_SPI1_MOSI_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN7)
#define GPIO_SPI1_MOSI_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN5)
#define GPIO_SPI1_MOSI_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN15)
#define GPIO_SPI1_NSS_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN15)
#define GPIO_SPI1_NSS_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN4)
#define GPIO_SPI1_NSS_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN12)
#define GPIO_SPI1_SCK_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN5)
#define GPIO_SPI1_SCK_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN3)
#define GPIO_SPI1_SCK_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN13)
#define GPIO_SPI2_MISO_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN14)
#define GPIO_SPI2_MISO_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN2)
#define GPIO_SPI2_MISO_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN3)
#define GPIO_SPI2_MOSI_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN15)
#define GPIO_SPI2_MOSI_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN3)
#define GPIO_SPI2_MOSI_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN4)
#define GPIO_SPI2_NSS_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN12)
#define GPIO_SPI2_NSS_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN0)
#define GPIO_SPI2_NSS_3 (GPIO_ALT | GPIO_AF5 | GPIO_PORTB | GPIO_PIN9)
#define GPIO_SPI2_SCK_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN13)
#define GPIO_SPI2_SCK_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN1)
#define GPIO_SPI2_SCK_3 (GPIO_ALT | GPIO_AF5 | GPIO_PORTB | GPIO_PIN10)
/* SWD */
#define GPIO_SWCLK (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN14)
#define GPIO_SWDIO (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN13)
/* Timers */
#define GPIO_TIM1_BKIN_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN15)
#define GPIO_TIM1_BKIN_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN6)
#define GPIO_TIM1_BKIN_3 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN12)
#define GPIO_TIM1_CH1_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN9)
#define GPIO_TIM1_CH1_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN8)
#define GPIO_TIM1_CH1N_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN8)
#define GPIO_TIM1_CH1N_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN7)
#define GPIO_TIM1_CH1N_3 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN13)
#define GPIO_TIM1_CH2_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN11)
#define GPIO_TIM1_CH2_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN9)
#define GPIO_TIM1_CH2N_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN10)
#define GPIO_TIM1_CH2N_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN0)
#define GPIO_TIM1_CH2N_3 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN14)
#define GPIO_TIM1_CH3_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN13)
#define GPIO_TIM1_CH3_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN10)
#define GPIO_TIM1_CH3N_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN12)
#define GPIO_TIM1_CH3N_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN1)
#define GPIO_TIM1_CH3N_3 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN15)
#define GPIO_TIM1_CH4_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN14)
#define GPIO_TIM1_CH4_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN11)
#define GPIO_TIM1_ETR_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN7)
#define GPIO_TIM1_ETR_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN12)
#define GPIO_TIM2_CH1_ETR_1 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN0)
#define GPIO_TIM2_CH1_ETR_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN15)
#define GPIO_TIM2_CH1_ETR_3 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN5)
#define GPIO_TIM2_CH2_1 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN1)
#define GPIO_TIM2_CH2_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN3)
#define GPIO_TIM2_CH3_1 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN2)
#define GPIO_TIM2_CH3_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN10)
#define GPIO_TIM2_CH4_1 (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN3)
#define GPIO_TIM2_CH4_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN11)
#define GPIO_TIM3_CH1_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN6)
#define GPIO_TIM3_CH1_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN3)
#define GPIO_TIM3_CH1_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN6)
#define GPIO_TIM3_CH1_4 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN4)
#define GPIO_TIM3_CH2_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN7)
#define GPIO_TIM3_CH2_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN4)
#define GPIO_TIM3_CH2_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN7)
#define GPIO_TIM3_CH2_4 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN5)
#define GPIO_TIM3_CH3_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN8)
#define GPIO_TIM3_CH3_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN5)
#define GPIO_TIM3_CH3_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN0)
#define GPIO_TIM3_CH4_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN9)
#define GPIO_TIM3_CH4_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN6)
#define GPIO_TIM3_CH4_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN1)
#define GPIO_TIM3_ETR_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN2)
#define GPIO_TIM3_ETR_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN2)
#define GPIO_TIM14_CH1_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN1)
#define GPIO_TIM14_CH1_2 (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN4)
#define GPIO_TIM14_CH1_3 (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN7)
#define GPIO_TIM15_BKIN_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN9)
#define GPIO_TIM15_BKIN_2 (GPIO_ALT | GPIO_AF5 | GPIO_PORTB | GPIO_PIN12)
#define GPIO_TIM15_CH1_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN2)
#define GPIO_TIM15_CH1_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTF | GPIO_PIN9)
#define GPIO_TIM15_CH1_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN14)
#define GPIO_TIM15_CH1N_1 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN15)
#define GPIO_TIM15_CH1N_2 (GPIO_ALT | GPIO_AF5 | GPIO_PORTA | GPIO_PIN1)
#define GPIO_TIM15_CH2_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN3)
#define GPIO_TIM15_CH2_2 (GPIO_ALT | GPIO_AF0 | GPIO_PORTF | GPIO_PIN10)
#define GPIO_TIM15_CH2_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN15)
#define GPIO_TIM16_BKIN (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN5)
#define GPIO_TIM16_CH1_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN0)
#define GPIO_TIM16_CH1_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN8)
#define GPIO_TIM16_CH1_3 (GPIO_ALT | GPIO_AF5 | GPIO_PORTA | GPIO_PIN6)
#define GPIO_TIM16_CH1N (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN6)
#define GPIO_TIM17_BKIN_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN10)
#define GPIO_TIM17_BKIN_2 (GPIO_ALT | GPIO_AF5 | GPIO_PORTB | GPIO_PIN4)
#define GPIO_TIM17_CH1_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTE | GPIO_PIN1)
#define GPIO_TIM17_CH1_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN9)
#define GPIO_TIM17_CH1_3 (GPIO_ALT | GPIO_AF5 | GPIO_PORTA | GPIO_PIN7)
#define GPIO_TIM17_CH1N (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN7)
/* TSC */
#define GPIO_TSC_G1_IO1 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN0)
#define GPIO_TSC_G1_IO2 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN1)
#define GPIO_TSC_G1_IO3 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN2)
#define GPIO_TSC_G1_IO4 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN3)
#define GPIO_TSC_G2_IO1 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN4)
#define GPIO_TSC_G2_IO2 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN5)
#define GPIO_TSC_G2_IO3 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN6)
#define GPIO_TSC_G2_IO4 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN7)
#define GPIO_TSC_G3_IO1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN5)
#define GPIO_TSC_G3_IO2 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN0)
#define GPIO_TSC_G3_IO3 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN1)
#define GPIO_TSC_G3_IO4 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN2)
#define GPIO_TSC_G4_IO1 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN9)
#define GPIO_TSC_G4_IO2 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN10)
#define GPIO_TSC_G4_IO3 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN11)
#define GPIO_TSC_G4_IO4 (GPIO_ALT | GPIO_AF3 | GPIO_PORTA | GPIO_PIN12)
#define GPIO_TSC_G5_IO1 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN3)
#define GPIO_TSC_G5_IO2 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN4)
#define GPIO_TSC_G5_IO3 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN6)
#define GPIO_TSC_G5_IO4 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN7)
#define GPIO_TSC_G6_IO1 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN11)
#define GPIO_TSC_G6_IO2 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN12)
#define GPIO_TSC_G6_IO3 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN13)
#define GPIO_TSC_G6_IO4 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN14)
#define GPIO_TSC_G7_IO1 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN2)
#define GPIO_TSC_G7_IO2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN3)
#define GPIO_TSC_G7_IO3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN4)
#define GPIO_TSC_G7_IO4 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN5)
#define GPIO_TSC_G8_IO1 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN12)
#define GPIO_TSC_G8_IO2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN13)
#define GPIO_TSC_G8_IO3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN14)
#define GPIO_TSC_G8_IO4 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN15)
#define GPIO_TSC_SYNC_1 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN10)
#define GPIO_TSC_SYNC_2 (GPIO_ALT | GPIO_AF3 | GPIO_PORTB | GPIO_PIN8)
/* USARTs */
#define GPIO_USART1_CK (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN8)
#define GPIO_USART1_CTS (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN11)
#define GPIO_USART1_RTS (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN12)
#define GPIO_USART1_RX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN7)
#define GPIO_USART1_RX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN10)
#define GPIO_USART1_TX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN6)
#define GPIO_USART1_TX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN9)
#define GPIO_USART2_CK_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN7)
#define GPIO_USART2_CK_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN4)
#define GPIO_USART2_CTS_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN3)
#define GPIO_USART2_CTS_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN0)
#define GPIO_USART2_RTS_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN4)
#define GPIO_USART2_RTS_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN1)
#define GPIO_USART2_RX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN6)
#define GPIO_USART2_RX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN15)
#define GPIO_USART2_RX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN3)
#define GPIO_USART2_TX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN5)
#define GPIO_USART2_TX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN14)
#define GPIO_USART2_TX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN2)
#define GPIO_USART3_CK_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN10)
#define GPIO_USART3_CK_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN12)
#define GPIO_USART3_CK_3 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN0)
#define GPIO_USART3_CK_4 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN12)
#define GPIO_USART3_CTS_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN11)
#define GPIO_USART3_CTS_2 (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN6)
#define GPIO_USART3_CTS_3 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN13)
#define GPIO_USART3_RTS_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN12)
#define GPIO_USART3_RTS_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN2)
#define GPIO_USART3_RTS_3 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN1)
#define GPIO_USART3_RTS_4 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN14)
#define GPIO_USART3_RX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN9)
#define GPIO_USART3_RX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN11)
#define GPIO_USART3_RX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN5)
#define GPIO_USART3_RX_4 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN11)
#define GPIO_USART3_TX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN8)
#define GPIO_USART3_TX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN10)
#define GPIO_USART3_TX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN4)
#define GPIO_USART3_TX_4 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN10)
#define GPIO_USART4_CK (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN12)
#define GPIO_USART4_CTS (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN7)
#define GPIO_USART4_RTS (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN15)
#define GPIO_USART4_RX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN11)
#define GPIO_USART4_RX_2 (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN1)
#define GPIO_USART4_TX_1 (GPIO_ALT | GPIO_AF0 | GPIO_PORTC | GPIO_PIN10)
#define GPIO_USART4_TX_2 (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN0)
#define GPIO_USART5_CK_RST_1 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN5)
#define GPIO_USART5_CK_RST_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN7)
#define GPIO_USART5_RX_1 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN4)
#define GPIO_USART5_RX_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTD | GPIO_PIN2)
#define GPIO_USART5_RX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN11)
#define GPIO_USART5_TX_1 (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN3)
#define GPIO_USART5_TX_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTC | GPIO_PIN12)
#define GPIO_USART5_TX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTE | GPIO_PIN10)
#define GPIO_USART6_TX_1 (GPIO_ALT | GPIO_AF5 | GPIO_PORTA | GPIO_PIN4)
#define GPIO_USART6_RX_1 (GPIO_ALT | GPIO_AF5 | GPIO_PORTA | GPIO_PIN5)
#define GPIO_USART6_TX_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTC | GPIO_PIN0)
#define GPIO_USART6_RX_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTC | GPIO_PIN1)
#define GPIO_USART6_TX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTF | GPIO_PIN9)
#define GPIO_USART6_RX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTF | GPIO_PIN10)
#define GPIO_USART6_CK_RST (GPIO_ALT | GPIO_AF2 | GPIO_PORTF | GPIO_PIN3)
#define GPIO_USART7_TX_1 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN0)
#define GPIO_USART7_RX_1 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN1)
#define GPIO_USART7_TX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN6)
#define GPIO_USART7_RX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN7)
#define GPIO_USART7_TX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTF | GPIO_PIN2)
#define GPIO_USART7_RX_3 (GPIO_ALT | GPIO_AF1 | GPIO_PORTF | GPIO_PIN3)
#define GPIO_USART7_CK_RST_1 (GPIO_ALT | GPIO_AF2 | GPIO_PORTD | GPIO_PIN15)
#define GPIO_USART7_CK_RST_2 (GPIO_ALT | GPIO_AF2 | GPIO_PORTF | GPIO_PIN2)
#define GPIO_USART8_TX_1 (GPIO_ALT | GPIO_AF2 | GPIO_PORTC | GPIO_PIN2)
#define GPIO_USART8_RX_1 (GPIO_ALT | GPIO_AF2 | GPIO_PORTC | GPIO_PIN3)
#define GPIO_USART8_TX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN8)
#define GPIO_USART8_RX_2 (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN9)
#define GPIO_USART8_TX_3 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN8)
#define GPIO_USART8_RX_3 (GPIO_ALT | GPIO_AF0 | GPIO_PORTD | GPIO_PIN13)
#define GPIO_USART8_CK_RST (GPIO_ALT | GPIO_AF2 | GPIO_PORTD | GPIO_PIN14)
#endif /* __ARCH_ARM_SRC_STM32F0_CHIP_STM32F09X_PINMAP_H */

View File

@ -44,8 +44,9 @@
#include <nuttx/config.h>
#include "chip.h"
#if defined(CONFIG_STM32F0_STM32F05X) || defined(CONFIG_STM32F0_STM32F07X)
# include "chip/stm32f05xf07x_memorymap.h"
#if defined(CONFIG_STM32F0_STM32F05X) || defined(CONFIG_STM32F0_STM32F07X) \
|| defined(CONFIG_STM32F0_STM32F09X)
# include "chip/stm32f05xf07xf09x_memorymap.h"
#else
# error "Unsupported STM32 memory map"
#endif

View File

@ -47,6 +47,8 @@
# include "chip/stm32f05x_pinmap.h"
#elif defined(CONFIG_STM32F0_STM32F07X)
# include "chip/stm32f07x_pinmap.h"
#elif defined(CONFIG_STM32F0_STM32F09X)
# include "chip/stm32f09x_pinmap.h"
#else
# error "Unsupported STM32F0 pin map"
#endif

View File

@ -1821,6 +1821,7 @@ config STM32F7_HAVE_RTC_COUNTER
config STM32F7_HAVE_RTC_SUBSECONDS
bool
select ARCH_HAVE_RTC_SUBSECONDS
default y
config RTC_MAGIC_REG

View File

@ -3780,22 +3780,22 @@ static void stm32_macaddress(struct stm32_ethmac_s *priv)
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
/* Set the MAC address high register */
regval = ((uint32_t)dev->d_mac.ether_addr_octet[5] << 8) |
(uint32_t)dev->d_mac.ether_addr_octet[4];
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8) |
(uint32_t)dev->d_mac.ether.ether_addr_octet[4];
stm32_putreg(regval, STM32_ETH_MACA0HR);
/* Set the MAC address low register */
regval = ((uint32_t)dev->d_mac.ether_addr_octet[3] << 24) |
((uint32_t)dev->d_mac.ether_addr_octet[2] << 16) |
((uint32_t)dev->d_mac.ether_addr_octet[1] << 8) |
(uint32_t)dev->d_mac.ether_addr_octet[0];
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24) |
((uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16) |
((uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8) |
(uint32_t)dev->d_mac.ether.ether_addr_octet[0];
stm32_putreg(regval, STM32_ETH_MACA0LR);
}

View File

@ -1178,7 +1178,7 @@ int up_rtc_getdatetime(FAR struct tm *tp)
}
rtc_dumptime((FAR const struct tm *)tp, &usecs, "Returning");
#else /* CONFIG_STM32_HAVE_RTC_SUBSECONDS */
#else /* CONFIG_STM32F7_HAVE_RTC_SUBSECONDS */
rtc_dumptime((FAR const struct tm *)tp, NULL, "Returning");
#endif
@ -1215,6 +1215,40 @@ int up_rtc_getdatetime(FAR struct tm *tp)
}
#endif
/************************************************************************************
* Name: up_rtc_getdatetime_with_subseconds
*
* Description:
* Get the current date and time from the date/time RTC. This interface
* is only supported by the date/time RTC hardware implementation.
* It is used to replace the system timer. It is only used by the RTOS during
* initialization to set up the system time when CONFIG_RTC and CONFIG_RTC_DATETIME
* are selected (and CONFIG_RTC_HIRES is not).
*
* NOTE: This interface exposes sub-second accuracy capability of RTC hardware.
* This interface allow maintaining timing accuracy when system time needs constant
* resynchronization with RTC, for example with board level power-save mode utilizing
* deep-sleep modes such as STOP on STM32 MCUs.
*
* Input Parameters:
* tp - The location to return the high resolution time value.
* nsec - The location to return the subsecond time value.
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
************************************************************************************/
#ifdef CONFIG_ARCH_HAVE_RTC_SUBSECONDS
# ifndef CONFIG_STM32F7_HAVE_RTC_SUBSECONDS
# error "Invalid config, enable CONFIG_STM32F7_HAVE_RTC_SUBSECONDS."
# endif
int up_rtc_getdatetime_with_subseconds(FAR struct tm *tp, FAR long *nsec)
{
return stm32_rtc_getdatetime_with_subseconds(tp, nsec);
}
#endif
/****************************************************************************
* Name: stm32_rtc_setdatetime
*

View File

@ -1389,14 +1389,14 @@ static int tiva_ifup(struct net_driver_s *dev)
/* Program the hardware with it's MAC address (for filtering) */
regval = (uint32_t)priv->ld_dev.d_mac.ether_addr_octet[3] << 24 |
(uint32_t)priv->ld_dev.d_mac.ether_addr_octet[2] << 16 |
(uint32_t)priv->ld_dev.d_mac.ether_addr_octet[1] << 8 |
(uint32_t)priv->ld_dev.d_mac.ether_addr_octet[0];
regval = (uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[3] << 24 |
(uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[2] << 16 |
(uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[1] << 8 |
(uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[0];
tiva_ethout(priv, TIVA_MAC_IA0_OFFSET, regval);
regval = (uint32_t)priv->ld_dev.d_mac.ether_addr_octet[5] << 8 |
(uint32_t)priv->ld_dev.d_mac.ether_addr_octet[4];
regval = (uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[5] << 8 |
(uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[4];
tiva_ethout(priv, TIVA_MAC_IA1_OFFSET, regval);
/* Set and activate a timer process */
@ -1696,13 +1696,13 @@ static inline int tiva_ethinitialize(int intf)
priv->ld_txpoll = wd_create(); /* Create periodic poll timer */
priv->ld_txtimeout = wd_create(); /* Create TX timeout timer */
#ifdef CONFIG_TIVA_BOARDMAC
/* If the board can provide us with a MAC address, get the address
* from the board now. The MAC will not be applied until tiva_ifup()
* is called (and the MAC can be overwritten with a netdev ioctl call).
*/
#ifdef CONFIG_TIVA_BOARDMAC
tiva_ethernetmac(&priv->ld_dev.d_mac);
tiva_ethernetmac(&priv->ld_dev.d_mac.ether);
#endif
/* Perform minimal, one-time initialization -- just reset the controller and

View File

@ -3755,22 +3755,22 @@ static void tiva_macaddress(FAR struct tiva_ethmac_s *priv)
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_ifname,
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
/* Set the MAC address high register */
regval = ((uint32_t)dev->d_mac.ether_addr_octet[5] << 8) |
(uint32_t)dev->d_mac.ether_addr_octet[4];
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8) |
(uint32_t)dev->d_mac.ether.ether_addr_octet[4];
tiva_putreg(regval, TIVA_EMAC_ADDR0H);
/* Set the MAC address low register */
regval = ((uint32_t)dev->d_mac.ether_addr_octet[3] << 24) |
((uint32_t)dev->d_mac.ether_addr_octet[2] << 16) |
((uint32_t)dev->d_mac.ether_addr_octet[1] << 8) |
(uint32_t)dev->d_mac.ether_addr_octet[0];
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24) |
((uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16) |
((uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8) |
(uint32_t)dev->d_mac.ether.ether_addr_octet[0];
tiva_putreg(regval, TIVA_EMAC_ADDR0L);
}
@ -4056,7 +4056,7 @@ int tiva_ethinitialize(int intf)
* is called (and the MAC can be overwritten with a netdev ioctl call).
*/
tiva_ethernetmac(&priv->dev.d_mac);
tiva_ethernetmac(&priv->dev.d_mac.ether);
#endif
/* Enable power and clocking to the Ethernet MAC

View File

@ -75,7 +75,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -75,7 +75,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -781,7 +781,7 @@ int emac_initialize(int intf)
* the device and/or calling emac_ifdown().
*/
/* Read the MAC address from the hardware into priv->d_dev.d_mac.ether_addr_octet */
/* Read the MAC address from the hardware into priv->d_dev.d_mac.ether.ether_addr_octet */
/* Register the device with the OS so that socket IOCTLs can be performed */

View File

@ -75,7 +75,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -2216,29 +2216,29 @@ static int pic32mx_ifup(struct net_driver_s *dev)
*/
#if 0
regval = (uint32_t)priv->pd_dev.d_mac.ether_addr_octet[5] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether_addr_octet[4];
regval = (uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[5] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[4];
pic32mx_putreg(regval, PIC32MX_EMAC1_SA0);
regval = (uint32_t)priv->pd_dev.d_mac.ether_addr_octet[3] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether_addr_octet[2];
regval = (uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[3] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[2];
pic32mx_putreg(regval, PIC32MX_EMAC1_SA1);
regval = (uint32_t)priv->pd_dev.d_mac.ether_addr_octet[1] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether_addr_octet[0];
regval = (uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[1] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[0];
pic32mx_putreg(regval, PIC32MX_EMAC1_SA2);
#else
regval = pic32mx_getreg(PIC32MX_EMAC1_SA0);
priv->pd_dev.d_mac.ether_addr_octet[4] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether_addr_octet[5] = (uint32_t)((regval >> 8) & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[4] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[5] = (uint32_t)((regval >> 8) & 0xff);
regval = pic32mx_getreg(PIC32MX_EMAC1_SA1);
priv->pd_dev.d_mac.ether_addr_octet[2] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether_addr_octet[3] = (uint32_t)((regval >> 8) & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[2] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[3] = (uint32_t)((regval >> 8) & 0xff);
regval = pic32mx_getreg(PIC32MX_EMAC1_SA2);
priv->pd_dev.d_mac.ether_addr_octet[0] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether_addr_octet[1] = (uint32_t)((regval >> 8) & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[0] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[1] = (uint32_t)((regval >> 8) & 0xff);
#endif
/* Continue Ethernet Controller Initialization ****************************/

View File

@ -2243,34 +2243,34 @@ static int pic32mz_ifup(struct net_driver_s *dev)
*/
#if 0
regval = (uint32_t)priv->pd_dev.d_mac.ether_addr_octet[5] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether_addr_octet[4];
regval = (uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[5] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[4];
pic32mz_putreg(regval, PIC32MZ_EMAC1_SA0);
regval = (uint32_t)priv->pd_dev.d_mac.ether_addr_octet[3] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether_addr_octet[2];
regval = (uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[3] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[2];
pic32mz_putreg(regval, PIC32MZ_EMAC1_SA1);
regval = (uint32_t)priv->pd_dev.d_mac.ether_addr_octet[1] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether_addr_octet[0];
regval = (uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[1] << 8 |
(uint32_t)priv->pd_dev.d_mac.ether.ether_addr_octet[0];
pic32mz_putreg(regval, PIC32MZ_EMAC1_SA2);
#else
regval = pic32mz_getreg(PIC32MZ_EMAC1_SA0);
priv->pd_dev.d_mac.ether_addr_octet[4] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether_addr_octet[5] = (uint32_t)((regval >> 8) & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[4] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[5] = (uint32_t)((regval >> 8) & 0xff);
regval = pic32mz_getreg(PIC32MZ_EMAC1_SA1);
priv->pd_dev.d_mac.ether_addr_octet[2] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether_addr_octet[3] = (uint32_t)((regval >> 8) & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[2] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[3] = (uint32_t)((regval >> 8) & 0xff);
regval = pic32mz_getreg(PIC32MZ_EMAC1_SA2);
priv->pd_dev.d_mac.ether_addr_octet[0] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether_addr_octet[1] = (uint32_t)((regval >> 8) & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[0] = (uint32_t)(regval & 0xff);
priv->pd_dev.d_mac.ether.ether_addr_octet[1] = (uint32_t)((regval >> 8) & 0xff);
ninfo("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
#endif
/* Continue Ethernet Controller Initialization ****************************/

View File

@ -833,7 +833,7 @@ static int misoc_net_ifup(FAR struct net_driver_s *dev)
/* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */
/* Instantiate the MAC address from priv->misoc_net_dev.d_mac.ether_addr_octet */
/* Instantiate the MAC address from priv->misoc_net_dev.d_mac.ether.ether_addr_octet */
#ifdef CONFIG_NET_ICMPv6
/* Set up IPv6 multicast address filtering */
@ -1182,7 +1182,7 @@ int misoc_net_initialize(int intf)
*/
/* Read the MAC address from the hardware into
* priv->misoc_net_dev.d_mac.ether_addr_octet
* priv->misoc_net_dev.d_mac.ether.ether_addr_octet
*/
/* Register the device with the OS so that socket IOCTLs can be performed */

View File

@ -59,7 +59,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -75,7 +75,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -198,7 +198,7 @@ void netdriver_loop(void)
* up_comparemac will always return 0.
*/
is_ours = (up_comparemac(eth->dest, &g_sim_dev.d_mac) == 0);
is_ours = (up_comparemac(eth->dest, &g_sim_dev.d_mac.ether) == 0);
#ifdef CONFIG_NET_PKT
/* When packet sockets are enabled, feed the frame into the packet
@ -359,7 +359,7 @@ int netdriver_init(void)
int netdriver_setmacaddr(unsigned char *macaddr)
{
(void)memcpy(g_sim_dev.d_mac.ether_addr_octet, macaddr, IFHWADDRLEN);
(void)memcpy(g_sim_dev.d_mac.ether.ether_addr_octet, macaddr, IFHWADDRLEN);
return 0;
}

View File

@ -75,7 +75,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -59,7 +59,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -77,7 +77,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -77,7 +77,7 @@
* Description:
* Delay inline for the requested number of microseconds. NOTE: Because
* of all of the setup, several microseconds will be lost before the actual
* timing looop begins. Thus, the delay will always be a few microseconds
* timing loop begins. Thus, the delay will always be a few microseconds
* longer than requested.
*
* *** NOT multi-tasking friendly ***

View File

@ -1999,9 +1999,9 @@ static int ez80emac_ifup(FAR struct net_driver_s *dev)
int ret;
ninfo("Bringing up: MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
ninfo(" IP %d.%d.%d.%d\n",
dev->d_ipaddr >> 24, (dev->d_ipaddr >> 16) & 0xff,
(dev->d_ipaddr >> 8) & 0xff, dev->d_ipaddr & 0xff);
@ -2028,12 +2028,12 @@ static int ez80emac_ifup(FAR struct net_driver_s *dev)
/* Set the MAC address */
outp(EZ80_EMAC_STAD_0, priv->dev.d_mac.ether_addr_octet[0]);
outp(EZ80_EMAC_STAD_1, priv->dev.d_mac.ether_addr_octet[1]);
outp(EZ80_EMAC_STAD_2, priv->dev.d_mac.ether_addr_octet[2]);
outp(EZ80_EMAC_STAD_3, priv->dev.d_mac.ether_addr_octet[3]);
outp(EZ80_EMAC_STAD_4, priv->dev.d_mac.ether_addr_octet[4]);
outp(EZ80_EMAC_STAD_5, priv->dev.d_mac.ether_addr_octet[5]);
outp(EZ80_EMAC_STAD_0, priv->dev.d_mac.ether.ether_addr_octet[0]);
outp(EZ80_EMAC_STAD_1, priv->dev.d_mac.ether.ether_addr_octet[1]);
outp(EZ80_EMAC_STAD_2, priv->dev.d_mac.ether.ether_addr_octet[2]);
outp(EZ80_EMAC_STAD_3, priv->dev.d_mac.ether.ether_addr_octet[3]);
outp(EZ80_EMAC_STAD_4, priv->dev.d_mac.ether.ether_addr_octet[4]);
outp(EZ80_EMAC_STAD_5, priv->dev.d_mac.ether.ether_addr_octet[5]);
/* Enable/disable promiscuous mode */
@ -2542,7 +2542,7 @@ int up_netinitialize(void)
priv->txpoll = wd_create(); /* Create periodic poll timer */
priv->txtimeout = wd_create(); /* Create TX timeout timer */
/* Read the MAC address from the hardware into priv->dev.d_mac.ether_addr_octet */
/* Read the MAC address from the hardware into priv->dev.d_mac.ether.ether_addr_octet */
/* Register the device with the OS so that socket IOCTLs can be performed */

View File

@ -1,9 +1,9 @@
Nucleo-F072RB README
====================
This README file discusess the port of NuttX to the STMicro Nucleo-F4072RB
board. That board features the STM32F072RBT6 MCU with 128KiB with 128KiB
of FLASH and 16KiB of SRAM.
This README file discusses the port of NuttX to the STMicro Nucleo-F072RB
board. That board features the STM32F072RBT6 MCU with 128KiB of FLASH
and 16KiB of SRAM.
Contents
========
@ -53,8 +53,8 @@ LEDs
These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
defined. In that case, the usage by the board port is defined in
include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
events as follows when the red LED (PE24) is available:
include/board.h and src/stm32_autoleds.c. The LEDs are used to encode
OS-related events as follows when the red LED (PE24) is available:
SYMBOL Meaning LD2
------------------- ----------------------- -----------
@ -192,11 +192,11 @@ Configurations
Information Common to All Configurations
----------------------------------------
Each Clicker2 configuration is maintained in a sub-directory and can be
Each configuration is maintained in a sub-directory and can be
selected as follow:
cd tools
./configure.sh nucleo-f702rb/<subdir>
./configure.sh nucleo-f072rb/<subdir>
cd -
. ./setenv.sh

View File

@ -136,7 +136,7 @@ static const uint32_t pool_twist[8] =
****************************************************************************/
/****************************************************************************
* Function: addentropy
* Name: addentropy
*
* Description:
*
@ -201,7 +201,7 @@ static void addentropy(FAR const uint32_t *buf, size_t n, bool inc_new)
}
/****************************************************************************
* Function: getentropy
* Name: getentropy
*
* Description:
* Hash entropy pool to BLAKE2s context. This is an internal interface for
@ -385,7 +385,7 @@ static void rng_init(void)
****************************************************************************/
/****************************************************************************
* Function: up_rngaddint
* Name: up_rngaddint
*
* Description:
* Add one integer to entropy pool, contributing a specific kind
@ -410,7 +410,7 @@ void up_rngaddint(enum rnd_source_t kindof, int val)
}
/****************************************************************************
* Function: up_rngaddentropy
* Name: up_rngaddentropy
*
* Description:
* Add buffer of integers to entropy pool.
@ -490,7 +490,7 @@ void up_rngaddentropy(enum rnd_source_t kindof, FAR const uint32_t *buf,
}
/****************************************************************************
* Function: up_rngreseed
* Name: up_rngreseed
*
* Description:
* Force reseeding random number generator from entropy pool
@ -513,7 +513,7 @@ void up_rngreseed(void)
}
/****************************************************************************
* Function: up_randompool_initialize
* Name: up_randompool_initialize
*
* Description:
* Initialize entropy pool and random number generator
@ -530,7 +530,7 @@ void up_randompool_initialize(void)
}
/****************************************************************************
* Function: getrandom
* Name: getrandom
*
* Description:
* Fill a buffer of arbitrary length with randomness. This is the

View File

@ -159,7 +159,7 @@ static struct ads7843e_dev_s *g_ads7843elist;
****************************************************************************/
/****************************************************************************
* Function: ads7843e_lock
* Name: ads7843e_lock
*
* Description:
* Lock the SPI bus and re-configure as necessary. This function must be
@ -198,7 +198,7 @@ static void ads7843e_lock(FAR struct spi_dev_s *spi)
}
/****************************************************************************
* Function: ads7843e_unlock
* Name: ads7843e_unlock
*
* Description:
* Un-lock the SPI bus after each transfer, possibly losing the current

View File

@ -159,7 +159,7 @@ static struct max11802_dev_s *g_max11802list;
****************************************************************************/
/****************************************************************************
* Function: max11802_lock
* Name: max11802_lock
*
* Description:
* Lock the SPI bus and re-configure as necessary. This function must be
@ -196,7 +196,7 @@ static void max11802_lock(FAR struct spi_dev_s *spi)
}
/****************************************************************************
* Function: max11802_unlock
* Name: max11802_unlock
*
* Description:
* Un-lock the SPI bus after each transfer, possibly losing the current

View File

@ -61,7 +61,7 @@
****************************************************************************/
/****************************************************************************
* Function: iob_dump
* Name: iob_dump
*
* Description:
* Dump the contents of a I/O buffer chain

View File

@ -637,7 +637,7 @@ static const uint8_t g_setcon[] =
**************************************************************************************/
/**************************************************************************************
* Function: nokia_select
* Name: nokia_select
*
* Description:
* Select the SPI, locking and re-configuring if necessary
@ -674,7 +674,7 @@ static void nokia_select(FAR struct spi_dev_s *spi)
}
/**************************************************************************************
* Function: nokia_deselect
* Name: nokia_deselect
*
* Description:
* De-select the SPI

View File

@ -343,7 +343,7 @@ static struct st7567_dev_s g_st7567dev =
**************************************************************************************/
/**************************************************************************************
* Function: st7567_select
* Name: st7567_select
*
* Description:
* Select the SPI, locking and re-configuring if necessary
@ -380,7 +380,7 @@ static void st7567_select(FAR struct spi_dev_s *spi)
}
/**************************************************************************************
* Function: st7567_deselect
* Name: st7567_deselect
*
* Description:
* De-select the SPI

View File

@ -377,7 +377,7 @@ static inline FAR const char *ug_powerstring(uint8_t power)
}
/**************************************************************************************
* Function: ug_select
* Name: ug_select
*
* Description:
* Select the SPI, locking and re-configuring if necessary
@ -414,7 +414,7 @@ static void ug_select(FAR struct spi_dev_s *spi)
}
/**************************************************************************************
* Function: ug_deselect
* Name: ug_deselect
*
* Description:
* De-select the SPI

View File

@ -137,7 +137,7 @@ static int cs89x0_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
****************************************************************************/
/****************************************************************************
* Function: cs89x0_getreg and cs89x0_putreg
* Name: cs89x0_getreg and cs89x0_putreg
*
* Description:
* Read from and write to a CS89x0 register
@ -172,7 +172,7 @@ static void cs89x0_putreg(struct cs89x0_driver_s *cs89x0, int offset, uint16_t v
}
/****************************************************************************
* Function: cs89x0_getppreg and cs89x0_putppreg
* Name: cs89x0_getppreg and cs89x0_putppreg
*
* Description:
* Read from and write to a CS89x0 page packet register
@ -257,7 +257,7 @@ static void cs89x0_putppreg(struct cs89x0_driver_s *cs89x0, int addr, uint16_t v
}
/****************************************************************************
* Function: cs89x0_transmit
* Name: cs89x0_transmit
*
* Description:
* Start hardware transmission. Called either from the txdone interrupt
@ -298,7 +298,7 @@ static int cs89x0_transmit(struct cs89x0_driver_s *cs89x0)
}
/****************************************************************************
* Function: cs89x0_txpoll
* Name: cs89x0_txpoll
*
* Description:
* The transmitter is available, check if the network has any outgoing packets ready
@ -368,7 +368,7 @@ static int cs89x0_txpoll(struct net_driver_s *dev)
}
/****************************************************************************
* Function: cs89x0_receive
* Name: cs89x0_receive
*
* Description:
* An interrupt was received indicating the availability of a new RX packet
@ -554,7 +554,7 @@ static void cs89x0_receive(FAR struct cs89x0_driver_s *cs89x0, uint16_t isq)
}
/****************************************************************************
* Function: cs89x0_txdone
* Name: cs89x0_txdone
*
* Description:
* An interrupt was received indicating that the last TX packet(s) is done
@ -611,7 +611,7 @@ static void cs89x0_txdone(struct cs89x0_driver_s *cs89x0, uint16_t isq)
}
/****************************************************************************
* Function: cs89x0_interrupt
* Name: cs89x0_interrupt
*
* Description:
* Hardware interrupt handler
@ -680,7 +680,7 @@ static int cs89x0_interrupt(int irq, FAR void *context, FAR void *arg)
}
/****************************************************************************
* Function: cs89x0_txtimeout
* Name: cs89x0_txtimeout
*
* Description:
* Our TX watchdog timed out. Called from the timer interrupt handler.
@ -713,7 +713,7 @@ static void cs89x0_txtimeout(int argc, uint32_t arg, ...)
}
/****************************************************************************
* Function: cs89x0_polltimer
* Name: cs89x0_polltimer
*
* Description:
* Periodic timer handler. Called from the timer interrupt handler.
@ -747,7 +747,7 @@ static void cs89x0_polltimer(int argc, uint32_t arg, ...)
}
/****************************************************************************
* Function: cs89x0_ifup
* Name: cs89x0_ifup
*
* Description:
* NuttX Callback: Bring up the Ethernet interface when an IP address is
@ -787,7 +787,7 @@ static int cs89x0_ifup(struct net_driver_s *dev)
}
/****************************************************************************
* Function: cs89x0_ifdown
* Name: cs89x0_ifdown
*
* Description:
* NuttX Callback: Stop the interface.
@ -825,7 +825,7 @@ static int cs89x0_ifdown(struct net_driver_s *dev)
}
/****************************************************************************
* Function: cs89x0_txavail
* Name: cs89x0_txavail
*
* Description:
* Driver callback invoked when new TX data is available. This is a
@ -867,7 +867,7 @@ static int cs89x0_txavail(struct net_driver_s *dev)
}
/****************************************************************************
* Function: cs89x0_addmac
* Name: cs89x0_addmac
*
* Description:
* NuttX Callback: Add the specified MAC address to the hardware multicast
@ -897,7 +897,7 @@ static int cs89x0_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: cs89x0_rmmac
* Name: cs89x0_rmmac
*
* Description:
* NuttX Callback: Remove the specified MAC address from the hardware multicast
@ -931,7 +931,7 @@ static int cs89x0_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
****************************************************************************/
/****************************************************************************
* Function: cs89x0_initialize
* Name: cs89x0_initialize
*
* Description:
* Initialize the Ethernet driver
@ -1006,7 +1006,7 @@ int cs89x0_initialize(FAR const cs89x0_driver_s *cs89x0, int devno)
cs89x0->cs_txpoll = wd_create(); /* Create periodic poll timer */
cs89x0->cs_txtimeout = wd_create(); /* Create TX timeout timer */
/* Read the MAC address from the hardware into cs89x0->cs_dev.d_mac.ether_addr_octet */
/* Read the MAC address from the hardware into cs89x0->cs_dev.d_mac.ether.ether_addr_octet */
/* Register the device with the OS so that socket IOCTLs can be performed */

View File

@ -419,7 +419,7 @@ static void dm9x_reset(struct dm9x_driver_s *priv);
****************************************************************************/
/****************************************************************************
* Function: getreg and setreg
* Name: getreg and setreg
*
* Description:
* Access to memory-mapped DM90x0 8-bit registers
@ -448,7 +448,7 @@ static void putreg(int reg, uint8_t value)
}
/****************************************************************************
* Function: read8, read16, read32
* Name: read8, read16, read32
*
* Description:
* Read packet data from the DM90x0 SRAM based on its current I/O mode
@ -496,7 +496,7 @@ static void read32(FAR uint8_t *ptr, int len)
}
/****************************************************************************
* Function: discard8, discard16, discard32
* Name: discard8, discard16, discard32
*
* Description:
* Read and discard packet data in the DM90x0 SRAM based on its current
@ -540,7 +540,7 @@ static void discard32(int len)
}
/****************************************************************************
* Function: write8, write16, write32
* Name: write8, write16, write32
*
* Description:
* Write packet data into the DM90x0 SRAM based on its current I/O mode
@ -591,7 +591,7 @@ static void write32(FAR const uint8_t *ptr, int len)
}
/****************************************************************************
* Function: dm9x_readsrom
* Name: dm9x_readsrom
*
* Description:
* Read a word from SROM
@ -619,7 +619,7 @@ static uint16_t dm9x_readsrom(struct dm9x_driver_s *priv, int offset)
#endif
/****************************************************************************
* Function: dm9x_phyread and dm9x_phywrite
* Name: dm9x_phyread and dm9x_phywrite
*
* Description:
* Read/write data from/to the PHY
@ -672,7 +672,7 @@ static void dm9x_phywrite(struct dm9x_driver_s *priv, int reg, uint16_t value)
}
/****************************************************************************
* Function: dm9x_rxchecksumready
* Name: dm9x_rxchecksumready
*
* Description:
* Return true if the RX checksum is available
@ -700,7 +700,7 @@ static inline bool dm9x_rxchecksumready(uint8_t rxbyte)
#endif
/****************************************************************************
* Function: dm9x_transmit
* Name: dm9x_transmit
*
* Description:
* Start hardware transmission. Called either from the txdone interrupt
@ -767,7 +767,7 @@ static int dm9x_transmit(struct dm9x_driver_s *priv)
}
/****************************************************************************
* Function: dm9x_txpoll
* Name: dm9x_txpoll
*
* Description:
* The transmitter is available, check if the network has any outgoing packets ready
@ -843,7 +843,7 @@ static int dm9x_txpoll(struct net_driver_s *dev)
}
/****************************************************************************
* Function: dm9x_receive
* Name: dm9x_receive
*
* Description:
* An interrupt was received indicating the availability of a new RX packet
@ -1041,7 +1041,7 @@ static void dm9x_receive(FAR struct dm9x_driver_s *priv)
}
/****************************************************************************
* Function: dm9x_txdone
* Name: dm9x_txdone
*
* Description:
* An interrupt was received indicating that the last TX packet(s) is done
@ -1104,7 +1104,7 @@ static void dm9x_txdone(struct dm9x_driver_s *priv)
}
/****************************************************************************
* Function: dm9x_interrupt_work
* Name: dm9x_interrupt_work
*
* Description:
* Perform interrupt related work from the worker thread
@ -1223,7 +1223,7 @@ static void dm9x_interrupt_work(FAR void *arg)
}
/****************************************************************************
* Function: dm9x_interrupt
* Name: dm9x_interrupt
*
* Description:
* Hardware interrupt handler
@ -1275,7 +1275,7 @@ static int dm9x_interrupt(int irq, FAR void *context, FAR void *arg)
}
/****************************************************************************
* Function: dm9x_txtimeout_work
* Name: dm9x_txtimeout_work
*
* Description:
* Perform TX timeout related work from the worker thread
@ -1319,7 +1319,7 @@ static void dm9x_txtimeout_work(FAR void *arg)
}
/****************************************************************************
* Function: dm9x_txtimeout_expiry
* Name: dm9x_txtimeout_expiry
*
* Description:
* Our TX watchdog timed out. Called from the timer interrupt handler.
@ -1354,7 +1354,7 @@ static void dm9x_txtimeout_expiry(int argc, wdparm_t arg, ...)
}
/****************************************************************************
* Function: dm9x_poll_work
* Name: dm9x_poll_work
*
* Description:
* Perform periodic polling from the worker thread
@ -1407,7 +1407,7 @@ static void dm9x_poll_work(FAR void *arg)
}
/****************************************************************************
* Function: dm9x_poll_expiry
* Name: dm9x_poll_expiry
*
* Description:
* Periodic timer handler. Called from the timer interrupt handler.
@ -1434,7 +1434,7 @@ static void dm9x_poll_expiry(int argc, wdparm_t arg, ...)
}
/****************************************************************************
* Function: dm9x_phymode
* Name: dm9x_phymode
*
* Description:
* Configure the PHY operating mode
@ -1478,7 +1478,7 @@ static inline void dm9x_phymode(struct dm9x_driver_s *priv)
}
/****************************************************************************
* Function: dm9x_ifup
* Name: dm9x_ifup
*
* Description:
* NuttX Callback: Bring up the DM90x0 interface when an IP address is
@ -1545,7 +1545,7 @@ static int dm9x_ifup(struct net_driver_s *dev)
}
/****************************************************************************
* Function: dm9x_ifdown
* Name: dm9x_ifdown
*
* Description:
* NuttX Callback: Stop the interface.
@ -1591,7 +1591,7 @@ static int dm9x_ifdown(struct net_driver_s *dev)
}
/****************************************************************************
* Function: dm9x_txavail_work
* Name: dm9x_txavail_work
*
* Description:
* Perform an out-of-cycle poll on the worker thread.
@ -1635,7 +1635,7 @@ static void dm9x_txavail_work(FAR void *arg)
}
/****************************************************************************
* Function: dm9x_txavail
* Name: dm9x_txavail
*
* Description:
* Driver callback invoked when new TX data is available. This is a
@ -1673,7 +1673,7 @@ static int dm9x_txavail(FAR struct net_driver_s *dev)
}
/****************************************************************************
* Function: dm9x_addmac
* Name: dm9x_addmac
*
* Description:
* NuttX Callback: Add the specified MAC address to the hardware multicast
@ -1703,7 +1703,7 @@ static int dm9x_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: dm9x_rmmac
* Name: dm9x_rmmac
*
* Description:
* NuttX Callback: Remove the specified MAC address from the hardware multicast
@ -1733,7 +1733,7 @@ static int dm9x_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: dm9x_bringup
* Name: dm9x_bringup
*
* Description:
* Initialize the dm90x0 chip
@ -1829,7 +1829,7 @@ static void dm9x_bringup(struct dm9x_driver_s *priv)
}
/****************************************************************************
* Function: dm9x_reset
* Name: dm9x_reset
*
* Description:
* Stop, reset, re-initialize, and restart the DM90x0 chip and driver. At
@ -1886,7 +1886,7 @@ static void dm9x_reset(struct dm9x_driver_s *priv)
****************************************************************************/
/****************************************************************************
* Function: dm9x_initialize
* Name: dm9x_initialize
*
* Description:
* Initialize the DM90x0 driver
@ -1955,7 +1955,7 @@ int dm9x_initialize(void)
/* Read the MAC address */
mptr = g_dm9x[0].dm_dev.d_mac.ether_addr_octet;
mptr = g_dm9x[0].dm_dev.d_mac.ether.ether_addr_octet;
for (i = 0, j = DM9X_PAB0; i < ETHER_ADDR_LEN; i++, j++)
{
mptr[i] = getreg(j);

View File

@ -358,7 +358,7 @@ static int enc_reset(FAR struct enc_driver_s *priv);
****************************************************************************/
/****************************************************************************
* Function: enc_configspi
* Name: enc_configspi
*
* Description:
* Configure the SPI for use with the ENC28J60
@ -384,7 +384,7 @@ static inline void enc_configspi(FAR struct spi_dev_s *spi)
}
/****************************************************************************
* Function: enc_lock
* Name: enc_lock
*
* Description:
* Select the SPI, locking and re-configuring if necessary
@ -418,7 +418,7 @@ static void enc_lock(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_unlock
* Name: enc_unlock
*
* Description:
* De-select the SPI
@ -441,7 +441,7 @@ static inline void enc_unlock(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_rdgreg2
* Name: enc_rdgreg2
*
* Description:
* Read a global register (EIE, EIR, ESTAT, ECON2, or ECON1). The cmd
@ -484,7 +484,7 @@ static uint8_t enc_rdgreg2(FAR struct enc_driver_s *priv, uint8_t cmd)
}
/****************************************************************************
* Function: enc_wrgreg2
* Name: enc_wrgreg2
*
* Description:
* Write to a global register (EIE, EIR, ESTAT, ECON2, or ECON1). The cmd
@ -525,7 +525,7 @@ static void enc_wrgreg2(FAR struct enc_driver_s *priv, uint8_t cmd,
}
/****************************************************************************
* Function: enc_src
* Name: enc_src
*
* Description:
* Send the single byte system reset command (SRC).
@ -579,7 +579,7 @@ static inline void enc_src(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_setbank
* Name: enc_setbank
*
* Description:
* Set the bank for these next control register access.
@ -622,7 +622,7 @@ static void enc_setbank(FAR struct enc_driver_s *priv, uint8_t bank)
}
/****************************************************************************
* Function: enc_rdbreg
* Name: enc_rdbreg
*
* Description:
* Read from a banked control register using the RCR command.
@ -677,7 +677,7 @@ static uint8_t enc_rdbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg)
}
/****************************************************************************
* Function: enc_wrbreg
* Name: enc_wrbreg
*
* Description:
* Write to a banked control register using the WCR command. Unlike
@ -723,7 +723,7 @@ static void enc_wrbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
}
/****************************************************************************
* Function: enc_waitbreg
* Name: enc_waitbreg
*
* Description:
* Wait until banked register bit(s) take a specific value (or a timeout
@ -764,7 +764,7 @@ static int enc_waitbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
}
/****************************************************************************
* Function: enc_txdump enc_rxdump
* Name: enc_txdump enc_rxdump
*
* Description:
* Dump registers associated with receiving or sending packets.
@ -836,7 +836,7 @@ static void enc_txdump(FAR struct enc_driver_s *priv)
#endif
/****************************************************************************
* Function: enc_rdbuffer
* Name: enc_rdbuffer
*
* Description:
* Read a buffer of data.
@ -878,7 +878,7 @@ static void enc_rdbuffer(FAR struct enc_driver_s *priv, FAR uint8_t *buffer,
}
/****************************************************************************
* Function: enc_wrbuffer
* Name: enc_wrbuffer
*
* Description:
* Write a buffer of data.
@ -961,7 +961,7 @@ static inline void enc_wrbuffer(FAR struct enc_driver_s *priv,
}
/****************************************************************************
* Function: enc_rdphy
* Name: enc_rdphy
*
* Description:
* Read 16-bits of PHY data.
@ -1022,7 +1022,7 @@ static uint16_t enc_rdphy(FAR struct enc_driver_s *priv, uint8_t phyaddr)
}
/****************************************************************************
* Function: enc_wrphy
* Name: enc_wrphy
*
* Description:
* write 16-bits of PHY data.
@ -1075,7 +1075,7 @@ static void enc_wrphy(FAR struct enc_driver_s *priv, uint8_t phyaddr,
}
/****************************************************************************
* Function: enc_transmit
* Name: enc_transmit
*
* Description:
* Start hardware transmission. Called either from:
@ -1159,7 +1159,7 @@ static int enc_transmit(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_txpoll
* Name: enc_txpoll
*
* Description:
* The transmitter is available, check if the network has any outgoing packets ready
@ -1230,7 +1230,7 @@ static int enc_txpoll(struct net_driver_s *dev)
}
/****************************************************************************
* Function: enc_linkstatus
* Name: enc_linkstatus
*
* Description:
* The current link status can be obtained from the PHSTAT1.LLSTAT or
@ -1256,7 +1256,7 @@ static void enc_linkstatus(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_txif
* Name: enc_txif
*
* Description:
* An TXIF interrupt was received indicating that the last TX packet(s) is
@ -1293,7 +1293,7 @@ static void enc_txif(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_txerif
* Name: enc_txerif
*
* Description:
* An TXERIF interrupt was received indicating that a TX abort has occurred.
@ -1336,7 +1336,7 @@ static void enc_txerif(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_rxerif
* Name: enc_rxerif
*
* Description:
* An RXERIF interrupt was received indicating that the last TX packet(s) is
@ -1358,7 +1358,7 @@ static void enc_rxerif(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_rxdispatch
* Name: enc_rxdispatch
*
* Description:
* Give the newly received packet to the network.
@ -1489,7 +1489,7 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_pktif
* Name: enc_pktif
*
* Description:
* An interrupt was received indicating the availability of a new RX packet
@ -1595,7 +1595,7 @@ static void enc_pktif(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_irqworker
* Name: enc_irqworker
*
* Description:
* Perform interrupt handling logic outside of the interrupt handler (on
@ -1815,7 +1815,7 @@ static void enc_irqworker(FAR void *arg)
}
/****************************************************************************
* Function: enc_interrupt
* Name: enc_interrupt
*
* Description:
* Hardware interrupt handler
@ -1854,7 +1854,7 @@ static int enc_interrupt(int irq, FAR void *context, FAR void *arg)
}
/****************************************************************************
* Function: enc_toworker
* Name: enc_toworker
*
* Description:
* Our TX watchdog timed out. This is the worker thread continuation of
@ -1906,7 +1906,7 @@ static void enc_toworker(FAR void *arg)
}
/****************************************************************************
* Function: enc_txtimeout
* Name: enc_txtimeout
*
* Description:
* Our TX watchdog timed out. Called from the timer interrupt handler.
@ -1947,7 +1947,7 @@ static void enc_txtimeout(int argc, uint32_t arg, ...)
}
/****************************************************************************
* Function: enc_pollworker
* Name: enc_pollworker
*
* Description:
* Periodic timer handler continuation.
@ -2002,7 +2002,7 @@ static void enc_pollworker(FAR void *arg)
}
/****************************************************************************
* Function: enc_polltimer
* Name: enc_polltimer
*
* Description:
* Periodic timer handler. Called from the timer interrupt handler.
@ -2042,7 +2042,7 @@ static void enc_polltimer(int argc, uint32_t arg, ...)
}
/****************************************************************************
* Function: enc_ifup
* Name: enc_ifup
*
* Description:
* NuttX Callback: Bring up the Ethernet interface when an IP address is
@ -2114,7 +2114,7 @@ static int enc_ifup(struct net_driver_s *dev)
}
/****************************************************************************
* Function: enc_ifdown
* Name: enc_ifdown
*
* Description:
* NuttX Callback: Stop the interface.
@ -2168,7 +2168,7 @@ static int enc_ifdown(struct net_driver_s *dev)
}
/****************************************************************************
* Function: enc_txavail
* Name: enc_txavail
*
* Description:
* Driver callback invoked when new TX data is available. This is a
@ -2222,7 +2222,7 @@ static int enc_txavail(struct net_driver_s *dev)
}
/****************************************************************************
* Function: enc_addmac
* Name: enc_addmac
*
* Description:
* NuttX Callback: Add the specified MAC address to the hardware multicast
@ -2260,7 +2260,7 @@ static int enc_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: enc_rmmac
* Name: enc_rmmac
*
* Description:
* NuttX Callback: Remove the specified MAC address from the hardware multicast
@ -2298,7 +2298,7 @@ static int enc_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: enc_pwrsave
* Name: enc_pwrsave
*
* Description:
* The ENC28J60 may be commanded to power-down via the SPI interface.
@ -2360,7 +2360,7 @@ static void enc_pwrsave(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_pwrfull
* Name: enc_pwrfull
*
* Description:
* When normal operation is desired, the host controller must perform
@ -2412,7 +2412,7 @@ static void enc_pwrfull(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_setmacaddr
* Name: enc_setmacaddr
*
* Description:
* Set the MAC address to the configured value. This is done after ifup
@ -2440,16 +2440,16 @@ static void enc_setmacaddr(FAR struct enc_driver_s *priv)
* MAADR6 MAC Address Byte 6 (MAADR<7:0>)
*/
enc_wrbreg(priv, ENC_MAADR1, priv->dev.d_mac.ether_addr_octet[0]);
enc_wrbreg(priv, ENC_MAADR2, priv->dev.d_mac.ether_addr_octet[1]);
enc_wrbreg(priv, ENC_MAADR3, priv->dev.d_mac.ether_addr_octet[2]);
enc_wrbreg(priv, ENC_MAADR4, priv->dev.d_mac.ether_addr_octet[3]);
enc_wrbreg(priv, ENC_MAADR5, priv->dev.d_mac.ether_addr_octet[4]);
enc_wrbreg(priv, ENC_MAADR6, priv->dev.d_mac.ether_addr_octet[5]);
enc_wrbreg(priv, ENC_MAADR1, priv->dev.d_mac.ether.ether_addr_octet[0]);
enc_wrbreg(priv, ENC_MAADR2, priv->dev.d_mac.ether.ether_addr_octet[1]);
enc_wrbreg(priv, ENC_MAADR3, priv->dev.d_mac.ether.ether_addr_octet[2]);
enc_wrbreg(priv, ENC_MAADR4, priv->dev.d_mac.ether.ether_addr_octet[3]);
enc_wrbreg(priv, ENC_MAADR5, priv->dev.d_mac.ether.ether_addr_octet[4]);
enc_wrbreg(priv, ENC_MAADR6, priv->dev.d_mac.ether.ether_addr_octet[5]);
}
/****************************************************************************
* Function: enc_reset
* Name: enc_reset
*
* Description:
* Stop, reset, re-initialize, and restart the ENC28J60. This is done
@ -2588,7 +2588,7 @@ static int enc_reset(FAR struct enc_driver_s *priv)
****************************************************************************/
/****************************************************************************
* Function: enc_initialize
* Name: enc_initialize
*
* Description:
* Initialize the Ethernet driver. The ENC28J60 device is assumed to be

View File

@ -378,7 +378,7 @@ static int enc_reset(FAR struct enc_driver_s *priv);
****************************************************************************/
/****************************************************************************
* Function: enc_lock
* Name: enc_lock
*
* Description:
* Select the SPI, locking and re-configuring if necessary
@ -412,7 +412,7 @@ static void enc_lock(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_unlock
* Name: enc_unlock
*
* Description:
* De-select the SPI
@ -435,7 +435,7 @@ static inline void enc_unlock(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_cmd
* Name: enc_cmd
*
* Description:
* Execute two byte command.
@ -471,7 +471,7 @@ static void enc_cmd(FAR struct enc_driver_s *priv, uint8_t cmd, uint16_t arg)
}
/****************************************************************************
* Function: enc_setethrst
* Name: enc_setethrst
*
* Description:
* Issues System Reset by setting ETHRST (ECON2<4>)
@ -507,7 +507,7 @@ static inline void enc_setethrst(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_setbank
* Name: enc_setbank
*
* Description:
* Set the bank for the next control register access.
@ -547,7 +547,7 @@ static void enc_setbank(FAR struct enc_driver_s *priv, uint8_t bank)
}
/****************************************************************************
* Function: enc_rdreg
* Name: enc_rdreg
*
* Description:
* Read one word from a control register using the RCR command.
@ -587,7 +587,7 @@ static uint16_t enc_rdreg(FAR struct enc_driver_s *priv, uint16_t ctrlreg)
}
/****************************************************************************
* Function: enc_wrreg
* Name: enc_wrreg
*
* Description:
* Write one word to a control register using the WCR command.
@ -623,7 +623,7 @@ static void enc_wrreg(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
}
/****************************************************************************
* Function: enc_waitbreg
* Name: enc_waitbreg
*
* Description:
* Wait until banked register bit(s) take a specific value (or a timeout
@ -664,7 +664,7 @@ static int enc_waitreg(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
}
/****************************************************************************
* Function: enc_bfs
* Name: enc_bfs
*
* Description:
* Bit Field Set.
@ -709,7 +709,7 @@ static void enc_bfs(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
}
/****************************************************************************
* Function: enc_bfc
* Name: enc_bfc
*
* Description:
* Bit Field Clear.
@ -754,7 +754,7 @@ static void enc_bfc(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
}
/****************************************************************************
* Function: enc_txdump enc_rxdump
* Name: enc_txdump enc_rxdump
*
* Description:
* Dump registers associated with receiving or sending packets.
@ -826,7 +826,7 @@ static void enc_txdump(FAR struct enc_driver_s *priv)
#endif
/****************************************************************************
* Function: enc_rdbuffer
* Name: enc_rdbuffer
*
* Description:
* Read a buffer of data from RX Data Buffer.
@ -868,7 +868,7 @@ static void enc_rdbuffer(FAR struct enc_driver_s *priv, FAR uint8_t *buffer,
}
/****************************************************************************
* Function: enc_wrbuffer
* Name: enc_wrbuffer
*
* Description:
* Write a buffer of data.
@ -901,7 +901,7 @@ static inline void enc_wrbuffer(FAR struct enc_driver_s *priv,
}
/****************************************************************************
* Function: enc_rdphy
* Name: enc_rdphy
*
* Description:
* Read 16-bits of PHY data.
@ -961,7 +961,7 @@ static uint16_t enc_rdphy(FAR struct enc_driver_s *priv, uint8_t phyaddr)
}
/****************************************************************************
* Function: enc_wrphy
* Name: enc_wrphy
*
* Description:
* write 16-bits of PHY data.
@ -1009,7 +1009,7 @@ static void enc_wrphy(FAR struct enc_driver_s *priv, uint8_t phyaddr,
}
/****************************************************************************
* Function: enc_transmit
* Name: enc_transmit
*
* Description:
* Start hardware transmission. Called either from:
@ -1075,7 +1075,7 @@ static int enc_transmit(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_txenqueue
* Name: enc_txenqueue
*
* Description:
* Write packet from d_buf to the enc's SRAM if a free descriptor is available.
@ -1143,7 +1143,7 @@ static int enc_txenqueue(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_txpoll
* Name: enc_txpoll
*
* Description:
* Enqueues network packets if available.
@ -1212,7 +1212,7 @@ static int enc_txpoll(struct net_driver_s *dev)
}
/****************************************************************************
* Function: enc_linkstatus
* Name: enc_linkstatus
*
* Description:
* The current link status can be obtained from the PHSTAT1.LLSTAT or
@ -1268,7 +1268,7 @@ static void enc_linkstatus(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_txif
* Name: enc_txif
*
* Description:
* An TXIF interrupt was received indicating that the last TX packet(s) is
@ -1308,7 +1308,7 @@ static void enc_txif(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_rxldpkt
* Name: enc_rxldpkt
*
* Description:
* Load packet from the enc's RX buffer to the driver d_buf.
@ -1348,7 +1348,7 @@ static void enc_rxldpkt(FAR struct enc_driver_s *priv,
}
/****************************************************************************
* Function: enc_rxgetdescr
* Name: enc_rxgetdescr
*
* Description:
* Check for a free descriptor in the free list. If no free descriptor is
@ -1380,7 +1380,7 @@ static struct enc_descr_s *enc_rxgetdescr(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_rxrmpkt
* Name: enc_rxrmpkt
*
* Description:
* Remove packet from the RX queue and free the block of memory in the enc's
@ -1439,7 +1439,7 @@ static void enc_rxrmpkt(FAR struct enc_driver_s *priv, FAR struct enc_descr_s *d
}
/****************************************************************************
* Function: enc_rxdispatch
* Name: enc_rxdispatch
*
* Description:
* Give the newly received packet to the network.
@ -1620,7 +1620,7 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_pktif
* Name: enc_pktif
*
* Description:
* An interrupt was received indicating the availability of a new RX packet
@ -1741,7 +1741,7 @@ static void enc_pktif(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_rxabtif
* Name: enc_rxabtif
*
* Description:
* An interrupt was received indicating the abortion of an RX packet
@ -1807,7 +1807,7 @@ static void enc_rxabtif(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_irqworker
* Name: enc_irqworker
*
* Description:
* Perform interrupt handling logic outside of the interrupt handler (on
@ -1980,7 +1980,7 @@ static void enc_irqworker(FAR void *arg)
}
/****************************************************************************
* Function: enc_interrupt
* Name: enc_interrupt
*
* Description:
* Hardware interrupt handler
@ -2019,7 +2019,7 @@ static int enc_interrupt(int irq, FAR void *context)
}
/****************************************************************************
* Function: enc_toworker
* Name: enc_toworker
*
* Description:
* Our TX watchdog timed out. This is the worker thread continuation of
@ -2071,7 +2071,7 @@ static void enc_toworker(FAR void *arg)
}
/****************************************************************************
* Function: enc_txtimeout
* Name: enc_txtimeout
*
* Description:
* Our TX watchdog timed out. Called from the timer interrupt handler.
@ -2112,7 +2112,7 @@ static void enc_txtimeout(int argc, uint32_t arg, ...)
}
/****************************************************************************
* Function: enc_pollworker
* Name: enc_pollworker
*
* Description:
* Periodic timer handler continuation.
@ -2166,7 +2166,7 @@ static void enc_pollworker(FAR void *arg)
}
/****************************************************************************
* Function: enc_polltimer
* Name: enc_polltimer
*
* Description:
* Periodic timer handler. Called from the timer interrupt handler.
@ -2206,7 +2206,7 @@ static void enc_polltimer(int argc, uint32_t arg, ...)
}
/****************************************************************************
* Function: enc_ifup
* Name: enc_ifup
*
* Description:
* NuttX Callback: Bring up the Ethernet interface when an IP address is
@ -2282,7 +2282,7 @@ static int enc_ifup(struct net_driver_s *dev)
}
/****************************************************************************
* Function: enc_ifdown
* Name: enc_ifdown
*
* Description:
* NuttX Callback: Stop the interface.
@ -2337,7 +2337,7 @@ static int enc_ifdown(struct net_driver_s *dev)
}
/****************************************************************************
* Function: enc_txavail
* Name: enc_txavail
*
* Description:
* Driver callback invoked when new TX data is available. This is a
@ -2392,7 +2392,7 @@ static int enc_txavail(struct net_driver_s *dev)
}
/****************************************************************************
* Function: enc_rxavail
* Name: enc_rxavail
*
* Description:
* Driver callback invoked when new TX data is available. This is a
@ -2424,7 +2424,7 @@ static int enc_rxavail(struct net_driver_s *dev)
}
/****************************************************************************
* Function: enc_addmac
* Name: enc_addmac
*
* Description:
* NuttX Callback: Add the specified MAC address to the hardware multicast
@ -2462,7 +2462,7 @@ static int enc_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: enc_rmmac
* Name: enc_rmmac
*
* Description:
* NuttX Callback: Remove the specified MAC address from the hardware multicast
@ -2500,7 +2500,7 @@ static int enc_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: enc_pwrsave
* Name: enc_pwrsave
*
* Description:
* The ENCX24J600 may be placed in Power-Down mode through the command
@ -2572,7 +2572,7 @@ static void enc_pwrsave(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_ldmacaddr
* Name: enc_ldmacaddr
*
* Description:
* Load the MAC address from the ENCX24j600 and write it to the device
@ -2591,7 +2591,7 @@ static void enc_pwrsave(FAR struct enc_driver_s *priv)
static void enc_ldmacaddr(FAR struct enc_driver_s *priv)
{
uint16_t regval;
uint8_t *mac = priv->dev.d_mac.ether_addr_octet;
uint8_t *mac = priv->dev.d_mac.ether.ether_addr_octet;
ninfo("Using ENCX24J600's built in MAC address\n");
@ -2609,7 +2609,7 @@ static void enc_ldmacaddr(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_setmacaddr
* Name: enc_setmacaddr
*
* Description:
* Set the MAC address to the configured value. This is done after ifup
@ -2629,12 +2629,12 @@ static void enc_ldmacaddr(FAR struct enc_driver_s *priv)
static void enc_setmacaddr(FAR struct enc_driver_s *priv)
{
uint8_t *mac = priv->dev.d_mac.ether_addr_octet;
uint8_t *mac = priv->dev.d_mac.ether.ether_addr_octet;
struct ether_addr zmac;
memset(&zmac, 0, sizeof(zmac));
if (memcmp(&priv->dev.d_mac, &zmac, sizeof(zmac)) == 0)
if (memcmp(&priv->dev.d_mac.ether, &zmac, sizeof(zmac)) == 0)
{
/* No user defined MAC address. Read it from the device. */
@ -2653,7 +2653,7 @@ static void enc_setmacaddr(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_resetbuffers
* Name: enc_resetbuffers
*
* Description:
* Initializes the RX/TX queues and configures the enc's RX/TX buffers.
@ -2703,7 +2703,7 @@ static void enc_resetbuffers(FAR struct enc_driver_s *priv)
}
/****************************************************************************
* Function: enc_reset
* Name: enc_reset
*
* Description:
* Stop, reset, re-initialize, and restart the ENCX24J600. This is done
@ -2822,7 +2822,7 @@ static int enc_reset(FAR struct enc_driver_s *priv)
****************************************************************************/
/****************************************************************************
* Function: enc_initialize
* Name: enc_initialize
*
* Description:
* Initialize the Ethernet driver. The ENCX24J600 device is assumed to be

View File

@ -244,7 +244,7 @@ static void ftmac100_ipv6multicast(FAR struct ftmac100_driver_s *priv);
****************************************************************************/
/****************************************************************************
* Function: ftmac100_transmit
* Name: ftmac100_transmit
*
* Description:
* Start hardware transmission. Called either from the txdone interrupt
@ -331,7 +331,7 @@ static int ftmac100_transmit(FAR struct ftmac100_driver_s *priv)
}
/****************************************************************************
* Function: ftmac100_txpoll
* Name: ftmac100_txpoll
*
* Description:
* The transmitter is available, check if the network has any outgoing packets
@ -405,7 +405,7 @@ static int ftmac100_txpoll(struct net_driver_s *dev)
}
/****************************************************************************
* Function: ftmac100_reset
* Name: ftmac100_reset
*
* Description:
* Do the HW reset
@ -434,7 +434,7 @@ static void ftmac100_reset(FAR struct ftmac100_driver_s *priv)
}
/****************************************************************************
* Function: ftmac100_init
* Name: ftmac100_init
*
* Description:
* Perform HW initialization
@ -542,7 +542,7 @@ static void ftmac100_init(FAR struct ftmac100_driver_s *priv)
}
/****************************************************************************
* Function: ftmac100_mdio_read
* Name: ftmac100_mdio_read
*
* Description:
* Read MII registers
@ -583,7 +583,7 @@ static uint32_t ftmac100_mdio_read(FAR struct ftmac100_register_s *iobase, int r
}
/****************************************************************************
* Function: ftmac100_set_mac
* Name: ftmac100_set_mac
*
* Description:
* Set the MAC address
@ -613,7 +613,7 @@ static void ftmac100_set_mac(FAR struct ftmac100_driver_s *priv,
}
/****************************************************************************
* Function: ftmac100_receive
* Name: ftmac100_receive
*
* Description:
* An interrupt was received indicating the availability of a new RX packet
@ -787,7 +787,7 @@ static void ftmac100_receive(FAR struct ftmac100_driver_s *priv)
}
/****************************************************************************
* Function: ftmac100_txdone
* Name: ftmac100_txdone
*
* Description:
* An interrupt was received indicating that the last TX packet(s) is done
@ -850,7 +850,7 @@ static void ftmac100_txdone(FAR struct ftmac100_driver_s *priv)
}
/****************************************************************************
* Function: ftmac100_interrupt_work
* Name: ftmac100_interrupt_work
*
* Description:
* Perform interrupt related work from the worker thread
@ -954,7 +954,7 @@ out:
}
/****************************************************************************
* Function: ftmac100_interrupt
* Name: ftmac100_interrupt
*
* Description:
* Hardware interrupt handler
@ -1009,7 +1009,7 @@ static int ftmac100_interrupt(int irq, FAR void *context, FAR void *arg)
}
/****************************************************************************
* Function: ftmac100_txtimeout_work
* Name: ftmac100_txtimeout_work
*
* Description:
* Perform TX timeout related work from the worker thread
@ -1042,7 +1042,7 @@ static void ftmac100_txtimeout_work(FAR void *arg)
}
/****************************************************************************
* Function: ftmac100_txtimeout_expiry
* Name: ftmac100_txtimeout_expiry
*
* Description:
* Our TX watchdog timed out. Called from the timer interrupt handler.
@ -1077,7 +1077,7 @@ static void ftmac100_txtimeout_expiry(int argc, uint32_t arg, ...)
}
/****************************************************************************
* Function: ftmac100_poll_work
* Name: ftmac100_poll_work
*
* Description:
* Perform periodic polling from the worker thread
@ -1120,7 +1120,7 @@ static void ftmac100_poll_work(FAR void *arg)
}
/****************************************************************************
* Function: ftmac100_poll_expiry
* Name: ftmac100_poll_expiry
*
* Description:
* Periodic timer handler. Called from the timer interrupt handler.
@ -1147,7 +1147,7 @@ static void ftmac100_poll_expiry(int argc, uint32_t arg, ...)
}
/****************************************************************************
* Function: ftmac100_ifup
* Name: ftmac100_ifup
*
* Description:
* NuttX Callback: Bring up the Ethernet interface when an IP address is
@ -1185,9 +1185,9 @@ static int ftmac100_ifup(struct net_driver_s *dev)
ftmac100_init(priv);
/* Instantiate the MAC address from priv->ft_dev.d_mac.ether_addr_octet */
/* Instantiate the MAC address from priv->ft_dev.d_mac.ether.ether_addr_octet */
ftmac100_set_mac(priv, priv->ft_dev.d_mac.ether_addr_octet);
ftmac100_set_mac(priv, priv->ft_dev.d_mac.ether.ether_addr_octet);
#ifdef CONFIG_NET_ICMPv6
/* Set up IPv6 multicast address filtering */
@ -1208,7 +1208,7 @@ static int ftmac100_ifup(struct net_driver_s *dev)
}
/****************************************************************************
* Function: ftmac100_ifdown
* Name: ftmac100_ifdown
*
* Description:
* NuttX Callback: Stop the interface.
@ -1254,7 +1254,7 @@ static int ftmac100_ifdown(struct net_driver_s *dev)
}
/****************************************************************************
* Function: ftmac100_txavail_work
* Name: ftmac100_txavail_work
*
* Description:
* Perform an out-of-cycle poll on the worker thread.
@ -1293,7 +1293,7 @@ static void ftmac100_txavail_work(FAR void *arg)
}
/****************************************************************************
* Function: ftmac100_txavail
* Name: ftmac100_txavail
*
* Description:
* Driver callback invoked when new TX data is available. This is a
@ -1331,7 +1331,7 @@ static int ftmac100_txavail(struct net_driver_s *dev)
}
/****************************************************************************
* Function: ftmac100_addmac
* Name: ftmac100_addmac
*
* Description:
* NuttX Callback: Add the specified MAC address to the hardware multicast
@ -1385,7 +1385,7 @@ static int ftmac100_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: ftmac100_rmmac
* Name: ftmac100_rmmac
*
* Description:
* NuttX Callback: Remove the specified MAC address from the hardware multicast
@ -1430,7 +1430,7 @@ static int ftmac100_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: ftmac100_ipv6multicast
* Name: ftmac100_ipv6multicast
*
* Description:
* Configure the IPv6 multicast MAC address.
@ -1507,7 +1507,7 @@ static void ftmac100_ipv6multicast(FAR struct ftmac100_driver_s *priv)
****************************************************************************/
/****************************************************************************
* Function: ftmac100_initialize
* Name: ftmac100_initialize
*
* Description:
* Initialize the Ethernet controller and driver
@ -1566,9 +1566,9 @@ int ftmac100_initialize(int intf)
*/
ftmac100_reset(priv);
/* Read the MAC address from the hardware into priv->ft_dev.d_mac.ether_addr_octet */
/* Read the MAC address from the hardware into priv->ft_dev.d_mac.ether.ether_addr_octet */
memcpy(priv->ft_dev.d_mac.ether_addr_octet, (void *)(CONFIG_FTMAC100_MAC0_ENV_ADDR), 6);
memcpy(priv->ft_dev.d_mac.ether.ether_addr_octet, (void *)(CONFIG_FTMAC100_MAC0_ENV_ADDR), 6);
/* Register the device with the OS so that socket IOCTLs can be performed */

View File

@ -145,7 +145,7 @@ static int lo_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac);
****************************************************************************/
/****************************************************************************
* Function: lo_txpoll
* Name: lo_txpoll
*
* Description:
* Check if the network has any outgoing packets ready to send. This is
@ -219,7 +219,7 @@ static int lo_txpoll(FAR struct net_driver_s *dev)
}
/****************************************************************************
* Function: lo_poll_work
* Name: lo_poll_work
*
* Description:
* Perform periodic polling from the worker thread
@ -262,7 +262,7 @@ static void lo_poll_work(FAR void *arg)
}
/****************************************************************************
* Function: lo_poll_expiry
* Name: lo_poll_expiry
*
* Description:
* Periodic timer handler. Called from the timer interrupt handler.
@ -289,7 +289,7 @@ static void lo_poll_expiry(int argc, wdparm_t arg, ...)
}
/****************************************************************************
* Function: lo_ifup
* Name: lo_ifup
*
* Description:
* NuttX Callback: Bring up the Ethernet interface when an IP address is
@ -331,7 +331,7 @@ static int lo_ifup(FAR struct net_driver_s *dev)
}
/****************************************************************************
* Function: lo_ifdown
* Name: lo_ifdown
*
* Description:
* NuttX Callback: Stop the interface.
@ -361,7 +361,7 @@ static int lo_ifdown(FAR struct net_driver_s *dev)
}
/****************************************************************************
* Function: lo_txavail_work
* Name: lo_txavail_work
*
* Description:
* Perform an out-of-cycle poll on the worker thread.
@ -400,7 +400,7 @@ static void lo_txavail_work(FAR void *arg)
}
/****************************************************************************
* Function: lo_txavail
* Name: lo_txavail
*
* Description:
* Driver callback invoked when new TX data is available. This is a
@ -438,7 +438,7 @@ static int lo_txavail(FAR struct net_driver_s *dev)
}
/****************************************************************************
* Function: lo_addmac
* Name: lo_addmac
*
* Description:
* NuttX Callback: Add the specified MAC address to the hardware multicast
@ -465,7 +465,7 @@ static int lo_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: lo_rmmac
* Name: lo_rmmac
*
* Description:
* NuttX Callback: Remove the specified MAC address from the hardware multicast
@ -496,7 +496,7 @@ static int lo_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
****************************************************************************/
/****************************************************************************
* Function: localhost_initialize
* Name: localhost_initialize
*
* Description:
* Initialize the Ethernet controller and driver

View File

@ -275,7 +275,7 @@ static int phy_handler(int irq, FAR void *context, FAR void *arg)
****************************************************************************/
/****************************************************************************
* Function: phy_notify_subscribe
* Name: phy_notify_subscribe
*
* Description:
* Setup up to deliver signals to the task identified by 'pid' when
@ -362,7 +362,7 @@ int phy_notify_subscribe(FAR const char *intf, pid_t pid, int signo,
}
/****************************************************************************
* Function: phy_notify_unsubscribe
* Name: phy_notify_unsubscribe
*
* Description:
* Stop the deliver of signals for events from the PHY associated with

View File

@ -803,7 +803,7 @@ static int skel_ifup(FAR struct net_driver_s *dev)
/* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */
/* Instantiate the MAC address from priv->sk_dev.d_mac.ether_addr_octet */
/* Instantiate the MAC address from priv->sk_dev.d_mac.ether.ether_addr_octet */
#ifdef CONFIG_NET_ICMPv6
/* Set up IPv6 multicast address filtering */
@ -1187,7 +1187,7 @@ int skel_initialize(int intf)
* the device and/or calling skel_ifdown().
*/
/* Read the MAC address from the hardware into priv->sk_dev.d_mac.ether_addr_octet */
/* Read the MAC address from the hardware into priv->sk_dev.d_mac.ether.ether_addr_octet */
/* Register the device with the OS so that socket IOCTLs can be performed */

View File

@ -214,7 +214,7 @@ static void slip_semtake(FAR struct slip_driver_s *priv)
#define slip_semgive(p) sem_post(&(p)->waitsem);
/****************************************************************************
* Function: slip_write
* Name: slip_write
*
* Description:
* Just an inline wrapper around fwrite with error checking.
@ -238,7 +238,7 @@ static inline void slip_write(FAR struct slip_driver_s *priv,
}
/****************************************************************************
* Function: slip_putc
* Name: slip_putc
*
* Description:
* Just an inline wrapper around putc with error checking.
@ -256,7 +256,7 @@ static inline void slip_putc(FAR struct slip_driver_s *priv, int ch)
}
/****************************************************************************
* Function: slip_transmit
* Name: slip_transmit
*
* Description:
* Start hardware transmission. Called either from the txdone interrupt
@ -368,7 +368,7 @@ static int slip_transmit(FAR struct slip_driver_s *priv)
}
/****************************************************************************
* Function: slip_txpoll
* Name: slip_txpoll
*
* Description:
* Check if the network has any outgoing packets ready to send. This is a
@ -409,7 +409,7 @@ static int slip_txpoll(FAR struct net_driver_s *dev)
}
/****************************************************************************
* Function: slip_txtask
* Name: slip_txtask
*
* Description:
* Polling and transmission is performed on tx thread.
@ -499,7 +499,7 @@ static void slip_txtask(int argc, FAR char *argv[])
}
/****************************************************************************
* Function: slip_getc
* Name: slip_getc
*
* Description:
* Get one byte from the serial input.
@ -525,7 +525,7 @@ static inline int slip_getc(FAR struct slip_driver_s *priv)
}
/****************************************************************************
* Function: slip_receive
* Name: slip_receive
*
* Description:
* Read a packet from the serial input
@ -630,7 +630,7 @@ static inline void slip_receive(FAR struct slip_driver_s *priv)
}
/****************************************************************************
* Function: slip_rxtask
* Name: slip_rxtask
*
* Description:
* Wait for incoming data.
@ -751,7 +751,7 @@ static int slip_rxtask(int argc, FAR char *argv[])
}
/****************************************************************************
* Function: slip_ifup
* Name: slip_ifup
*
* Description:
* NuttX Callback: Bring up the Ethernet interface when an IP address is
@ -782,7 +782,7 @@ static int slip_ifup(FAR struct net_driver_s *dev)
}
/****************************************************************************
* Function: slip_ifdown
* Name: slip_ifdown
*
* Description:
* NuttX Callback: Stop the interface.
@ -808,7 +808,7 @@ static int slip_ifdown(FAR struct net_driver_s *dev)
}
/****************************************************************************
* Function: slip_txavail
* Name: slip_txavail
*
* Description:
* Driver callback invoked when new TX data is available. This is a
@ -841,7 +841,7 @@ static int slip_txavail(FAR struct net_driver_s *dev)
}
/****************************************************************************
* Function: slip_addmac
* Name: slip_addmac
*
* Description:
* NuttX Callback: Add the specified MAC address to the hardware multicast
@ -870,7 +870,7 @@ static int slip_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: slip_rmmac
* Name: slip_rmmac
*
* Description:
* NuttX Callback: Remove the specified MAC address from the hardware multicast
@ -903,7 +903,7 @@ static int slip_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
****************************************************************************/
/****************************************************************************
* Function: slip_initialize
* Name: slip_initialize
*
* Description:
* Instantiate a SLIP network interface.

View File

@ -304,7 +304,7 @@ static void tun_pollnotify(FAR struct tun_device_s *priv, pollevent_t eventset)
#endif
/****************************************************************************
* Function: tun_transmit
* Name: tun_transmit
*
* Description:
* Start hardware transmission. Called either from the txdone interrupt
@ -343,7 +343,7 @@ static int tun_fd_transmit(FAR struct tun_device_s *priv)
}
/****************************************************************************
* Function: tun_txpoll
* Name: tun_txpoll
*
* Description:
* The transmitter is available, check if the network has any outgoing packets
@ -393,7 +393,7 @@ static int tun_txpoll(struct net_driver_s *dev)
}
/****************************************************************************
* Function: tun_receive
* Name: tun_receive
*
* Description:
* An interrupt was received indicating the availability of a new RX packet
@ -495,7 +495,7 @@ static void tun_net_receive(FAR struct tun_device_s *priv)
}
/****************************************************************************
* Function: tun_txdone
* Name: tun_txdone
*
* Description:
* An interrupt was received indicating that the last TX packet(s) is done
@ -524,7 +524,7 @@ static void tun_txdone(FAR struct tun_device_s *priv)
}
/****************************************************************************
* Function: tun_poll_work
* Name: tun_poll_work
*
* Description:
* Perform periodic polling from the worker thread
@ -570,7 +570,7 @@ static void tun_poll_work(FAR void *arg)
}
/****************************************************************************
* Function: tun_poll_expiry
* Name: tun_poll_expiry
*
* Description:
* Periodic timer handler. Called from the timer interrupt handler.
@ -597,7 +597,7 @@ static void tun_poll_expiry(int argc, wdparm_t arg, ...)
}
/****************************************************************************
* Function: tun_ifup
* Name: tun_ifup
*
* Description:
* NuttX Callback: Bring up the Ethernet interface when an IP address is
@ -631,7 +631,7 @@ static int tun_ifup(struct net_driver_s *dev)
/* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */
/* Instantiate the MAC address from priv->dev.d_mac.ether_addr_octet */
/* Instantiate the MAC address from priv->dev.d_mac.ether.ether_addr_octet */
#ifdef CONFIG_NET_ICMPv6
/* Set up IPv6 multicast address filtering */
@ -649,7 +649,7 @@ static int tun_ifup(struct net_driver_s *dev)
}
/****************************************************************************
* Function: tun_ifdown
* Name: tun_ifdown
*
* Description:
* NuttX Callback: Stop the interface.
@ -682,7 +682,7 @@ static int tun_ifdown(struct net_driver_s *dev)
}
/****************************************************************************
* Function: tun_txavail
* Name: tun_txavail
*
* Description:
* Driver callback invoked when new TX data is available. This is a
@ -731,7 +731,7 @@ static int tun_txavail(struct net_driver_s *dev)
}
/****************************************************************************
* Function: tun_addmac
* Name: tun_addmac
*
* Description:
* NuttX Callback: Add the specified MAC address to the hardware multicast
@ -758,7 +758,7 @@ static int tun_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: tun_rmmac
* Name: tun_rmmac
*
* Description:
* NuttX Callback: Remove the specified MAC address from the hardware multicast
@ -785,7 +785,7 @@ static int tun_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
#endif
/****************************************************************************
* Function: tun_ipv6multicast
* Name: tun_ipv6multicast
*
* Description:
* Configure the IPv6 multicast MAC address.
@ -807,7 +807,7 @@ static void tun_ipv6multicast(FAR struct tun_device_s *priv)
#endif /* CONFIG_NET_ICMPv6 */
/****************************************************************************
* Function: tun_dev_init
* Name: tun_dev_init
*
* Description:
* Initialize the TUN device
@ -1228,7 +1228,7 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
****************************************************************************/
/****************************************************************************
* Function: tun_initialize
* Name: tun_initialize
*
* Description:
* Instantiate a SLIP network interface.

View File

@ -672,7 +672,7 @@ static const struct ovr2640_reg_s g_ov2640_jpeg_uxga_resolution[] =
****************************************************************************/
/****************************************************************************
* Function: ov2640_putreg
* Name: ov2640_putreg
*
* Description:
* Set one OV2640 register
@ -723,7 +723,7 @@ static int ov2640_putreg(FAR struct i2c_master_s *i2c, uint8_t regaddr,
}
/****************************************************************************
* Function: ov2640_getreg
* Name: ov2640_getreg
*
* Description:
* Set one OV2640 register
@ -779,7 +779,7 @@ static uint8_t ov2640_getreg(FAR struct i2c_master_s *i2c, uint8_t regaddr)
}
/****************************************************************************
* Function: ov2640_putreglist
* Name: ov2640_putreglist
*
* Description:
* Set a list of OV2640 register values.
@ -816,7 +816,7 @@ static int ov2640_putreglist(FAR struct i2c_master_s *i2c,
}
/****************************************************************************
* Function: ovr2640_chipid
* Name: ovr2640_chipid
*
* Description:
* Read and verify the CHIP ID
@ -869,7 +869,7 @@ static int ovr2640_chipid(FAR struct i2c_master_s *i2c)
}
/****************************************************************************
* Function: ov2640_reset
* Name: ov2640_reset
*
* Description:
* Reset the OV2640.
@ -904,7 +904,7 @@ static int ov2640_reset(FAR struct i2c_master_s *i2c)
* Public Functions
****************************************************************************/
/****************************************************************************
* Function: ov2640_initialize
* Name: ov2640_initialize
*
* Description:
* Initialize the OV2640 camera.

View File

@ -231,7 +231,7 @@ static inline void cc3000_devgive(FAR struct cc3000_dev_s *priv)
}
/****************************************************************************
* Function: cc3000_configspi
* Name: cc3000_configspi
*
* Description:
* Configure the SPI for use with the CC3000. This function should be
@ -260,7 +260,7 @@ static inline void cc3000_configspi(FAR struct spi_dev_s *spi)
}
/****************************************************************************
* Function: cc3000_lock
* Name: cc3000_lock
*
* Description:
* Lock the SPI bus and re-configure as necessary. This function must be
@ -293,7 +293,7 @@ static void cc3000_lock_and_select(FAR struct spi_dev_s *spi)
}
/****************************************************************************
* Function: cc3000_unlock
* Name: cc3000_unlock
*
* Description:
* Un-lock the SPI bus after each transfer, possibly losing the current
@ -321,7 +321,7 @@ static void cc3000_deselect_and_unlock(FAR struct spi_dev_s *spi)
}
/****************************************************************************
* Function: cc3000_wait
* Name: cc3000_wait
*
* Description:
* Helper function to wait on the semaphore signaled by the
@ -363,7 +363,7 @@ static int cc3000_wait(FAR struct cc3000_dev_s *priv, sem_t *psem)
}
/****************************************************************************
* Function: cc3000_wait_irq
* Name: cc3000_wait_irq
*
* Description:
* Helper function to wait on the irqsem signaled by the interrupt
@ -385,7 +385,7 @@ static inline int cc3000_wait_irq(FAR struct cc3000_dev_s *priv)
}
/****************************************************************************
* Function: cc3000_wait_ready
* Name: cc3000_wait_ready
*
* Description:
* Helper function to wait on the readysem signaled by the interrupt

View File

@ -290,7 +290,7 @@ static void nrf24l01_lock(FAR struct spi_dev_s *spi)
}
/****************************************************************************
* Function: nrf24l01_unlock
* Name: nrf24l01_unlock
*
* Description:
* Un-lock the SPI bus after each transfer, possibly losing the current
@ -314,7 +314,7 @@ static void nrf24l01_unlock(FAR struct spi_dev_s *spi)
}
/****************************************************************************
* Function: nrf24l01_configspi
* Name: nrf24l01_configspi
*
* Description:
* Configure the SPI for use with the NRF24L01.

View File

@ -245,7 +245,7 @@ static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, int *count,
****************************************************************************/
/****************************************************************************
* Function: file_poll
* Name: file_poll
*
* Description:
* Low-level poll operation based on struc file. This is used both to (1)
@ -288,7 +288,7 @@ int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
#endif
/****************************************************************************
* Function: fdesc_poll
* Name: fdesc_poll
*
* Description:
* The standard poll() operation redirects operations on file descriptors

View File

@ -133,14 +133,19 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
}
}
if (npfds <= 0)
{
errcode = EINVAL;
goto errout;
}
/* Allocate the descriptor list for poll() */
pollset = (struct pollfd *)kmm_zalloc(npfds * sizeof(struct pollfd));
if (!pollset)
{
set_errno(ENOMEM);
leave_cancellation_point();
return ERROR;
errcode = ENOMEM;
goto errout;
}
/* Initialize the descriptor list for poll() */
@ -279,16 +284,16 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
/* Did poll() fail above? */
if (ret < 0)
if (ret >= 0)
{
/* Yes.. restore the errno value */
set_errno(errcode);
leave_cancellation_point();
return ret;
}
errout:
set_errno(errcode);
leave_cancellation_point();
return ret;
return ERROR;
}
#endif /* CONFIG_DISABLE_POLL */

View File

@ -651,7 +651,7 @@ int up_fbinitialize(int display)
}
/****************************************************************************
* Function: vnc_fbinitialize
* Name: vnc_fbinitialize
*
* Description:
* Initialize the VNC frame buffer driver. The VNC frame buffer driver

View File

@ -630,7 +630,7 @@ void vnc_key_map(FAR struct vnc_session_s *session, uint16_t keysym,
}
/****************************************************************************
* Function: vnc_kbdout
* Name: vnc_kbdout
*
* Description:
* This is the default keyboard callout function. This is simply wrappers around nx_kdbout(), respectively. When configured using vnc_fbinitialize(), the 'arg' must be the correct NXHANDLE value.

View File

@ -497,7 +497,7 @@ int vnc_client_encodings(FAR struct vnc_session_s *session,
}
/****************************************************************************
* Function: vnc_mouse
* Name: vnc_mouse
*
* Description:
* This is the default keyboard/mouse callout function. This is simply a

View File

@ -84,7 +84,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: net_addroute
* Name: net_addroute
*
* Description:
* Add a new route to the routing table. This is just a convenience
@ -107,7 +107,7 @@ int addroute(int sockfd, FAR struct sockaddr_storage *target,
FAR struct sockaddr_storage *router);
/****************************************************************************
* Function: net_delroute
* Name: net_delroute
*
* Description:
* Add a new route to the routing table. This is just a convenience

View File

@ -2185,6 +2185,35 @@ int up_rtc_gettime(FAR struct timespec *tp);
int up_rtc_getdatetime(FAR struct tm *tp);
#endif
/************************************************************************************
* Name: up_rtc_getdatetime_with_subseconds
*
* Description:
* Get the current date and time from the date/time RTC. This interface
* is only supported by the date/time RTC hardware implementation.
* It is used to replace the system timer. It is only used by the RTOS during
* initialization to set up the system time when CONFIG_RTC and CONFIG_RTC_DATETIME
* are selected (and CONFIG_RTC_HIRES is not).
*
* NOTE: This interface exposes sub-second accuracy capability of RTC hardware.
* This interface allow maintaining timing accuracy when system time needs constant
* resynchronization with RTC, for example on MCU with low-power state that
* stop system timer.
*
* Input Parameters:
* tp - The location to return the high resolution time value.
* nsec - The location to return the subsecond time value.
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
************************************************************************************/
#if defined(CONFIG_RTC) && defined(CONFIG_RTC_DATETIME) && \
defined(CONFIG_ARCH_HAVE_RTC_SUBSECONDS)
int up_rtc_getdatetime_with_subseconds(FAR struct tm *tp, FAR long *nsec);
#endif
/************************************************************************************
* Name: up_rtc_settime
*

View File

@ -92,7 +92,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: vs1053_initialize
* Name: vs1053_initialize
*
* Description:
* Initialize the VS1053 driver. This will perform a chip reset of the

View File

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/clock.h
*
* Copyright (C) 2007-2009, 2011-2012, 2014, 2016 Gregory Nutt.
* Copyright (C) 2007-2009, 2011-2012, 2014, 2016-2017 Gregory Nutt.
All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
@ -50,6 +50,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Efficient, direct access to OS global timer variables will be supported
* if the execution environment has direct access to kernel global data.
@ -71,12 +72,12 @@
/* Case 1: There is no global timer data */
#elif defined(CONFIG_BUILD_PROTECTED) && defined(__KERNEL__)
/* Case 3: Kernel mode of protected kernel build */
/* Case 3: Kernel mode of protected kernel build */
# define __HAVE_KERNEL_GLOBALS 1
#elif defined(CONFIG_BUILD_KERNEL) && defined(__KERNEL__)
/* Case 3: Kernel only build */
/* Case 3: Kernel only build */
# define __HAVE_KERNEL_GLOBALS 1
@ -198,6 +199,14 @@ typedef uint64_t systime_t;
typedef uint32_t systime_t;
#endif
/* This type used to hold relative ticks that may have negative value */
#ifdef CONFIG_SYSTEM_TIME64
typedef int64_t ssystime_t;
#else
typedef int32_t ssystime_t;
#endif
/****************************************************************************
* Public Data
****************************************************************************/
@ -230,7 +239,7 @@ EXTERN volatile systime_t g_system_timer;
****************************************************************************/
/****************************************************************************
* Function: clock_synchronize
* Name: clock_synchronize
*
* Description:
* Synchronize the system timer to a hardware RTC. This operation is
@ -262,7 +271,38 @@ void clock_synchronize(void);
#endif
/****************************************************************************
* Function: clock_systimer
* Name: clock_resynchronize
*
* Description:
* Resynchronize the system timer to a hardware RTC. The user can
* explicitly re-synchronize the system timer to the RTC under certain
* conditions where the system timer is known to be in error. For example,
* in certain low-power states, the system timer may be stopped but the
* RTC will continue keep correct time. After recovering from such
* low-power state, this function should be called to restore the correct
* system time. Function also keeps monotonic clock at rate of RTC.
*
* Calling this function will not result in system time going "backward" in
* time. If setting system time with RTC would result time going "backward"
* then resynchronization is not performed.
*
* Parameters:
* diff: amount of time system-time is adjusted forward with RTC
*
* Return Value:
* None
*
* Assumptions:
*
****************************************************************************/
#if defined(CONFIG_RTC) && !defined(CONFIG_SCHED_TICKLESS) && \
!defined(CONFIG_CLOCK_TIMEKEEPING)
void clock_resynchronize(FAR struct timespec *rtc_diff);
#endif
/****************************************************************************
* Name: clock_systimer
*
* Description:
* Return the current value of the 32/64-bit system timer counter.
@ -307,7 +347,7 @@ systime_t clock_systimer(void);
int clock_systimespec(FAR struct timespec *ts);
/****************************************************************************
* Function: clock_cpuload
* Name: clock_cpuload
*
* Description:
* Return load measurement data for the select PID.

View File

@ -406,7 +406,7 @@ FAR struct iob_s *iob_pack(FAR struct iob_s *iob);
int iob_contig(FAR struct iob_s *iob, unsigned int len);
/****************************************************************************
* Function: iob_dump
* Name: iob_dump
*
* Description:
* Dump the contents of a I/O buffer chain

View File

@ -975,7 +975,7 @@ int file_vfcntl(FAR struct file *filep, int cmd, va_list ap);
#endif
/****************************************************************************
* Function: file_poll
* Name: file_poll
*
* Description:
* Low-level poll operation based on struc file. This is used both to (1)
@ -998,7 +998,7 @@ int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup);
#endif
/****************************************************************************
* Function: fdesc_poll
* Name: fdesc_poll
*
* Description:
* The standard poll() operation redirects operations on file descriptors

View File

@ -108,7 +108,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: cs89x0_initialize
* Name: cs89x0_initialize
*
* Description:
* Initialize the Ethernet driver

View File

@ -108,7 +108,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: enc_initialize
* Name: enc_initialize
*
* Description:
* Initialize the Ethernet driver. The ENC28J60 device is assumed to be

View File

@ -108,7 +108,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: enc_initialize
* Name: enc_initialize
*
* Description:
* Initialize the Ethernet driver. The ENCX24J600 device is assumed to be

View File

@ -217,7 +217,7 @@ struct ftmac100_rxdes_s
****************************************************************************/
/****************************************************************************
* Function: ftmac100_initialize
* Name: ftmac100_initialize
*
* Description:
* Initialize the Ethernet controller and driver

View File

@ -0,0 +1,138 @@
/****************************************************************************
* include/nuttx/net/ieee802154.h
*
* Copyright (C) 2017, Gregory Nutt, all rights reserved
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Derives from Contiki:
*
* Copyright (c) 2008, Swedish Institute of Computer Science.
* All rights reserved.
* Authors: Adam Dunkels <adam@sics.se>
* Nicolas Tsiftes <nvt@sics.se>
* Niclas Finne <nfi@sics.se>
* Mathilde Durvy <mdurvy@cisco.com>
* Julien Abeille <jabeille@cisco.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_NET_IEEE802154_H
#define __INCLUDE_NUTTX_NET_IEEE802154_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#ifdef CONFIG_NET_6LOWPAN
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* By default, a 2-byte Rime address is used for the IEEE802.15.4 MAC
* device's link layer address. If CONFIG_NET_6LOWPAN_RIMEADDR_EXTENDED
* is selected, then an 8-byte Rime address will be used.
*/
#ifdef CONFIG_NET_6LOWPAN_RIMEADDR_EXTENDED
# define NET_6LOWPAN_RIMEADDR_SIZE 8
#else
# define NET_6LOWPAN_RIMEADDR_SIZE 2
#endif
/* Frame format definitions *************************************************/
/* These are some definitions of element values used in the FCF. See the
* IEEE802.15.4 spec for details.
*/
#define FRAME802154_FRAMETYPE_SHIFT (0) /* Bits 0-2: Frame type */
#define FRAME802154_FRAMETYPE_MASK (7 << FRAME802154_FRAMETYPE_SHIFT)
#define FRAME802154_SECENABLED_SHIFT (3) /* Bit 3: Security enabled */
#define FRAME802154_FRAMEPENDING_SHIFT (4) /* Bit 4: Frame pending */
#define FRAME802154_ACKREQUEST_SHIFT (5) /* Bit 5: ACK request */
#define FRAME802154_PANIDCOMP_SHIFT (6) /* Bit 6: PANID compression */
/* Bits 7-9: Reserved */
#define FRAME802154_DSTADDR_SHIFT (2) /* Bits 10-11: Dest address mode */
#define FRAME802154_DSTADDR_MASK (3 << FRAME802154_DSTADDR_SHIFT)
#define FRAME802154_VERSION_SHIFT (4) /* Bit 12-13: Frame version */
#define FRAME802154_VERSION_MASK (3 << FRAME802154_VERSION_SHIFT)
#define FRAME802154_SRCADDR_SHIFT (6) /* Bits 14-15: Source address mode */
#define FRAME802154_SRCADDR_MASK (3 << FRAME802154_SRCADDR_SHIFT)
/* Unshifted values for use in struct frame802154_fcf_s */
#define FRAME802154_BEACONFRAME (0)
#define FRAME802154_DATAFRAME (1)
#define FRAME802154_ACKFRAME (2)
#define FRAME802154_CMDFRAME (3)
#define FRAME802154_BEACONREQ (7)
#define FRAME802154_IEEERESERVED (0)
#define FRAME802154_NOADDR (0) /* Only valid for ACK or Beacon frames */
#define FRAME802154_SHORTADDRMODE (2)
#define FRAME802154_LONGADDRMODE (3)
#define FRAME802154_NOBEACONS 0x0f
#define FRAME802154_BROADCASTADDR 0xffff
#define FRAME802154_BROADCASTPANDID 0xffff
#define FRAME802154_IEEE802154_2003 (0)
#define FRAME802154_IEEE802154_2006 (1)
#define FRAME802154_SECURITY_LEVEL_NONE (0)
#define FRAME802154_SECURITY_LEVEL_128 (3)
/* This maximum size of an IEEE802.15.4 frame. Certain, non-standard
* devices may exceed this value, however.
*/
#define SIXLOWPAN_MAC_STDFRAME 127
/****************************************************************************
* Public Types
****************************************************************************/
/* Rime address representation */
struct rimeaddr_s
{
uint8_t u8[NET_6LOWPAN_RIMEADDR_SIZE];
};
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#endif /* CONFIG_NET_6LOWPAN */
#endif /* __INCLUDE_NUTTX_NET_IEEE802154_H */

View File

@ -91,7 +91,7 @@ EXTERN const net_ipv6addr_t g_lo_ipv6addr;
****************************************************************************/
/****************************************************************************
* Function: localhost_initialize
* Name: localhost_initialize
*
* Description:
* Initialize the Ethernet controller and driver

View File

@ -215,7 +215,7 @@ void net_initialize(void);
****************************************************************************/
/****************************************************************************
* Function: net_lock
* Name: net_lock
*
* Description:
* Take the lock
@ -225,7 +225,7 @@ void net_initialize(void);
void net_lock(void);
/****************************************************************************
* Function: net_unlock
* Name: net_unlock
*
* Description:
* Release the lock.
@ -235,7 +235,7 @@ void net_lock(void);
void net_unlock(void);
/****************************************************************************
* Function: net_timedwait
* Name: net_timedwait
*
* Description:
* Atomically wait for sem (or a timeout( while temporarily releasing
@ -256,7 +256,7 @@ struct timespec;
int net_timedwait(sem_t *sem, FAR const struct timespec *abstime);
/****************************************************************************
* Function: net_lockedwait
* Name: net_lockedwait
*
* Description:
* Atomically wait for sem while temporarily releasing lock on the network.
@ -274,7 +274,7 @@ int net_timedwait(sem_t *sem, FAR const struct timespec *abstime);
int net_lockedwait(sem_t *sem);
/****************************************************************************
* Function: net_setipid
* Name: net_setipid
*
* Description:
* This function may be used at boot time to set the initial ip_id.
@ -349,7 +349,7 @@ void net_releaselist(FAR struct socketlist *list);
FAR struct socket *sockfd_socket(int sockfd);
/****************************************************************************
* Function: psock_socket
* Name: psock_socket
*
* Description:
* socket() creates an endpoint for communication and returns a socket
@ -389,7 +389,7 @@ FAR struct socket *sockfd_socket(int sockfd);
int psock_socket(int domain, int type, int protocol, FAR struct socket *psock);
/****************************************************************************
* Function: net_close
* Name: net_close
*
* Description:
* Performs the close operation on socket descriptors
@ -407,7 +407,7 @@ int psock_socket(int domain, int type, int protocol, FAR struct socket *psock);
int net_close(int sockfd);
/****************************************************************************
* Function: psock_close
* Name: psock_close
*
* Description:
* Performs the close operation on a socket instance
@ -425,7 +425,7 @@ int net_close(int sockfd);
int psock_close(FAR struct socket *psock);
/****************************************************************************
* Function: psock_bind
* Name: psock_bind
*
* Description:
* bind() gives the socket 'psock' the local address 'addr'. 'addr' is
@ -459,7 +459,7 @@ int psock_bind(FAR struct socket *psock, FAR const struct sockaddr *addr,
socklen_t addrlen);
/****************************************************************************
* Function: psock_listen
* Name: psock_listen
*
* Description:
* To accept connections, a socket is first created with psock_socket(), a
@ -490,7 +490,7 @@ int psock_bind(FAR struct socket *psock, FAR const struct sockaddr *addr,
int psock_listen(FAR struct socket *psock, int backlog);
/****************************************************************************
* Function: psock_accept
* Name: psock_accept
*
* Description:
* The psock_accept function is used with connection-based socket types
@ -631,7 +631,7 @@ int psock_connect(FAR struct socket *psock, FAR const struct sockaddr *addr,
socklen_t addrlen);
/****************************************************************************
* Function: psock_send
* Name: psock_send
*
* Description:
* The send() call may be used only when the socket is in a connected state
@ -698,7 +698,7 @@ ssize_t psock_send(FAR struct socket *psock, const void *buf, size_t len,
int flags);
/****************************************************************************
* Function: psock_sendto
* Name: psock_sendto
*
* Description:
* If sendto() is used on a connection-mode (SOCK_STREAM, SOCK_SEQPACKET)
@ -767,7 +767,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf,
socklen_t tolen);
/****************************************************************************
* Function: psock_recvfrom
* Name: psock_recvfrom
*
* Description:
* recvfrom() receives messages from a socket, and may be used to receive
@ -830,7 +830,7 @@ ssize_t psock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
psock_recvfrom(psock,buf,len,flags,NULL,0)
/****************************************************************************
* Function: psock_getsockopt
* Name: psock_getsockopt
*
* Description:
* getsockopt() retrieve thse value for the option specified by the
@ -874,7 +874,7 @@ int psock_getsockopt(FAR struct socket *psock, int level, int option,
FAR void *value, FAR socklen_t *value_len);
/****************************************************************************
* Function: psock_setsockopt
* Name: psock_setsockopt
*
* Description:
* psock_setsockopt() sets the option specified by the 'option' argument,
@ -989,7 +989,7 @@ int psock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg);
int netdev_ioctl(int sockfd, int cmd, unsigned long arg);
/****************************************************************************
* Function: psock_poll
* Name: psock_poll
*
* Description:
* The standard poll() operation redirects operations on socket descriptors
@ -1012,7 +1012,7 @@ int psock_poll(FAR struct socket *psock, struct pollfd *fds, bool setup);
#endif
/****************************************************************************
* Function: net_poll
* Name: net_poll
*
* Description:
* The standard poll() operation redirects operations on socket descriptors
@ -1035,7 +1035,7 @@ int net_poll(int sockfd, struct pollfd *fds, bool setup);
#endif
/****************************************************************************
* Function: net_dupsd
* Name: net_dupsd
*
* Description:
* Clone a socket descriptor to an arbitray descriptor number. If file
@ -1048,7 +1048,7 @@ int net_poll(int sockfd, struct pollfd *fds, bool setup);
int net_dupsd(int sockfd, int minsd);
/****************************************************************************
* Function: net_dupsd2
* Name: net_dupsd2
*
* Description:
* Clone a socket descriptor to an arbitray descriptor number. If file
@ -1061,7 +1061,7 @@ int net_dupsd(int sockfd, int minsd);
int net_dupsd2(int sockfd1, int sockfd2);
/****************************************************************************
* Function: net_clone
* Name: net_clone
*
* Description:
* Performs the low level, common portion of net_dupsd() and net_dupsd2()
@ -1071,7 +1071,7 @@ int net_dupsd2(int sockfd1, int sockfd2);
int net_clone(FAR struct socket *psock1, FAR struct socket *psock2);
/****************************************************************************
* Function: net_sendfile
* Name: net_sendfile
*
* Description:
* The send() call may be used only when the socket is in a connected state
@ -1159,7 +1159,7 @@ ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset, size_t count
int net_vfcntl(int sockfd, int cmd, va_list ap);
/****************************************************************************
* Function: netdev_register
* Name: netdev_register
*
* Description:
* Register a network device driver and assign a name to it so that it can
@ -1180,7 +1180,7 @@ int net_vfcntl(int sockfd, int cmd, va_list ap);
int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype);
/****************************************************************************
* Function: netdev_unregister
* Name: netdev_unregister
*
* Description:
* Unregister a network device driver.
@ -1200,7 +1200,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype);
int netdev_unregister(FAR struct net_driver_s *dev);
/****************************************************************************
* Function: netdev_foreach
* Name: netdev_foreach
*
* Description:
* Enumerate each registered network device.

View File

@ -56,12 +56,16 @@
#include <net/ethernet.h>
#include <arpa/inet.h>
#include <nuttx/net/netconfig.h>
#include <nuttx/net/ip.h>
#ifdef CONFIG_NET_IGMP
# include <nuttx/net/igmp.h>
#endif
#include <nuttx/net/netconfig.h>
#include <nuttx/net/ip.h>
#ifdef CONFIG_NET_6LOWPAN
# include <nuttx/net/ieee802154.h>
#endif
/****************************************************************************
* Pre-processor Definitions
@ -207,10 +211,22 @@ struct net_driver_s
#endif
#endif
#ifdef CONFIG_NET_ETHERNET
/* Ethernet device identity */
#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_NET_6LOWPAN)
/* Link layer address */
struct ether_addr d_mac; /* Device MAC address */
union
{
#ifdef CONFIG_NET_ETHERNET
/* Ethernet device identity */
struct ether_addr ether; /* Device Ethernet MAC address */
#endif
#ifdef CONFIG_NET_6LOWPAN
/* The address assigned to an IEEE 802.15.4 radio. */
struct rimeaddr_s ieee802154; /* IEEE 802.15.4 Radio address */
#endif
} d_mac;
#endif
/* Network identity */
@ -616,7 +632,7 @@ uint16_t ipv6_chksum(FAR struct net_driver_s *dev);
#endif
/****************************************************************************
* Function: netdev_ipv4_hdrlen
* Name: netdev_ipv4_hdrlen
*
* Description:
* Provide header length for interface based on device
@ -637,7 +653,7 @@ uint16_t ipv6_chksum(FAR struct net_driver_s *dev);
#endif /* CONFIG_NET_IPv4 */
/****************************************************************************
* Function: netdev_ipv6_hdrlen
* Name: netdev_ipv6_hdrlen
*
* Description:
* Provide header length for interface based on device

View File

@ -86,7 +86,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: phy_notify_subscribe
* Name: phy_notify_subscribe
*
* Description:
* Setup up to deliver signals to the task identified by 'pid' when
@ -117,7 +117,7 @@ int phy_notify_subscribe(FAR const char *intf, pid_t pid, int signo,
#endif
/****************************************************************************
* Function: phy_notify_unsubscribe
* Name: phy_notify_unsubscribe
*
* Description:
* Stop the deliver of signals for events from the PHY associated with

View File

@ -56,6 +56,7 @@
#include <nuttx/clock.h>
#include <nuttx/drivers/iob.h>
#include <nuttx/net/netdev.h>
#include <nuttx/net/ieee802154.h>
#ifdef CONFIG_NET_6LOWPAN
@ -63,17 +64,6 @@
* Pre-processor Definitions
****************************************************************************/
/* By default, a 2-byte Rime address is used for the IEEE802.15.4 MAC
* device's link layer address. If CONFIG_NET_6LOWPAN_RIMEADDR_EXTENDED
* is selected, then an 8-byte Rime address will be used.
*/
#ifdef CONFIG_NET_6LOWPAN_RIMEADDR_EXTENDED
# define NET_6LOWPAN_RIMEADDR_SIZE 8
#else
# define NET_6LOWPAN_RIMEADDR_SIZE 2
#endif
/* Frame format definitions *************************************************/
/* Fragment header.
*
@ -108,49 +98,6 @@
#define RIME_HC1_HC_UDP_PORTS 4 /* 8 bit */
#define RIME_HC1_HC_UDP_CHKSUM 5 /* 16 bit */
/* These are some definitions of element values used in the FCF. See the
* IEEE802.15.4 spec for details.
*/
#define FRAME802154_FRAMETYPE_SHIFT (0) /* Bits 0-2: Frame type */
#define FRAME802154_FRAMETYPE_MASK (7 << FRAME802154_FRAMETYPE_SHIFT)
#define FRAME802154_SECENABLED_SHIFT (3) /* Bit 3: Security enabled */
#define FRAME802154_FRAMEPENDING_SHIFT (4) /* Bit 4: Frame pending */
#define FRAME802154_ACKREQUEST_SHIFT (5) /* Bit 5: ACK request */
#define FRAME802154_PANIDCOMP_SHIFT (6) /* Bit 6: PANID compression */
/* Bits 7-9: Reserved */
#define FRAME802154_DSTADDR_SHIFT (2) /* Bits 10-11: Dest address mode */
#define FRAME802154_DSTADDR_MASK (3 << FRAME802154_DSTADDR_SHIFT)
#define FRAME802154_VERSION_SHIFT (4) /* Bit 12-13: Frame version */
#define FRAME802154_VERSION_MASK (3 << FRAME802154_VERSION_SHIFT)
#define FRAME802154_SRCADDR_SHIFT (6) /* Bits 14-15: Source address mode */
#define FRAME802154_SRCADDR_MASK (3 << FRAME802154_SRCADDR_SHIFT)
/* Unshifted values for use in struct frame802154_fcf_s */
#define FRAME802154_BEACONFRAME (0)
#define FRAME802154_DATAFRAME (1)
#define FRAME802154_ACKFRAME (2)
#define FRAME802154_CMDFRAME (3)
#define FRAME802154_BEACONREQ (7)
#define FRAME802154_IEEERESERVED (0)
#define FRAME802154_NOADDR (0) /* Only valid for ACK or Beacon frames */
#define FRAME802154_SHORTADDRMODE (2)
#define FRAME802154_LONGADDRMODE (3)
#define FRAME802154_NOBEACONS 0x0f
#define FRAME802154_BROADCASTADDR 0xffff
#define FRAME802154_BROADCASTPANDID 0xffff
#define FRAME802154_IEEE802154_2003 (0)
#define FRAME802154_IEEE802154_2006 (1)
#define FRAME802154_SECURITY_LEVEL_NONE (0)
#define FRAME802154_SECURITY_LEVEL_128 (3)
/* Min and Max compressible UDP ports - HC06 */
#define SIXLOWPAN_UDP_4_BIT_PORT_MIN 0xf0b0
@ -261,12 +208,6 @@
#define SIXLOWPAN_FRAG1_HDR_LEN 4
#define SIXLOWPAN_FRAGN_HDR_LEN 5
/* This maximum size of an IEEE802.15.4 frame. Certain, non-standard
* devices may exceed this value, however.
*/
#define SIXLOWPAN_MAC_STDFRAME 127
/* Address compressibility test macros **************************************/
/* Check whether we can compress the IID in address 'a' to 16 bits. This is
@ -389,13 +330,6 @@
* Public Types
****************************************************************************/
/* Rime address representation */
struct rimeaddr_s
{
uint8_t u8[NET_6LOWPAN_RIMEADDR_SIZE];
};
/* The device structure for IEEE802.15.4 MAC network device differs from the
* standard Ethernet MAC device structure. The main reason for this
* difference is that fragmentation must be supported.
@ -432,9 +366,7 @@ struct rimeaddr_s
* 2. i_dsn must be set to a random value. After that, it will be managed
* by the network.
*
* 3. i_nodeaddr must be set after the MAC is assigned an address.
*
* 4. On a TX poll, the IEEE802.15.4 MAC driver should provide its driver
* 3. On a TX poll, the IEEE802.15.4 MAC driver should provide its driver
* structure with i_framelist set to NULL. At the conclusion of the
* poll, if there are frames to be sent, they will have been added to
* the i_framelist. The non-empty frame list at the conclusion of the
@ -449,7 +381,7 @@ struct rimeaddr_s
* After sending each frame, the driver must return the IOB to the pool
* of free IOBs using the FROM_IOB_FREE() macro.
*
* 5. When receiving data both buffers must be provided:
* 4. When receiving data both buffers must be provided:
*
* The IEEE802.15.4 MAC driver should receive the frame data directly
* into the payload area of an IOB structure. That IOB structure may be
@ -510,10 +442,6 @@ struct ieee802154_driver_s
uint16_t i_panid;
/* i_node_addr. The address assigned to this node. */
struct rimeaddr_s i_nodeaddr;
/* i_dsn. The sequence number in the range 0x00-0xff added to the
* transmitted data or MAC command frame. The default is a random value
* within that range.

View File

@ -93,7 +93,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: slip_initialize
* Name: slip_initialize
*
* Description:
* Instantiate a SLIP network interface.

View File

@ -82,7 +82,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: tun_initialize
* Name: tun_initialize
*
* Description:
* Instantiate a SLIP network interface.

View File

@ -110,7 +110,7 @@ extern struct entropy_pool_s board_entropy_pool;
#ifdef CONFIG_CRYPTO_RANDOM_POOL
/****************************************************************************
* Function: up_rngaddint
* Name: up_rngaddint
*
* Description:
* Add one integer to entropy pool, contributing a specific kind
@ -128,7 +128,7 @@ extern struct entropy_pool_s board_entropy_pool;
void up_rngaddint(enum rnd_source_t kindof, int val);
/****************************************************************************
* Function: up_rngaddentropy
* Name: up_rngaddentropy
*
* Description:
* Add buffer of integers to entropy pool.
@ -147,7 +147,7 @@ void up_rngaddentropy(enum rnd_source_t kindof, FAR const uint32_t *buf,
size_t n);
/****************************************************************************
* Function: up_rngreseed
* Name: up_rngreseed
*
* Description:
* Force reseeding random number generator from entropy pool
@ -157,7 +157,7 @@ void up_rngaddentropy(enum rnd_source_t kindof, FAR const uint32_t *buf,
void up_rngreseed(void);
/****************************************************************************
* Function: up_randompool_initialize
* Name: up_randompool_initialize
*
* Description:
* Initialize entropy pool and random number generator

View File

@ -143,7 +143,7 @@ int sem_tickwait(FAR sem_t *sem, systime_t start, uint32_t delay);
int sem_reset(FAR sem_t *sem, int16_t count);
/****************************************************************************
* Function: sem_getprotocol
* Name: sem_getprotocol
*
* Description:
* Return the value of the semaphore protocol attribute.
@ -163,7 +163,7 @@ int sem_reset(FAR sem_t *sem, int16_t count);
int sem_getprotocol(FAR sem_t *sem, FAR int *protocol);
/****************************************************************************
* Function: sem_setprotocol
* Name: sem_setprotocol
*
* Description:
* Set semaphore protocol attribute.

View File

@ -81,7 +81,7 @@ extern "C"
#endif
/****************************************************************************
* Function: clock_isleapyear
* Name: clock_isleapyear
*
* Description:
* Return true if the specified year is a leap year
@ -91,7 +91,7 @@ extern "C"
int clock_isleapyear(int year);
/****************************************************************************
* Function: clock_daysbeforemonth
* Name: clock_daysbeforemonth
*
* Description:
* Get the number of days that occurred before the beginning of the month.
@ -101,7 +101,7 @@ int clock_isleapyear(int year);
int clock_daysbeforemonth(int month, bool leapyear);
/****************************************************************************
* Function: clock_dayoftheweek
* Name: clock_dayoftheweek
*
* Description:
* Get the day of the week
@ -121,7 +121,7 @@ int clock_dayoftheweek(int mday, int month, int year);
#endif
/****************************************************************************
* Function: clock_calendar2utc
* Name: clock_calendar2utc
*
* Description:
* Calendar/UTC conversion based on algorithms from p. 604

View File

@ -63,7 +63,7 @@ extern "C"
#endif
/****************************************************************************
* Function: ov2640_initialize
* Name: ov2640_initialize
*
* Description:
* Initialize the OV2640 camera.

View File

@ -74,7 +74,7 @@ extern "C"
#endif
/****************************************************************************
* Function: vnc_fbinitialize
* Name: vnc_fbinitialize
*
* Description:
* Initialize the VNC frame buffer driver. The VNC frame buffer driver
@ -132,7 +132,7 @@ int vnc_fbinitialize(int display, vnc_kbdout_t kbdout,
vnc_mouseout_t mouseout, FAR void *arg);
/****************************************************************************
* Function: vnc_mouse and vnc_kbdout
* Name: vnc_mouse and vnc_kbdout
*
* Description:
* These are the default keyboard/mouse callout functions. They are
@ -162,7 +162,7 @@ void vnc_mouseout(FAR void *arg, nxgl_coord_t x, nxgl_coord_t y,
#endif
/****************************************************************************
* Function: vnc_default_fbinitialize
* Name: vnc_default_fbinitialize
*
* Description:
* This is just a wrapper around vnc_fbinitialize() that will establish

View File

@ -59,7 +59,7 @@ extern "C"
****************************************************************************/
/************************************************************************************
* Function: bcmf_board_initialize
* Name: bcmf_board_initialize
*
* Description:
* Board specific function called from Broadcom FullMAC driver
@ -73,7 +73,7 @@ extern "C"
void bcmf_board_initialize(int minor);
/************************************************************************************
* Function: bcmf_board_power
* Name: bcmf_board_power
*
* Description:
* Board specific function called from Broadcom FullMAC driver
@ -88,7 +88,7 @@ void bcmf_board_initialize(int minor);
void bcmf_board_power(int minor, bool power);
/************************************************************************************
* Function: bcmf_board_reset
* Name: bcmf_board_reset
*
* Description:
* Board specific function called from Broadcom FullMAC driver

View File

@ -59,7 +59,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: bcmf_sdio_initialize
* Name: bcmf_sdio_initialize
*
* Description:
* Initialize Broadcom FullMAC driver.

View File

@ -52,7 +52,7 @@
****************************************************************************/
/****************************************************************************
* Function: ieee8021514_loopback
* Name: ieee8021514_loopback
*
* Description:
* Initialize and register the Ieee802.15.4 MAC loopback network driver.

View File

@ -79,7 +79,7 @@ extern "C"
****************************************************************************/
/****************************************************************************
* Function: mrf24j40_init
* Name: mrf24j40_init
*
* Description:
* Initialize the IEEE802.15.4 driver. The MRF24J40 device is assumed to be

View File

@ -63,7 +63,6 @@
* interface.
*/
/* IEEE802.11 */
/* Wireless identification */
#define SIOCSIWCOMMIT _WLIOC(0x0001) /* Commit pending changes to driver */
@ -154,24 +153,8 @@
#define SIOCSIWPMKSA _WLIOC(0x0032) /* PMKSA cache operation */
/* IEEE802.15.4 6loWPAN
*
* IEEE802.15.4 IOCTLs may be directed at one of three layers:
*
* 1. To the 6loWPAN network layer, as documented here,
* 2. To the IEEE802.15.4 MAC layer, as documented in,
* include/nuttx/wireless/ieee802154/ioeee802154_mac.h, or to
* 3. To the IEEE802.15.4 radio device layer, as documented in,
* include/nuttx/wireless/ieee802154/ioeee802154_radio.h.
*
* SIOCSWPANID - Join the specified PAN ID
*/
#define SIOCSWPANID _WLIOC(0x0033) /* Join PAN ID */
#define SIOCGWPANID _WLIOC(0x0034) /* Return PAN ID */
#define WL_FIRSTCHAR 0x0035
#define WL_NNETCMDS 0x0034
#define WL_FIRSTCHAR 0x0033
#define WL_NNETCMDS 0x0032
/* Character Driver IOCTL commands *************************************************/
/* Non-compatible, NuttX only IOCTL definitions for use with low-level wireless
@ -179,23 +162,23 @@
* requires a file descriptor created by the open() interface.
*/
#define WLIOC_SETRADIOFREQ _WLIOC(0x0035) /* arg: Pointer to uint32_t, frequency
#define WLIOC_SETRADIOFREQ _WLIOC(0x0033) /* arg: Pointer to uint32_t, frequency
* value (in Mhz) */
#define WLIOC_GETRADIOFREQ _WLIOC(0x0036) /* arg: Pointer to uint32_t, frequency
#define WLIOC_GETRADIOFREQ _WLIOC(0x0034) /* arg: Pointer to uint32_t, frequency
* value (in Mhz) */
#define WLIOC_SETADDR _WLIOC(0x0037) /* arg: Pointer to address value, format
#define WLIOC_SETADDR _WLIOC(0x0035) /* arg: Pointer to address value, format
* of the address is driver specific */
#define WLIOC_GETADDR _WLIOC(0x0038) /* arg: Pointer to address value, format
#define WLIOC_GETADDR _WLIOC(0x0036) /* arg: Pointer to address value, format
* of the address is driver specific */
#define WLIOC_SETTXPOWER _WLIOC(0x0039) /* arg: Pointer to int32_t, output power
#define WLIOC_SETTXPOWER _WLIOC(0x0037) /* arg: Pointer to int32_t, output power
* (in dBm) */
#define WLIOC_GETTXPOWER _WLIOC(0x003a) /* arg: Pointer to int32_t, output power
#define WLIOC_GETTXPOWER _WLIOC(0x0038) /* arg: Pointer to int32_t, output power
* (in dBm) */
/* Device-specific IOCTL commands **************************************************/
#define WL_FIRST 0x0001 /* First common command */
#define WL_NCMDS 0x003a /* Number of common commands */
#define WL_NCMDS 0x0038 /* Number of common commands */
/* User defined ioctl commands are also supported. These will be forwarded
* by the upper-half QE driver to the lower-half QE driver via the ioctl()
@ -372,35 +355,5 @@ struct iw_event
union iwreq_data u; /* Fixed IOCTL payload */
};
/* 6loWPAN */
/* This structure is used with the SIOCSWPANID IOCTL command to select the
* PAN ID to join.
*/
struct sixlowpan_panid_s
{
uint16_t panid; /* The PAN ID to join */
};
/* This union defines the data payload of an 6loWPAN or SIOCGWPANID ioctl
* command and is used in struct sixlowpan_req_s below.
*/
union sixlowpan_data
{
struct sixlowpan_panid_s panid; /* PAN ID to join */
};
/* This is the structure used to exchange data in wireless IOCTLs. This
* structure is the same as 'struct ifreq', but defined for use with
* 6loWPAN IOCTLs.
*/
struct sixlowpan_req_s
{
char ifr_name[IFNAMSIZ]; /* Interface name, e.g. "wpan0" */
union sixlowpan_data u; /* Data payload */
};
#endif /* CONFIG_DRIVERS_WIRELESS */
#endif /* __INCLUDE_NUTTX_WIRELESS_WIRELESS_H */

View File

@ -51,7 +51,7 @@
#ifdef CONFIG_CRYPTO_RANDOM_POOL
/****************************************************************************
* Function: getrandom
* Name: getrandom
*
* Description:
* Fill a buffer of arbitrary length with randomness. This is the

View File

@ -53,7 +53,7 @@ static char g_retchar[2];
****************************************************************************/
/****************************************************************************
* Function: basename
* Name: basename
*
* Description:
* basename() extracts the filename component from a null-terminated

View File

@ -53,7 +53,7 @@ static char g_retchar[2];
****************************************************************************/
/****************************************************************************
* Function: dirname
* Name: dirname
*
* Description:
* dirname() extracts the directory component from a null-terminated

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