port to chopstx

This commit is contained in:
NIIBE Yutaka
2013-06-20 16:19:49 +09:00
parent 7c01cae4a5
commit ee7d72743e
30 changed files with 1349 additions and 759 deletions

View File

@@ -1,9 +1,9 @@
#ifdef FREE_STANDING
#include "types.h"
#else
#include "ch.h"
#include "hal.h"
#endif
#include <stdint.h>
#include <stdlib.h>
#define TRUE 1
#define FALSE 0
#include "sys.h"
#include "usb_lld.h"
@@ -83,15 +83,15 @@ static struct DATA_INFO *const data_p = &data_info;
#define PMA_ADDR (0x40006000UL) /* USB_IP Packet Memory Area base address */
/* Control register */
#define CNTR ((__IO uint16_t *)(REG_BASE + 0x40))
#define CNTR ((volatile uint16_t *)(REG_BASE + 0x40))
/* Interrupt status register */
#define ISTR ((__IO uint16_t *)(REG_BASE + 0x44))
#define ISTR ((volatile uint16_t *)(REG_BASE + 0x44))
/* Frame number register */
#define FNR ((__IO uint16_t *)(REG_BASE + 0x48))
#define FNR ((volatile uint16_t *)(REG_BASE + 0x48))
/* Device address register */
#define DADDR ((__IO uint16_t *)(REG_BASE + 0x4C))
#define DADDR ((volatile uint16_t *)(REG_BASE + 0x4C))
/* Buffer Table address register */
#define BTABLE ((__IO uint16_t *)(REG_BASE + 0x50))
#define BTABLE ((volatile uint16_t *)(REG_BASE + 0x50))
#define ISTR_CTR (0x8000) /* Correct TRansfer (clear-only bit) */
#define ISTR_DOVR (0x4000) /* DMA OVeR/underrun (clear-only bit) */