?login_element?

Subversion Repositories NedoOS

Rev

Rev 8 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /**
  2.   ******************************************************************************
  3.   * @file    opora_usb_defs.h
  4.   * @author  Phyton Application Team
  5.   * @version V1.0.0
  6.   * @date
  7.   * @brief   This file contains all the Special Function Registers definitions
  8.   *          for the USB peripheral unit used in the Milandr OPORA
  9.   *          microcontrollers.
  10.   ******************************************************************************
  11.   * @copy
  12.   *
  13.   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  14.   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  15.   * TIME. AS A RESULT, PHYTON SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
  16.   * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  17.   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  18.   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  19.   *
  20.   * <h2><center>&copy; COPYRIGHT 2010 Phyton</center></h2>
  21.   ******************************************************************************
  22.   * FILE opora_usb_defs.h
  23.   */
  24.  
  25. /* Define to prevent recursive inclusion -------------------------------------*/
  26. #ifndef __OPORA_USB_DEFS_H
  27. #define __OPORA_USB_DEFS_H
  28.  
  29. /** @addtogroup __CMSIS CMSIS
  30.   * @{
  31.   */
  32.  
  33. /** @addtogroup __OPORA_Peripheral_Units OPORA Peripheral Units
  34.   * @{
  35.   */
  36.  
  37. /** @defgroup Periph_USB USB
  38.   * @{
  39.   */
  40.  
  41. /**
  42.   * @brief USB_SEP_TypeDef ??? structure
  43.   */
  44.  
  45. typedef struct {
  46.   __IO uint32_t CTRL;
  47.   __IO uint32_t STS;
  48.   __IO uint32_t TS;
  49.   __IO uint32_t NTS;
  50. } _USB_SEP_TypeDef;
  51.  
  52. /**
  53.   * @brief USB_SEP_TypeDef0 ??? structure
  54.   */
  55.  
  56. typedef struct {
  57.   __IO uint32_t RXFD;
  58.        uint32_t RESERVED0;
  59.   __IO uint32_t RXFDC_L;
  60.   __IO uint32_t RXFDC_H;
  61.   __IO uint32_t RXFC;
  62.        uint32_t RESERVED1[11];
  63.   __IO uint32_t TXFD;
  64.        uint32_t RESERVED2[3];
  65.   __IO uint32_t TXFDC;
  66. } _USB_SEP_TypeDef0;
  67.  
  68. /** @defgroup Periph_USB_Data_Structures Data Structures
  69.   * @{
  70.   */
  71.  
  72. /** @defgroup Periph_USB_TypeDef USB_TypeDef
  73.   * @{
  74.   */
  75.  
  76. typedef struct {
  77.   __IO uint32_t HTXC;
  78.   __IO uint32_t HTXT;
  79.   __IO uint32_t HTXLC;
  80.   __IO uint32_t HTXSE;
  81.   __IO uint32_t HTXA;
  82.   __IO uint32_t HTXE;
  83.   __IO uint32_t HFN_L;
  84.   __IO uint32_t HFN_H;
  85.   __IO uint32_t HIS;
  86.   __IO uint32_t HIM;
  87.   __IO uint32_t HRXS;
  88.   __IO uint32_t HRXP;
  89.   __IO uint32_t HRXA;
  90.   __IO uint32_t HRXE;
  91.   __IO uint32_t HRXCS;
  92.   __IO uint32_t HSTM;
  93.        uint32_t RESERVED0[16];
  94.   __IO uint32_t HRXFD;
  95.        uint32_t RESERVED1;
  96.   __IO uint32_t HRXFDC_L;
  97.   __IO uint32_t HRXFDC_H;
  98.   __IO uint32_t HRXFC;
  99.        uint32_t RESERVED2[11];
  100.   __IO uint32_t HTXFD;
  101.        uint32_t RESERVED3[3];
  102.   __IO uint32_t HTXFDC;
  103.        uint32_t RESERVED4[11];
  104.   __IO uint32_t SEP0_CTRL;
  105.   __IO uint32_t SEP0_STS;
  106.   __IO uint32_t SEP0_TS;
  107.   __IO uint32_t SEP0_NTS;
  108.   __IO uint32_t SEP1_CTRL;
  109.   __IO uint32_t SEP1_STS;
  110.   __IO uint32_t SEP1_TS;
  111.   __IO uint32_t SEP1_NTS;
  112.   __IO uint32_t SEP2_CTRL;
  113.   __IO uint32_t SEP2_STS;
  114.   __IO uint32_t SEP2_TS;
  115.   __IO uint32_t SEP2_NTS;
  116.   __IO uint32_t SEP3_CTRL;
  117.   __IO uint32_t SEP3_STS;
  118.   __IO uint32_t SEP3_TS;
  119.   __IO uint32_t SEP3_NTS;
  120.   __IO uint32_t SC;
  121.   __IO uint32_t SLS;
  122.   __IO uint32_t SIS;
  123.   __IO uint32_t SIM;
  124.   __IO uint32_t SA;
  125.   __IO uint32_t SFN_L;
  126.   __IO uint32_t SFN_H;
  127.        uint32_t RESERVED5[9];
  128.   __IO uint32_t SEP0_RXFD;
  129.        uint32_t RESERVED6;
  130.   __IO uint32_t SEP0_RXFDC_L;
  131.   __IO uint32_t SEP0_RXFDC_H;
  132.   __IO uint32_t SEP0_RXFC;
  133.        uint32_t RESERVED7[11];
  134.   __IO uint32_t SEP0_TXFD;
  135.        uint32_t RESERVED8[3];
  136.   __IO uint32_t SEP0_TXFDC;
  137.        uint32_t RESERVED9[11];
  138.   __IO uint32_t SEP1_RXFD;
  139.        uint32_t RESERVED10;
  140.   __IO uint32_t SEP1_RXFDC_L;
  141.   __IO uint32_t SEP1_RXFDC_H;
  142.   __IO uint32_t SEP1_RXFC;
  143.        uint32_t RESERVED11[11];
  144.   __IO uint32_t SEP1_TXFD;
  145.        uint32_t RESERVED12[3];
  146.   __IO uint32_t SEP1_TXFDC;
  147.        uint32_t RESERVED13[11];
  148.   __IO uint32_t SEP2_RXFD;
  149.        uint32_t RESERVED14;
  150.   __IO uint32_t SEP2_RXFDC_L;
  151.   __IO uint32_t SEP2_RXFDC_H;
  152.   __IO uint32_t SEP2_RXFC;
  153.        uint32_t RESERVED15[11];
  154.   __IO uint32_t SEP2_TXFD;
  155.        uint32_t RESERVED16[3];
  156.   __IO uint32_t SEP2_TXFDC;
  157.        uint32_t RESERVED17[11];
  158.   __IO uint32_t SEP3_RXFD;
  159.        uint32_t RESERVED18;
  160.   __IO uint32_t SEP3_RXFDC_L;
  161.   __IO uint32_t SEP3_RXFDC_H;
  162.   __IO uint32_t SEP3_RXFC;
  163.        uint32_t RESERVED19[11];
  164.   __IO uint32_t SEP3_TXFD;
  165.        uint32_t RESERVED20[3];
  166.   __IO uint32_t SEP3_TXFDC;
  167.        uint32_t RESERVED21[11];
  168.   __IO uint32_t HSCR;
  169.   __IO uint32_t HSVR;
  170. } USB_TypeDef;
  171.  
  172. /** @} */ /* End of group Periph_USB_TypeDef */
  173.  
  174. /** @} */ /* End of group Periph_USB_Data_Structures */
  175.  
  176. /** @defgroup Periph_USB_Defines Defines
  177.   * @{
  178.   */
  179.  
  180. /** @defgroup Periph_USB_USB_HTXC_Bits USB_HTXC
  181.   * @{
  182.   */
  183.  
  184. #define USB_HTXC_TREQ_OFFS                      0
  185. #define USB_HTXC_TREQ                           ((uint32_t)0x00000001)
  186.  
  187. #define USB_HTXC_SOFS_OFFS                      1
  188. #define USB_HTXC_SOFS                           ((uint32_t)0x00000002)
  189.  
  190. #define USB_HTXC_PREEN_OFFS                     2
  191. #define USB_HTXC_PREEN                          ((uint32_t)0x00000004)
  192.  
  193. #define USB_HTXC_ISOEN_OFFS                     3
  194. #define USB_HTXC_ISOEN                          ((uint32_t)0x00000008)
  195.  
  196.  
  197. /** @} */ /* End of group Periph_USB_USB_HTXC_Bits */
  198.  
  199. /** @} */ /* End of group Periph_USB_Defines */
  200.  
  201. /** @defgroup Periph_USB_Defines Defines
  202.   * @{
  203.   */
  204.  
  205. /** @defgroup Periph_USB_USB_HTXLC_Bits USB_HTXLC
  206.   * @{
  207.   */
  208.  
  209. #define USB_HTXLC_OFFS                          0
  210. #define USB_HTXLC_MASK                          ((uint32_t)0x00000003)
  211.  
  212. #define USB_HTXLC_DC_OFFS                       2
  213. #define USB_HTXLC_DC                            ((uint32_t)0x00000004)
  214.  
  215. #define USB_HTXLC_FSPL_OFFS                     3
  216. #define USB_HTXLC_FSPL                          ((uint32_t)0x00000008)
  217.  
  218. #define USB_HTXLC_FSLR_OFFS                     4
  219. #define USB_HTXLC_FSLR                          ((uint32_t)0x00000010)
  220.  
  221.  
  222. /** @} */ /* End of group Periph_USB_USB_HTXLC_Bits */
  223.  
  224. /** @} */ /* End of group Periph_USB_Defines */
  225.  
  226. /** @defgroup Periph_USB_Defines Defines
  227.   * @{
  228.   */
  229.  
  230. /** @defgroup Periph_USB_USB_HIS_Bits USB_HIS
  231.   * @{
  232.   */
  233.  
  234. #define USB_HIS_TDONE_OFFS                      0
  235. #define USB_HIS_TDONE                           ((uint32_t)0x00000001)
  236.  
  237. #define USB_HIS_RESUME_OFFS                     1
  238. #define USB_HIS_RESUME                          ((uint32_t)0x00000002)
  239.  
  240. #define USB_HIS_CONEV_OFFS                      2
  241. #define USB_HIS_CONEV                           ((uint32_t)0x00000004)
  242.  
  243. #define USB_HIS_SOFS_OFFS                       3
  244. #define USB_HIS_SOFS                            ((uint32_t)0x00000008)
  245.  
  246.  
  247. /** @} */ /* End of group Periph_USB_USB_HIS_Bits */
  248.  
  249. /** @} */ /* End of group Periph_USB_Defines */
  250.  
  251. /** @defgroup Periph_USB_Defines Defines
  252.   * @{
  253.   */
  254.  
  255. /** @defgroup Periph_USB_USB_HIM_Bits USB_HIM
  256.   * @{
  257.   */
  258.  
  259. #define USB_HIM_TDONEIE_OFFS                    0
  260. #define USB_HIM_TDONEIE                         ((uint32_t)0x00000001)
  261.  
  262. #define USB_HIM_RESUMEIE_OFFS                   1
  263. #define USB_HIM_RESUMEIE                        ((uint32_t)0x00000002)
  264.  
  265. #define USB_HIM_CONEVIE_OFFS                    2
  266. #define USB_HIM_CONEVIE                         ((uint32_t)0x00000004)
  267.  
  268. #define USB_HIM_SOFIE_OFFS                      3
  269. #define USB_HIM_SOFIE                           ((uint32_t)0x00000008)
  270.  
  271.  
  272. /** @} */ /* End of group Periph_USB_USB_HIM_Bits */
  273.  
  274. /** @} */ /* End of group Periph_USB_Defines */
  275.  
  276. /** @defgroup Periph_USB_Defines Defines
  277.   * @{
  278.   */
  279.  
  280. /** @defgroup Periph_USB_USB_HRXS_Bits USB_HRXS
  281.   * @{
  282.   */
  283.  
  284. #define USB_HRXS_CRCERR_OFFS                    0
  285. #define USB_HRXS_CRCERR                         ((uint32_t)0x00000001)
  286.  
  287. #define USB_HRXS_BSERR_OFFS                     1
  288. #define USB_HRXS_BSERR                          ((uint32_t)0x00000002)
  289.  
  290. #define USB_HRXS_RXOF_OFFS                      2
  291. #define USB_HRXS_RXOF                           ((uint32_t)0x00000004)
  292.  
  293. #define USB_HRXS_RXTO_OFFS                      3
  294. #define USB_HRXS_RXTO                           ((uint32_t)0x00000008)
  295.  
  296. #define USB_HRXS_NAKRXED_OFFS                   4
  297. #define USB_HRXS_NAKRXED                        ((uint32_t)0x00000010)
  298.  
  299. #define USB_HRXS_STALLRXED_OFFS                 5
  300. #define USB_HRXS_STALLRXED                      ((uint32_t)0x00000020)
  301.  
  302. #define USB_HRXS_ACKRXED_OFFS                   6
  303. #define USB_HRXS_ACKRXED                        ((uint32_t)0x00000040)
  304.  
  305. #define USB_HRXS_DATASEQ_OFFS                   7
  306. #define USB_HRXS_DATASEQ                        ((uint32_t)0x00000080)
  307.  
  308.  
  309. /** @} */ /* End of group Periph_USB_USB_HRXS_Bits */
  310.  
  311. /** @} */ /* End of group Periph_USB_Defines */
  312.  
  313. /** @defgroup Periph_USB_Defines Defines
  314.   * @{
  315.   */
  316.  
  317. /** @defgroup Periph_USB_USB_SEP_CTRL_Bits USB_SEP_CTRL
  318.   * @{
  319.   */
  320.  
  321. #define USB_SEP_CTRL_EPEN_OFFS                  0
  322. #define USB_SEP_CTRL_EPEN                       ((uint32_t)0x00000001)
  323.  
  324. #define USB_SEP_CTRL_EPRDY_OFFS                 1
  325. #define USB_SEP_CTRL_EPRDY                      ((uint32_t)0x00000002)
  326.  
  327. #define USB_SEP_CTRL_EPDATASEQ_OFFS             2
  328. #define USB_SEP_CTRL_EPDATASEQ                  ((uint32_t)0x00000004)
  329.  
  330. #define USB_SEP_CTRL_EPSSTALL_OFFS              3
  331. #define USB_SEP_CTRL_EPSSTALL                   ((uint32_t)0x00000008)
  332.  
  333. #define USB_SEP_CTRL_EPISOEN_OFFS               4
  334. #define USB_SEP_CTRL_EPISOEN                    ((uint32_t)0x00000010)
  335.  
  336.  
  337. /** @} */ /* End of group Periph_USB_USB_SEP_CTRL_Bits */
  338.  
  339. /** @} */ /* End of group Periph_USB_Defines */
  340.  
  341. /** @defgroup Periph_USB_Defines Defines
  342.   * @{
  343.   */
  344.  
  345. /** @defgroup Periph_USB_USB_SEP_STS_Bits USB_SEP_STS
  346.   * @{
  347.   */
  348.  
  349. #define USB_SEP_STS_SCCRCERR_OFFS               0
  350. #define USB_SEP_STS_SCCRCERR                    ((uint32_t)0x00000001)
  351.  
  352. #define USB_SEP_STS_SCBSERR_OFFS                1
  353. #define USB_SEP_STS_SCBSERR                     ((uint32_t)0x00000002)
  354.  
  355. #define USB_SEP_STS_SCRXOF_OFFS                 2
  356. #define USB_SEP_STS_SCRXOF                      ((uint32_t)0x00000004)
  357.  
  358. #define USB_SEP_STS_SCRXTO_OFFS                 3
  359. #define USB_SEP_STS_SCRXTO                      ((uint32_t)0x00000008)
  360.  
  361. #define USB_SEP_STS_SCNAKSENT_OFFS              4
  362. #define USB_SEP_STS_SCNAKSENT                   ((uint32_t)0x00000010)
  363.  
  364. #define USB_SEP_STS_SCSTALLSENT_OFFS            5
  365. #define USB_SEP_STS_SCSTALLSENT                 ((uint32_t)0x00000020)
  366.  
  367. #define USB_SEP_STS_SCACKRXED_OFFS              6
  368. #define USB_SEP_STS_SCACKRXED                   ((uint32_t)0x00000040)
  369.  
  370. #define USB_SEP_STS_SCDATASEQ_OFFS              7
  371. #define USB_SEP_STS_SCDATASEQ                   ((uint32_t)0x00000080)
  372.  
  373.  
  374. /** @} */ /* End of group Periph_USB_USB_SEP_STS_Bits */
  375.  
  376. /** @} */ /* End of group Periph_USB_Defines */
  377.  
  378. /** @defgroup Periph_USB_Defines Defines
  379.   * @{
  380.   */
  381.  
  382. /** @defgroup Periph_USB_USB_SC_Bits USB_SC
  383.   * @{
  384.   */
  385.  
  386. #define USB_SC_SCGEN_OFFS                       0
  387. #define USB_SC_SCGEN                            ((uint32_t)0x00000001)
  388.  
  389. #define USB_SC_SCTXLS_OFFS                      1
  390. #define USB_SC_SCTXLS_MASK                      ((uint32_t)0x00000006)
  391.  
  392. #define USB_SC_SCDC_OFFS                        3
  393. #define USB_SC_SCDC                             ((uint32_t)0x00000008)
  394.  
  395. #define USB_SC_SCFSP_OFFS                       4
  396. #define USB_SC_SCFSP                            ((uint32_t)0x00000010)
  397.  
  398. #define USB_SC_SCFSR_OFFS                       5
  399. #define USB_SC_SCFSR                            ((uint32_t)0x00000020)
  400.  
  401.  
  402. /** @} */ /* End of group Periph_USB_USB_SC_Bits */
  403.  
  404. /** @} */ /* End of group Periph_USB_Defines */
  405.  
  406. /** @defgroup Periph_USB_Defines Defines
  407.   * @{
  408.   */
  409.  
  410. /** @defgroup Periph_USB_USB_SIS_Bits USB_SIS
  411.   * @{
  412.   */
  413.  
  414. #define USB_SIS_SCTDONE_OFFS                    0
  415. #define USB_SIS_SCTDONE                         ((uint32_t)0x00000001)
  416.  
  417. #define USB_SIS_SCRESUME_OFFS                   1
  418. #define USB_SIS_SCRESUME                        ((uint32_t)0x00000002)
  419.  
  420. #define USB_SIS_SCRESETEV_OFFS                  2
  421. #define USB_SIS_SCRESETEV                       ((uint32_t)0x00000004)
  422.  
  423. #define USB_SIS_SCSOFREC_OFFS                   3
  424. #define USB_SIS_SCSOFREC                        ((uint32_t)0x00000008)
  425.  
  426. #define USB_SIS_SCNAKSENT_OFFS                  4
  427. #define USB_SIS_SCNAKSENT                       ((uint32_t)0x00000010)
  428.  
  429.  
  430. /** @} */ /* End of group Periph_USB_USB_SIS_Bits */
  431.  
  432. /** @} */ /* End of group Periph_USB_Defines */
  433.  
  434. /** @defgroup Periph_USB_Defines Defines
  435.   * @{
  436.   */
  437.  
  438. /** @defgroup Periph_USB_USB_SIM_Bits USB_SIM
  439.   * @{
  440.   */
  441.  
  442. #define USB_SIM_SCTDONEIE_OFFS                  0
  443. #define USB_SIM_SCTDONEIE                       ((uint32_t)0x00000001)
  444.  
  445. #define USB_SIM_SCRESUMEIE_OFFS                 1
  446. #define USB_SIM_SCRESUMEIE                      ((uint32_t)0x00000002)
  447.  
  448. #define USB_SIM_SCRESETEVIE_OFFS                2
  449. #define USB_SIM_SCRESETEVIE                     ((uint32_t)0x00000004)
  450.  
  451. #define USB_SIM_SCSOFRECIE_OFFS                 3
  452. #define USB_SIM_SCSOFRECIE                      ((uint32_t)0x00000008)
  453.  
  454. #define USB_SIM_SCNAKSENTIE_OFFS                4
  455. #define USB_SIM_SCNAKSENTIE                     ((uint32_t)0x00000010)
  456.  
  457.  
  458. /** @} */ /* End of group Periph_USB_USB_SIM_Bits */
  459.  
  460. /** @} */ /* End of group Periph_USB_Defines */
  461.  
  462. /** @defgroup Periph_USB_Defines Defines
  463.   * @{
  464.   */
  465.  
  466. /** @defgroup Periph_USB_USB_HSCR_Bits USB_HSCR
  467.   * @{
  468.   */
  469.  
  470. #define USB_HSCR_HOST_MODE_OFFS                 0
  471. #define USB_HSCR_HOST_MODE                      ((uint32_t)0x00000001)
  472.  
  473. #define USB_HSCR_RESET_CORE_OFFS                1
  474. #define USB_HSCR_RESET_CORE                     ((uint32_t)0x00000002)
  475.  
  476. #define USB_HSCR_EN_TX_OFFS                     2
  477. #define USB_HSCR_EN_TX                          ((uint32_t)0x00000004)
  478.  
  479. #define USB_HSCR_EN_RX_OFFS                     3
  480. #define USB_HSCR_EN_RX                          ((uint32_t)0x00000008)
  481.  
  482. #define USB_HSCR_DP_PULLUP_OFFS                 4
  483. #define USB_HSCR_DP_PULLUP                      ((uint32_t)0x00000010)
  484.  
  485. #define USB_HSCR_DP_PULLDOWN_OFFS               5
  486. #define USB_HSCR_DP_PULLDOWN                    ((uint32_t)0x00000020)
  487.  
  488. #define USB_HSCR_DM_PULLUP_OFFS                 6
  489. #define USB_HSCR_DM_PULLUP                      ((uint32_t)0x00000040)
  490.  
  491. #define USB_HSCR_DM_PULLDOWN_OFFS               7
  492. #define USB_HSCR_DM_PULLDOWN                    ((uint32_t)0x00000080)
  493.  
  494.  
  495. /** @} */ /* End of group Periph_USB_USB_HSCR_Bits */
  496.  
  497. /** @} */ /* End of group Periph_USB_Defines */
  498.  
  499. /** @defgroup Periph_USB_Defines Defines
  500.   * @{
  501.   */
  502.  
  503. /** @defgroup Periph_USB_USB_HSVR_Bits USB_HSVR
  504.   * @{
  505.   */
  506.  
  507. #define USB_HSVR_VERSION_OFFS                   0
  508. #define USB_HSVR_VERSION_MASK                   ((uint32_t)0x0000000F)
  509.  
  510. #define USB_HSVR_REVISION_OFFS                  4
  511. #define USB_HSVR_REVISION_MASK                  ((uint32_t)0x000000F0)
  512.  
  513.  
  514. /** @} */ /* End of group Periph_USB_USB_HSVR_Bits */
  515.  
  516. /** @} */ /* End of group Periph_USB_Defines */
  517.  
  518. /** @} */ /* End of group Periph_USB */
  519.  
  520. /** @} */ /* End of group __OPORA_Peripheral_Units */
  521.  
  522. /** @} */ /* End of group __CMSIS */
  523.  
  524. #endif /* __OPORA_USB_DEFS_H */
  525.  
  526. /******************* (C) COPYRIGHT 2010 Phyton *********************************
  527. *
  528. * END OF FILE opora_usb_defs.h */
  529.