From f905d498c81714e5c846529a441ef6977908d39f Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 2 Apr 2016 08:08:40 +0000 Subject: Renaming of LLD files inclusions. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9207 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/hal_adc.h | 2 +- os/hal/include/hal_can.h | 2 +- os/hal/include/hal_dac.h | 2 +- os/hal/include/hal_ext.h | 2 +- os/hal/include/hal_gpt.h | 2 +- os/hal/include/hal_i2c.h | 2 +- os/hal/include/hal_i2s.h | 2 +- os/hal/include/hal_icu.h | 2 +- os/hal/include/hal_mac.h | 4 +- os/hal/include/hal_mii.h | 175 ++++++++++++++++++++++++++++++++++++++++ os/hal/include/hal_pal.h | 2 +- os/hal/include/hal_pwm.h | 2 +- os/hal/include/hal_rtc.h | 2 +- os/hal/include/hal_sdc.h | 2 +- os/hal/include/hal_serial.h | 2 +- os/hal/include/hal_serial_usb.h | 2 +- os/hal/include/hal_spi.h | 2 +- os/hal/include/hal_st.h | 2 +- os/hal/include/hal_uart.h | 2 +- os/hal/include/hal_usb.h | 2 +- os/hal/include/hal_usb_cdc.h | 136 +++++++++++++++++++++++++++++++ os/hal/include/hal_wdg.h | 2 +- os/hal/include/mii.h | 175 ---------------------------------------- os/hal/include/usb_cdc.h | 136 ------------------------------- os/hal/templates/hal_mac_lld.c | 2 +- os/hal/templates/platform.mk | 30 +++---- 26 files changed, 347 insertions(+), 349 deletions(-) create mode 100644 os/hal/include/hal_mii.h create mode 100644 os/hal/include/hal_usb_cdc.h delete mode 100644 os/hal/include/mii.h delete mode 100644 os/hal/include/usb_cdc.h (limited to 'os/hal') diff --git a/os/hal/include/hal_adc.h b/os/hal/include/hal_adc.h index 91bda58a7..7b93851c5 100644 --- a/os/hal/include/hal_adc.h +++ b/os/hal/include/hal_adc.h @@ -76,7 +76,7 @@ typedef enum { ADC_ERROR = 5 /**< Conversion complete. */ } adcstate_t; -#include "adc_lld.h" +#include "hal_adc_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_can.h b/os/hal/include/hal_can.h index 73f57e580..7a94827fd 100644 --- a/os/hal/include/hal_can.h +++ b/os/hal/include/hal_can.h @@ -100,7 +100,7 @@ typedef enum { CAN_SLEEP = 4 /**< Sleep state. */ } canstate_t; -#include "can_lld.h" +#include "hal_can_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_dac.h b/os/hal/include/hal_dac.h index ebe03e944..90d709256 100644 --- a/os/hal/include/hal_dac.h +++ b/os/hal/include/hal_dac.h @@ -76,7 +76,7 @@ typedef enum { DAC_ERROR = 5 /**< Error. */ } dacstate_t; -#include "dac_lld.h" +#include "hal_dac_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_ext.h b/os/hal/include/hal_ext.h index 4716d0a85..c93a4ce97 100644 --- a/os/hal/include/hal_ext.h +++ b/os/hal/include/hal_ext.h @@ -71,7 +71,7 @@ typedef enum { */ typedef struct EXTDriver EXTDriver; -#include "ext_lld.h" +#include "hal_ext_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_gpt.h b/os/hal/include/hal_gpt.h index 561010973..3af462121 100644 --- a/os/hal/include/hal_gpt.h +++ b/os/hal/include/hal_gpt.h @@ -66,7 +66,7 @@ typedef struct GPTDriver GPTDriver; */ typedef void (*gptcallback_t)(GPTDriver *gptp); -#include "gpt_lld.h" +#include "hal_gpt_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_i2c.h b/os/hal/include/hal_i2c.h index a9676a21d..c9c8409cb 100644 --- a/os/hal/include/hal_i2c.h +++ b/os/hal/include/hal_i2c.h @@ -82,7 +82,7 @@ typedef enum { I2C_LOCKED = 5 /**> Bus or driver locked. */ } i2cstate_t; -#include "i2c_lld.h" +#include "hal_i2c_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_i2s.h b/os/hal/include/hal_i2s.h index 2ef57a030..d66f6ce66 100644 --- a/os/hal/include/hal_i2s.h +++ b/os/hal/include/hal_i2s.h @@ -62,7 +62,7 @@ typedef enum { I2S_COMPLETE = 4 /**< Transmission complete. */ } i2sstate_t; -#include "i2s_lld.h" +#include "hal_i2s_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_icu.h b/os/hal/include/hal_icu.h index b25fe7de5..1e7882644 100644 --- a/os/hal/include/hal_icu.h +++ b/os/hal/include/hal_icu.h @@ -66,7 +66,7 @@ typedef struct ICUDriver ICUDriver; */ typedef void (*icucallback_t)(ICUDriver *icup); -#include "icu_lld.h" +#include "hal_icu_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_mac.h b/os/hal/include/hal_mac.h index 174ecb991..5c7bc82de 100644 --- a/os/hal/include/hal_mac.h +++ b/os/hal/include/hal_mac.h @@ -26,8 +26,6 @@ #if (HAL_USE_MAC == TRUE) || defined(__DOXYGEN__) -#include "mii.h" - /*===========================================================================*/ /* Driver constants. */ /*===========================================================================*/ @@ -77,7 +75,7 @@ typedef enum { */ typedef struct MACDriver MACDriver; -#include "mac_lld.h" +#include "hal_mac_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_mii.h b/os/hal/include/hal_mii.h new file mode 100644 index 000000000..49a9bb3ac --- /dev/null +++ b/os/hal/include/hal_mii.h @@ -0,0 +1,175 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file hal_mii.h + * @brief MII macros and structures. + * + * @addtogroup MII + * @{ + */ + +#ifndef MII_H +#define MII_H + +/** + * @name Generic MII registers + * @{ + */ +#define MII_BMCR 0x00 /**< Basic mode control register. */ +#define MII_BMSR 0x01 /**< Basic mode status register. */ +#define MII_PHYSID1 0x02 /**< PHYS ID 1. */ +#define MII_PHYSID2 0x03 /**< PHYS ID 2. */ +#define MII_ADVERTISE 0x04 /**< Advertisement control reg. */ +#define MII_LPA 0x05 /**< Link partner ability reg. */ +#define MII_EXPANSION 0x06 /**< Expansion register. */ +#define MII_ANNPTR 0x07 /**< 1000BASE-T control. */ +#define MII_CTRL1000 0x09 /**< 1000BASE-T control. */ +#define MII_STAT1000 0x0a /**< 1000BASE-T status. */ +#define MII_ESTATUS 0x0f /**< Extended Status. */ +#define MII_PHYSTS 0x10 /**< PHY Status register. */ +#define MII_MICR 0x11 /**< MII Interrupt ctrl register. */ +#define MII_DCOUNTER 0x12 /**< Disconnect counter. */ +#define MII_FCSCOUNTER 0x13 /**< False carrier counter. */ +#define MII_NWAYTEST 0x14 /**< N-way auto-neg test reg. */ +#define MII_RERRCOUNTER 0x15 /**< Receive error counter. */ +#define MII_SREVISION 0x16 /**< Silicon revision. */ +#define MII_RESV1 0x17 /**< Reserved. */ +#define MII_LBRERROR 0x18 /**< Lpback, rx, bypass error. */ +#define MII_PHYADDR 0x19 /**< PHY address. */ +#define MII_RESV2 0x1a /**< Reserved. */ +#define MII_TPISTATUS 0x1b /**< TPI status for 10Mbps. */ +#define MII_NCONFIG 0x1c /**< Network interface config. */ +/** @} */ + +/** + * @name Basic mode control register + * @{ + */ +#define BMCR_RESV 0x007f /**< Unused. */ +#define BMCR_CTST 0x0080 /**< Collision test. */ +#define BMCR_FULLDPLX 0x0100 /**< Full duplex. */ +#define BMCR_ANRESTART 0x0200 /**< Auto negotiation restart. */ +#define BMCR_ISOLATE 0x0400 /**< Disconnect DP83840 from MII. */ +#define BMCR_PDOWN 0x0800 /**< Powerdown. */ +#define BMCR_ANENABLE 0x1000 /**< Enable auto negotiation. */ +#define BMCR_SPEED100 0x2000 /**< Select 100Mbps. */ +#define BMCR_LOOPBACK 0x4000 /**< TXD loopback bit. */ +#define BMCR_RESET 0x8000 /**< Reset. */ +/** @} */ + +/** + * @name Basic mode status register + * @{ + */ +#define BMSR_ERCAP 0x0001 /**< Ext-reg capability. */ +#define BMSR_JCD 0x0002 /**< Jabber detected. */ +#define BMSR_LSTATUS 0x0004 /**< Link status. */ +#define BMSR_ANEGCAPABLE 0x0008 /**< Able to do auto-negotiation. */ +#define BMSR_RFAULT 0x0010 /**< Remote fault detected. */ +#define BMSR_ANEGCOMPLETE 0x0020 /**< Auto-negotiation complete. */ +#define BMSR_MFPRESUPPCAP 0x0040 /**< Able to suppress preamble. */ +#define BMSR_RESV 0x0780 /**< Unused. */ +#define BMSR_10HALF 0x0800 /**< Can do 10mbps, half-duplex. */ +#define BMSR_10FULL 0x1000 /**< Can do 10mbps, full-duplex. */ +#define BMSR_100HALF 0x2000 /**< Can do 100mbps, half-duplex. */ +#define BMSR_100FULL 0x4000 /**< Can do 100mbps, full-duplex. */ +#define BMSR_100BASE4 0x8000 /**< Can do 100mbps, 4k packets. */ +/** @} */ + +/** + * @name Advertisement control register + * @{ + */ +#define ADVERTISE_SLCT 0x001f /**< Selector bits. */ +#define ADVERTISE_CSMA 0x0001 /**< Only selector supported. */ +#define ADVERTISE_10HALF 0x0020 /**< Try for 10mbps half-duplex. */ +#define ADVERTISE_10FULL 0x0040 /**< Try for 10mbps full-duplex. */ +#define ADVERTISE_100HALF 0x0080 /**< Try for 100mbps half-duplex. */ +#define ADVERTISE_100FULL 0x0100 /**< Try for 100mbps full-duplex. */ +#define ADVERTISE_100BASE4 0x0200 /**< Try for 100mbps 4k packets. */ +#define ADVERTISE_PAUSE_CAP 0x0400 /**< Try for pause. */ +#define ADVERTISE_PAUSE_ASYM 0x0800 /**< Try for asymetric pause. */ +#define ADVERTISE_RESV 0x1000 /**< Unused. */ +#define ADVERTISE_RFAULT 0x2000 /**< Say we can detect faults. */ +#define ADVERTISE_LPACK 0x4000 /**< Ack link partners response. */ +#define ADVERTISE_NPAGE 0x8000 /**< Next page bit. */ + +#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ + ADVERTISE_CSMA) +#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ + ADVERTISE_100HALF | ADVERTISE_100FULL) +/** @} */ + +/** + * @name Link partner ability register + * @{ + */ +#define LPA_SLCT 0x001f /**< Same as advertise selector. */ +#define LPA_10HALF 0x0020 /**< Can do 10mbps half-duplex. */ +#define LPA_10FULL 0x0040 /**< Can do 10mbps full-duplex. */ +#define LPA_100HALF 0x0080 /**< Can do 100mbps half-duplex. */ +#define LPA_100FULL 0x0100 /**< Can do 100mbps full-duplex. */ +#define LPA_100BASE4 0x0200 /**< Can do 100mbps 4k packets. */ +#define LPA_PAUSE_CAP 0x0400 /**< Can pause. */ +#define LPA_PAUSE_ASYM 0x0800 /**< Can pause asymetrically. */ +#define LPA_RESV 0x1000 /**< Unused. */ +#define LPA_RFAULT 0x2000 /**< Link partner faulted. */ +#define LPA_LPACK 0x4000 /**< Link partner acked us. */ +#define LPA_NPAGE 0x8000 /**< Next page bit. */ + +#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) +#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) +/** @} */ + +/** + * @name Expansion register for auto-negotiation + * @{ + */ +#define EXPANSION_NWAY 0x0001 /**< Can do N-way auto-nego. */ +#define EXPANSION_LCWP 0x0002 /**< Got new RX page code word. */ +#define EXPANSION_ENABLENPAGE 0x0004 /**< This enables npage words. */ +#define EXPANSION_NPCAPABLE 0x0008 /**< Link partner supports npage. */ +#define EXPANSION_MFAULTS 0x0010 /**< Multiple faults detected. */ +#define EXPANSION_RESV 0xffe0 /**< Unused. */ +/** @} */ + +/** + * @name N-way test register + * @{ + */ +#define NWAYTEST_RESV1 0x00ff /**< Unused. */ +#define NWAYTEST_LOOPBACK 0x0100 /**< Enable loopback for N-way. */ +#define NWAYTEST_RESV2 0xfe00 /**< Unused. */ +/** @} */ + +/** + * @name PHY identifiers + * @{ + */ +#define MII_DM9161_ID 0x0181b8a0 +#define MII_AM79C875_ID 0x00225540 +#define MII_KS8721_ID 0x00221610 +#define MII_STE101P_ID 0x00061C50 +#define MII_DP83848I_ID 0x20005C90 +#define MII_LAN8710A_ID 0x0007C0F1 +#define MII_LAN8720_ID 0x0007C0F0 +#define MII_LAN8742A_ID 0x0007C130 +/** @} */ + +#endif /* MII_H */ + +/** @} */ diff --git a/os/hal/include/hal_pal.h b/os/hal/include/hal_pal.h index fc3f4453c..3df841453 100644 --- a/os/hal/include/hal_pal.h +++ b/os/hal/include/hal_pal.h @@ -110,7 +110,7 @@ /* Driver data structures and types. */ /*===========================================================================*/ -#include "pal_lld.h" +#include "hal_pal_lld.h" /** * @brief I/O bus descriptor. diff --git a/os/hal/include/hal_pwm.h b/os/hal/include/hal_pwm.h index e50f7a10d..6d69cdbc7 100644 --- a/os/hal/include/hal_pwm.h +++ b/os/hal/include/hal_pwm.h @@ -89,7 +89,7 @@ typedef struct PWMDriver PWMDriver; */ typedef void (*pwmcallback_t)(PWMDriver *pwmp); -#include "pwm_lld.h" +#include "hal_pwm_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_rtc.h b/os/hal/include/hal_rtc.h index ddfa0d8c1..f269c9706 100644 --- a/os/hal/include/hal_rtc.h +++ b/os/hal/include/hal_rtc.h @@ -101,7 +101,7 @@ typedef struct { /*lint -restore*/ } RTCDateTime; -#include "rtc_lld.h" +#include "hal_rtc_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_sdc.h b/os/hal/include/hal_sdc.h index 2f6acdc07..98a0492ab 100644 --- a/os/hal/include/hal_sdc.h +++ b/os/hal/include/hal_sdc.h @@ -119,7 +119,7 @@ typedef enum { SDC_CLK_50MHz } sdcbusclk_t; -#include "sdc_lld.h" +#include "hal_sdc_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_serial.h b/os/hal/include/hal_serial.h index ac47cab79..60c7bc4aa 100644 --- a/os/hal/include/hal_serial.h +++ b/os/hal/include/hal_serial.h @@ -93,7 +93,7 @@ typedef enum { */ typedef struct SerialDriver SerialDriver; -#include "serial_lld.h" +#include "hal_serial_lld.h" /** * @brief @p SerialDriver specific methods. diff --git a/os/hal/include/hal_serial_usb.h b/os/hal/include/hal_serial_usb.h index f76f603e1..d0d3c6cd2 100644 --- a/os/hal/include/hal_serial_usb.h +++ b/os/hal/include/hal_serial_usb.h @@ -27,7 +27,7 @@ #if (HAL_USE_SERIAL_USB == TRUE) || defined(__DOXYGEN__) -#include "usb_cdc.h" +#include "hal_usb_cdc.h" /*===========================================================================*/ /* Driver constants. */ diff --git a/os/hal/include/hal_spi.h b/os/hal/include/hal_spi.h index c25857db6..9e4b46425 100644 --- a/os/hal/include/hal_spi.h +++ b/os/hal/include/hal_spi.h @@ -75,7 +75,7 @@ typedef enum { SPI_COMPLETE = 4 /**< Asynchronous operation complete. */ } spistate_t; -#include "spi_lld.h" +#include "hal_spi_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_st.h b/os/hal/include/hal_st.h index f2daace1d..e2c03cc2e 100644 --- a/os/hal/include/hal_st.h +++ b/os/hal/include/hal_st.h @@ -43,7 +43,7 @@ /* Driver data structures and types. */ /*===========================================================================*/ -#include "st_lld.h" +#include "hal_st_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_uart.h b/os/hal/include/hal_uart.h index 02d6a4ff9..02537aa29 100644 --- a/os/hal/include/hal_uart.h +++ b/os/hal/include/hal_uart.h @@ -103,7 +103,7 @@ typedef enum { UART_RX_COMPLETE = 2 /**< Buffer complete. */ } uartrxstate_t; -#include "uart_lld.h" +#include "hal_uart_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_usb.h b/os/hal/include/hal_usb.h index f54195af1..0e9ecb238 100644 --- a/os/hal/include/hal_usb.h +++ b/os/hal/include/hal_usb.h @@ -366,7 +366,7 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp, uint8_t dindex, uint16_t lang); -#include "usb_lld.h" +#include "hal_usb_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/hal_usb_cdc.h b/os/hal/include/hal_usb_cdc.h new file mode 100644 index 000000000..a52aa537d --- /dev/null +++ b/os/hal/include/hal_usb_cdc.h @@ -0,0 +1,136 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file hal_usb_cdc.h + * @brief USB CDC macros and structures. + * + * @addtogroup USB_CDC + * @{ + */ + +#ifndef USB_CDC_H +#define USB_CDC_H + +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + +/** + * @name CDC specific messages. + * @{ + */ +#define CDC_SEND_ENCAPSULATED_COMMAND 0x00U +#define CDC_GET_ENCAPSULATED_RESPONSE 0x01U +#define CDC_SET_COMM_FEATURE 0x02U +#define CDC_GET_COMM_FEATURE 0x03U +#define CDC_CLEAR_COMM_FEATURE 0x04U +#define CDC_SET_AUX_LINE_STATE 0x10U +#define CDC_SET_HOOK_STATE 0x11U +#define CDC_PULSE_SETUP 0x12U +#define CDC_SEND_PULSE 0x13U +#define CDC_SET_PULSE_TIME 0x14U +#define CDC_RING_AUX_JACK 0x15U +#define CDC_SET_LINE_CODING 0x20U +#define CDC_GET_LINE_CODING 0x21U +#define CDC_SET_CONTROL_LINE_STATE 0x22U +#define CDC_SEND_BREAK 0x23U +#define CDC_SET_RINGER_PARMS 0x30U +#define CDC_GET_RINGER_PARMS 0x31U +#define CDC_SET_OPERATION_PARMS 0x32U +#define CDC_GET_OPERATION_PARMS 0x33U +/** @} */ + +/** + * @name CDC classes + * @{ + */ +#define CDC_COMMUNICATION_INTERFACE_CLASS 0x02U +#define CDC_DATA_INTERFACE_CLASS 0x0AU +/** @} */ + +/** + * @name CDC subclasses + * @{ + */ +#define CDC_ABSTRACT_CONTROL_MODEL 0x02U +/** @} */ + +/** + * @name CDC descriptors + * @{ + */ +#define CDC_CS_INTERFACE 0x24U +/** @} */ + +/** + * @name CDC subdescriptors + * @{ + */ +#define CDC_HEADER 0x00U +#define CDC_CALL_MANAGEMENT 0x01U +#define CDC_ABSTRACT_CONTROL_MANAGEMENT 0x02U +#define CDC_UNION 0x06U +/** @} */ + +/** + * @name Line Control bit definitions. + * @{ + */ +#define LC_STOP_1 0U +#define LC_STOP_1P5 1U +#define LC_STOP_2 2U + +#define LC_PARITY_NONE 0U +#define LC_PARITY_ODD 1U +#define LC_PARITY_EVEN 2U +#define LC_PARITY_MARK 3U +#define LC_PARITY_SPACE 4U +/** @} */ + +/*===========================================================================*/ +/* Driver pre-compile time settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver data structures and types. */ +/*===========================================================================*/ + +/** + * @brief Type of Line Coding structure. + */ +typedef struct { + uint8_t dwDTERate[4]; + uint8_t bCharFormat; + uint8_t bParityType; + uint8_t bDataBits; +} cdc_linecoding_t; + +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#endif /* USB_CDC_H */ + +/** @} */ diff --git a/os/hal/include/hal_wdg.h b/os/hal/include/hal_wdg.h index 5e06716ef..b2c86c146 100644 --- a/os/hal/include/hal_wdg.h +++ b/os/hal/include/hal_wdg.h @@ -52,7 +52,7 @@ typedef enum { WDG_READY = 2 /**< Ready. */ } wdgstate_t; -#include "wdg_lld.h" +#include "hal_wdg_lld.h" /*===========================================================================*/ /* Driver macros. */ diff --git a/os/hal/include/mii.h b/os/hal/include/mii.h deleted file mode 100644 index facbe2352..000000000 --- a/os/hal/include/mii.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file mii.h - * @brief MII macros and structures. - * - * @addtogroup MII - * @{ - */ - -#ifndef MII_H -#define MII_H - -/** - * @name Generic MII registers - * @{ - */ -#define MII_BMCR 0x00 /**< Basic mode control register. */ -#define MII_BMSR 0x01 /**< Basic mode status register. */ -#define MII_PHYSID1 0x02 /**< PHYS ID 1. */ -#define MII_PHYSID2 0x03 /**< PHYS ID 2. */ -#define MII_ADVERTISE 0x04 /**< Advertisement control reg. */ -#define MII_LPA 0x05 /**< Link partner ability reg. */ -#define MII_EXPANSION 0x06 /**< Expansion register. */ -#define MII_ANNPTR 0x07 /**< 1000BASE-T control. */ -#define MII_CTRL1000 0x09 /**< 1000BASE-T control. */ -#define MII_STAT1000 0x0a /**< 1000BASE-T status. */ -#define MII_ESTATUS 0x0f /**< Extended Status. */ -#define MII_PHYSTS 0x10 /**< PHY Status register. */ -#define MII_MICR 0x11 /**< MII Interrupt ctrl register. */ -#define MII_DCOUNTER 0x12 /**< Disconnect counter. */ -#define MII_FCSCOUNTER 0x13 /**< False carrier counter. */ -#define MII_NWAYTEST 0x14 /**< N-way auto-neg test reg. */ -#define MII_RERRCOUNTER 0x15 /**< Receive error counter. */ -#define MII_SREVISION 0x16 /**< Silicon revision. */ -#define MII_RESV1 0x17 /**< Reserved. */ -#define MII_LBRERROR 0x18 /**< Lpback, rx, bypass error. */ -#define MII_PHYADDR 0x19 /**< PHY address. */ -#define MII_RESV2 0x1a /**< Reserved. */ -#define MII_TPISTATUS 0x1b /**< TPI status for 10Mbps. */ -#define MII_NCONFIG 0x1c /**< Network interface config. */ -/** @} */ - -/** - * @name Basic mode control register - * @{ - */ -#define BMCR_RESV 0x007f /**< Unused. */ -#define BMCR_CTST 0x0080 /**< Collision test. */ -#define BMCR_FULLDPLX 0x0100 /**< Full duplex. */ -#define BMCR_ANRESTART 0x0200 /**< Auto negotiation restart. */ -#define BMCR_ISOLATE 0x0400 /**< Disconnect DP83840 from MII. */ -#define BMCR_PDOWN 0x0800 /**< Powerdown. */ -#define BMCR_ANENABLE 0x1000 /**< Enable auto negotiation. */ -#define BMCR_SPEED100 0x2000 /**< Select 100Mbps. */ -#define BMCR_LOOPBACK 0x4000 /**< TXD loopback bit. */ -#define BMCR_RESET 0x8000 /**< Reset. */ -/** @} */ - -/** - * @name Basic mode status register - * @{ - */ -#define BMSR_ERCAP 0x0001 /**< Ext-reg capability. */ -#define BMSR_JCD 0x0002 /**< Jabber detected. */ -#define BMSR_LSTATUS 0x0004 /**< Link status. */ -#define BMSR_ANEGCAPABLE 0x0008 /**< Able to do auto-negotiation. */ -#define BMSR_RFAULT 0x0010 /**< Remote fault detected. */ -#define BMSR_ANEGCOMPLETE 0x0020 /**< Auto-negotiation complete. */ -#define BMSR_MFPRESUPPCAP 0x0040 /**< Able to suppress preamble. */ -#define BMSR_RESV 0x0780 /**< Unused. */ -#define BMSR_10HALF 0x0800 /**< Can do 10mbps, half-duplex. */ -#define BMSR_10FULL 0x1000 /**< Can do 10mbps, full-duplex. */ -#define BMSR_100HALF 0x2000 /**< Can do 100mbps, half-duplex. */ -#define BMSR_100FULL 0x4000 /**< Can do 100mbps, full-duplex. */ -#define BMSR_100BASE4 0x8000 /**< Can do 100mbps, 4k packets. */ -/** @} */ - -/** - * @name Advertisement control register - * @{ - */ -#define ADVERTISE_SLCT 0x001f /**< Selector bits. */ -#define ADVERTISE_CSMA 0x0001 /**< Only selector supported. */ -#define ADVERTISE_10HALF 0x0020 /**< Try for 10mbps half-duplex. */ -#define ADVERTISE_10FULL 0x0040 /**< Try for 10mbps full-duplex. */ -#define ADVERTISE_100HALF 0x0080 /**< Try for 100mbps half-duplex. */ -#define ADVERTISE_100FULL 0x0100 /**< Try for 100mbps full-duplex. */ -#define ADVERTISE_100BASE4 0x0200 /**< Try for 100mbps 4k packets. */ -#define ADVERTISE_PAUSE_CAP 0x0400 /**< Try for pause. */ -#define ADVERTISE_PAUSE_ASYM 0x0800 /**< Try for asymetric pause. */ -#define ADVERTISE_RESV 0x1000 /**< Unused. */ -#define ADVERTISE_RFAULT 0x2000 /**< Say we can detect faults. */ -#define ADVERTISE_LPACK 0x4000 /**< Ack link partners response. */ -#define ADVERTISE_NPAGE 0x8000 /**< Next page bit. */ - -#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ - ADVERTISE_CSMA) -#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ - ADVERTISE_100HALF | ADVERTISE_100FULL) -/** @} */ - -/** - * @name Link partner ability register - * @{ - */ -#define LPA_SLCT 0x001f /**< Same as advertise selector. */ -#define LPA_10HALF 0x0020 /**< Can do 10mbps half-duplex. */ -#define LPA_10FULL 0x0040 /**< Can do 10mbps full-duplex. */ -#define LPA_100HALF 0x0080 /**< Can do 100mbps half-duplex. */ -#define LPA_100FULL 0x0100 /**< Can do 100mbps full-duplex. */ -#define LPA_100BASE4 0x0200 /**< Can do 100mbps 4k packets. */ -#define LPA_PAUSE_CAP 0x0400 /**< Can pause. */ -#define LPA_PAUSE_ASYM 0x0800 /**< Can pause asymetrically. */ -#define LPA_RESV 0x1000 /**< Unused. */ -#define LPA_RFAULT 0x2000 /**< Link partner faulted. */ -#define LPA_LPACK 0x4000 /**< Link partner acked us. */ -#define LPA_NPAGE 0x8000 /**< Next page bit. */ - -#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) -#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) -/** @} */ - -/** - * @name Expansion register for auto-negotiation - * @{ - */ -#define EXPANSION_NWAY 0x0001 /**< Can do N-way auto-nego. */ -#define EXPANSION_LCWP 0x0002 /**< Got new RX page code word. */ -#define EXPANSION_ENABLENPAGE 0x0004 /**< This enables npage words. */ -#define EXPANSION_NPCAPABLE 0x0008 /**< Link partner supports npage. */ -#define EXPANSION_MFAULTS 0x0010 /**< Multiple faults detected. */ -#define EXPANSION_RESV 0xffe0 /**< Unused. */ -/** @} */ - -/** - * @name N-way test register - * @{ - */ -#define NWAYTEST_RESV1 0x00ff /**< Unused. */ -#define NWAYTEST_LOOPBACK 0x0100 /**< Enable loopback for N-way. */ -#define NWAYTEST_RESV2 0xfe00 /**< Unused. */ -/** @} */ - -/** - * @name PHY identifiers - * @{ - */ -#define MII_DM9161_ID 0x0181b8a0 -#define MII_AM79C875_ID 0x00225540 -#define MII_KS8721_ID 0x00221610 -#define MII_STE101P_ID 0x00061C50 -#define MII_DP83848I_ID 0x20005C90 -#define MII_LAN8710A_ID 0x0007C0F1 -#define MII_LAN8720_ID 0x0007C0F0 -#define MII_LAN8742A_ID 0x0007C130 -/** @} */ - -#endif /* MII_H */ - -/** @} */ diff --git a/os/hal/include/usb_cdc.h b/os/hal/include/usb_cdc.h deleted file mode 100644 index 63c0bc5c0..000000000 --- a/os/hal/include/usb_cdc.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file usb_cdc.h - * @brief USB CDC macros and structures. - * - * @addtogroup USB_CDC - * @{ - */ - -#ifndef USB_CDC_H -#define USB_CDC_H - -/*===========================================================================*/ -/* Driver constants. */ -/*===========================================================================*/ - -/** - * @name CDC specific messages. - * @{ - */ -#define CDC_SEND_ENCAPSULATED_COMMAND 0x00U -#define CDC_GET_ENCAPSULATED_RESPONSE 0x01U -#define CDC_SET_COMM_FEATURE 0x02U -#define CDC_GET_COMM_FEATURE 0x03U -#define CDC_CLEAR_COMM_FEATURE 0x04U -#define CDC_SET_AUX_LINE_STATE 0x10U -#define CDC_SET_HOOK_STATE 0x11U -#define CDC_PULSE_SETUP 0x12U -#define CDC_SEND_PULSE 0x13U -#define CDC_SET_PULSE_TIME 0x14U -#define CDC_RING_AUX_JACK 0x15U -#define CDC_SET_LINE_CODING 0x20U -#define CDC_GET_LINE_CODING 0x21U -#define CDC_SET_CONTROL_LINE_STATE 0x22U -#define CDC_SEND_BREAK 0x23U -#define CDC_SET_RINGER_PARMS 0x30U -#define CDC_GET_RINGER_PARMS 0x31U -#define CDC_SET_OPERATION_PARMS 0x32U -#define CDC_GET_OPERATION_PARMS 0x33U -/** @} */ - -/** - * @name CDC classes - * @{ - */ -#define CDC_COMMUNICATION_INTERFACE_CLASS 0x02U -#define CDC_DATA_INTERFACE_CLASS 0x0AU -/** @} */ - -/** - * @name CDC subclasses - * @{ - */ -#define CDC_ABSTRACT_CONTROL_MODEL 0x02U -/** @} */ - -/** - * @name CDC descriptors - * @{ - */ -#define CDC_CS_INTERFACE 0x24U -/** @} */ - -/** - * @name CDC subdescriptors - * @{ - */ -#define CDC_HEADER 0x00U -#define CDC_CALL_MANAGEMENT 0x01U -#define CDC_ABSTRACT_CONTROL_MANAGEMENT 0x02U -#define CDC_UNION 0x06U -/** @} */ - -/** - * @name Line Control bit definitions. - * @{ - */ -#define LC_STOP_1 0U -#define LC_STOP_1P5 1U -#define LC_STOP_2 2U - -#define LC_PARITY_NONE 0U -#define LC_PARITY_ODD 1U -#define LC_PARITY_EVEN 2U -#define LC_PARITY_MARK 3U -#define LC_PARITY_SPACE 4U -/** @} */ - -/*===========================================================================*/ -/* Driver pre-compile time settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Derived constants and error checks. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver data structures and types. */ -/*===========================================================================*/ - -/** - * @brief Type of Line Coding structure. - */ -typedef struct { - uint8_t dwDTERate[4]; - uint8_t bCharFormat; - uint8_t bParityType; - uint8_t bDataBits; -} cdc_linecoding_t; - -/*===========================================================================*/ -/* Driver macros. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* External declarations. */ -/*===========================================================================*/ - -#endif /* USB_CDC_H */ - -/** @} */ diff --git a/os/hal/templates/hal_mac_lld.c b/os/hal/templates/hal_mac_lld.c index 83d15a9d7..45d8722f6 100644 --- a/os/hal/templates/hal_mac_lld.c +++ b/os/hal/templates/hal_mac_lld.c @@ -28,7 +28,7 @@ #if (HAL_USE_MAC == TRUE) || defined(__DOXYGEN__) -#include "mii.h" +#include "hal_mii.h" /*===========================================================================*/ /* Driver local definitions. */ diff --git a/os/hal/templates/platform.mk b/os/hal/templates/platform.mk index 19c7e6d42..a5fbb1065 100644 --- a/os/hal/templates/platform.mk +++ b/os/hal/templates/platform.mk @@ -1,20 +1,20 @@ # List of all the template platform files. PLATFORMSRC = ${CHIBIOS}/os/hal/templates/hal_lld.c \ - ${CHIBIOS}/os/hal/templates/adc_lld.c \ - ${CHIBIOS}/os/hal/templates/can_lld.c \ - ${CHIBIOS}/os/hal/templates/dac_lld.c \ - ${CHIBIOS}/os/hal/templates/ext_lld.c \ - ${CHIBIOS}/os/hal/templates/gpt_lld.c \ - ${CHIBIOS}/os/hal/templates/i2c_lld.c \ - ${CHIBIOS}/os/hal/templates/icu_lld.c \ - ${CHIBIOS}/os/hal/templates/mac_lld.c \ - ${CHIBIOS}/os/hal/templates/pal_lld.c \ - ${CHIBIOS}/os/hal/templates/pwm_lld.c \ - ${CHIBIOS}/os/hal/templates/sdc_lld.c \ - ${CHIBIOS}/os/hal/templates/serial_lld.c \ - ${CHIBIOS}/os/hal/templates/spi_lld.c \ - ${CHIBIOS}/os/hal/templates/uart_lld.c \ - ${CHIBIOS}/os/hal/templates/usb_lld.c + ${CHIBIOS}/os/hal/templates/hal_adc_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_can_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_dac_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_ext_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_gpt_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_i2c_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_icu_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_mac_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_pal_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_pwm_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_sdc_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_serial_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_spi_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_uart_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_usb_lld.c # Required include directories PLATFORMINC = ${CHIBIOS}/os/hal/templates -- cgit v1.2.3