Change terminal settings.

Change terminal settings for new GR-PEACH board(board update).
pull/991/head
Masao Hamanaka 2015-03-23 20:00:08 +09:00
parent aba45564fc
commit 85bc418da2
7 changed files with 35 additions and 63 deletions

View File

@ -68,6 +68,7 @@ typedef enum {
PWM10_PIN, PWM10_PIN,
PWM11_PIN, PWM11_PIN,
PWM12_PIN, PWM12_PIN,
PWM13_PIN,
} PWMName; } PWMName;
typedef enum { typedef enum {
@ -99,35 +100,6 @@ typedef enum {
#define STDIO_UART_RX USBRX #define STDIO_UART_RX USBRX
#define STDIO_UART UART2 #define STDIO_UART UART2
// Default peripherals
#define MBED_SPI0 p5, p6, p7, p8
#define MBED_SPI1 p11, p12, p13, p14
#define MBED_UART0 p9, p10
#define MBED_UART1 p13, p14
#define MBED_UART2 p28, p27
#define MBED_UARTUSB USBTX, USBRX
#define MBED_I2C0 p28, p27
#define MBED_I2C1 p9, p10
#define MBED_CAN0 p30, p29
#define MBED_ANALOGOUT0 p18
#define MBED_ANALOGIN0 p15
#define MBED_ANALOGIN1 p16
#define MBED_ANALOGIN2 p17
#define MBED_ANALOGIN3 p18
#define MBED_ANALOGIN4 p19
#define MBED_ANALOGIN5 p20
#define MBED_PWMOUT0 p26
#define MBED_PWMOUT1 p25
#define MBED_PWMOUT2 p24
#define MBED_PWMOUT3 p23
#define MBED_PWMOUT4 p22
#define MBED_PWMOUT5 p21
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -44,22 +44,11 @@ typedef enum {
P10_0,P10_1,P10_2,P10_3,P10_4,P10_5,P10_6,P10_7,P10_8,P10_9,P10_10,P10_11,P10_12,P10_13,P10_14,P10_15, P10_0,P10_1,P10_2,P10_3,P10_4,P10_5,P10_6,P10_7,P10_8,P10_9,P10_10,P10_11,P10_12,P10_13,P10_14,P10_15,
P11_0,P11_1,P11_2,P11_3,P11_4,P11_5,P11_6,P11_7,P11_8,P11_9,P11_10,P11_11,P11_12,P11_13,P11_14,P11_15, P11_0,P11_1,P11_2,P11_3,P11_4,P11_5,P11_6,P11_7,P11_8,P11_9,P11_10,P11_11,P11_12,P11_13,P11_14,P11_15,
// mbed DIP Pin Names // mbed Pin Names
p10 = P0_1, LED1 = P6_13,
p21 = P2_5, LED2 = P6_14,
p22 = P2_4, LED3 = P6_15,
p23 = P2_3, LED4 = P6_12,
p24 = P2_2,
p25 = P2_1,
p26 = P2_0,
p29 = P0_5,
p30 = P0_4,
// Other mbed Pin Names
LED1 = P4_4,
LED2 = P3_2,
LED3 = P4_6,
LED4 = P4_7,
LED_RED = LED1, LED_RED = LED1,
LED_GREEN= LED2, LED_GREEN= LED2,
@ -72,12 +61,12 @@ typedef enum {
// Arduiono Pin Names // Arduiono Pin Names
D0 = P2_15, D0 = P2_15,
D1 = P2_14, D1 = P2_14,
D2 = P11_15, D2 = P4_7,
D3 = P11_14, D3 = P4_6,
D4 = P11_13, D4 = P4_5,
D5 = P11_12, D5 = P4_4,
D6 = P8_11, D6 = P8_13,
D7 = P8_13, D7 = P8_11,
D8 = P8_15, D8 = P8_15,
D9 = P8_14, D9 = P8_14,
D10 = P10_13, D10 = P10_13,
@ -98,7 +87,6 @@ typedef enum {
I2C_SDA = D14, I2C_SDA = D14,
USER_BUTTON0 = P6_0, USER_BUTTON0 = P6_0,
USER_BUTTON1 = P6_1,
// Not connected // Not connected
NC = (int)0xFFFFFFFF NC = (int)0xFFFFFFFF

View File

@ -33,21 +33,25 @@ void gpio_init(gpio_t *obj, PinName pin) {
group = PINGROUP(pin); group = PINGROUP(pin);
if (group > 11) return; if (group > 11) return;
obj->reg_set = (volatile uint32_t *)PORT(group); obj->reg_set = (volatile uint32_t *) PSR(group);
obj->reg_in = (volatile uint32_t *) PPR(group); obj->reg_in = (volatile uint32_t *) PPR(group);
obj->reg_dir = (volatile uint32_t *) PM(group); obj->reg_dir = (volatile uint32_t *)PMSR(group);
obj->reg_buf = (volatile uint32_t *)PIBC(group); obj->reg_buf = (volatile uint32_t *)PIBC(group);
} }
void gpio_mode(gpio_t *obj, PinMode mode) { void gpio_mode(gpio_t *obj, PinMode mode) {
// pullup, pulldown, open...etc /* Pull up and Pull down settings aren't supported because RZ/A1H doesn't have pull up/down for pins(signals). */
} }
void gpio_dir(gpio_t *obj, PinDirection direction) { void gpio_dir(gpio_t *obj, PinDirection direction) {
switch (direction) { switch (direction) {
case PIN_INPUT : *obj->reg_dir |= obj->mask; case PIN_INPUT :
*obj->reg_buf |= obj->mask; break; *obj->reg_dir = (obj->mask << 16) | obj->mask;
case PIN_OUTPUT: *obj->reg_dir &= ~obj->mask; *obj->reg_buf |= obj->mask;
*obj->reg_buf &= ~obj->mask; break; break;
case PIN_OUTPUT:
*obj->reg_dir = (obj->mask << 16) | 0;
*obj->reg_buf &= ~obj->mask;
break;
} }
} }

View File

@ -33,10 +33,7 @@ typedef struct {
} gpio_t; } gpio_t;
static inline void gpio_write(gpio_t *obj, int value) { static inline void gpio_write(gpio_t *obj, int value) {
if (value) *obj->reg_set = (obj->mask << 16) | ((value != 0) ? obj->mask : 0);
*obj->reg_set |= obj->mask;
else
*obj->reg_set &= ~obj->mask;
} }
static inline int gpio_read(gpio_t *obj) { static inline int gpio_read(gpio_t *obj) {

View File

@ -36,6 +36,7 @@ static const PinMap PinMap_PWM[] = {
{P8_12 , PWM10_PIN, 6}, {P8_12 , PWM10_PIN, 6},
{P8_9 , PWM11_PIN, 6}, {P8_9 , PWM11_PIN, 6},
{P8_10 , PWM12_PIN, 6}, {P8_10 , PWM12_PIN, 6},
{P4_5 , PWM13_PIN, 4},
{NC, NC, 0} {NC, NC, 0}
}; };
@ -53,6 +54,7 @@ static PWMType PORT[] = {
PWM1E, // PWM10_PIN PWM1E, // PWM10_PIN
PWM1B, // PWM11_PIN PWM1B, // PWM11_PIN
PWM1C, // PWM12_PIN PWM1C, // PWM12_PIN
PWM2F, // PWM13_PIN
}; };
static __IO uint16_t *PWM_MATCH[] = { static __IO uint16_t *PWM_MATCH[] = {
@ -69,6 +71,7 @@ static __IO uint16_t *PWM_MATCH[] = {
&PWMPWBFR_1E, // PWM10_PIN &PWMPWBFR_1E, // PWM10_PIN
&PWMPWBFR_1A, // PWM11_PIN &PWMPWBFR_1A, // PWM11_PIN
&PWMPWBFR_1C, // PWM12_PIN &PWMPWBFR_1C, // PWM12_PIN
&PWMPWBFR_2E, // PWM13_PIN
}; };
static uint16_t init_period_ch1 = 0; static uint16_t init_period_ch1 = 0;

View File

@ -56,7 +56,9 @@ static void uart7_rx_irq(void);
static const PinMap PinMap_UART_TX[] = { static const PinMap PinMap_UART_TX[] = {
{P2_14 , UART0, 6}, {P2_14 , UART0, 6},
{P2_5 , UART1, 6}, {P2_5 , UART1, 6},
{P4_12 , UART1, 7},
{P6_3 , UART2, 7}, {P6_3 , UART2, 7},
{P4_14 , UART2, 7},
{P5_3 , UART3, 5}, {P5_3 , UART3, 5},
{P8_8 , UART3, 7}, {P8_8 , UART3, 7},
{P5_0 , UART4, 5}, {P5_0 , UART4, 5},
@ -73,7 +75,9 @@ static const PinMap PinMap_UART_TX[] = {
static const PinMap PinMap_UART_RX[] = { static const PinMap PinMap_UART_RX[] = {
{P2_15 , UART0, 6}, {P2_15 , UART0, 6},
{P2_6 , UART1, 6}, {P2_6 , UART1, 6},
{P4_13 , UART1, 7},
{P6_2 , UART2, 7}, {P6_2 , UART2, 7},
{P4_15 , UART2, 7},
{P5_4 , UART3, 5}, {P5_4 , UART3, 5},
{P8_9 , UART3, 7}, {P8_9 , UART3, 7},
{P5_1 , UART4, 5}, {P5_1 , UART4, 5},

View File

@ -24,6 +24,7 @@
static const PinMap PinMap_SPI_SCLK[] = { static const PinMap PinMap_SPI_SCLK[] = {
{P10_12, SPI_0, 4}, {P10_12, SPI_0, 4},
{P4_4 , SPI_1, 2},
{P11_12, SPI_1, 2}, {P11_12, SPI_1, 2},
{P8_3 , SPI_2, 3}, {P8_3 , SPI_2, 3},
{NC , NC , 0} {NC , NC , 0}
@ -31,6 +32,7 @@ static const PinMap PinMap_SPI_SCLK[] = {
static const PinMap PinMap_SPI_SSEL[] = { static const PinMap PinMap_SPI_SSEL[] = {
{P10_13, SPI_0, 4}, {P10_13, SPI_0, 4},
{P4_5 , SPI_1, 2},
{P11_13, SPI_1, 2}, {P11_13, SPI_1, 2},
{P8_4 , SPI_2, 3}, {P8_4 , SPI_2, 3},
{NC , NC , 0} {NC , NC , 0}
@ -38,6 +40,7 @@ static const PinMap PinMap_SPI_SSEL[] = {
static const PinMap PinMap_SPI_MOSI[] = { static const PinMap PinMap_SPI_MOSI[] = {
{P10_14, SPI_0, 4}, {P10_14, SPI_0, 4},
{P4_6 , SPI_1, 2},
{P11_14, SPI_1, 2}, {P11_14, SPI_1, 2},
{P8_5 , SPI_2, 3}, {P8_5 , SPI_2, 3},
{NC , NC , 0} {NC , NC , 0}
@ -45,6 +48,7 @@ static const PinMap PinMap_SPI_MOSI[] = {
static const PinMap PinMap_SPI_MISO[] = { static const PinMap PinMap_SPI_MISO[] = {
{P10_15, SPI_0, 4}, {P10_15, SPI_0, 4},
{P4_7 , SPI_1, 2},
{P11_15, SPI_1, 2}, {P11_15, SPI_1, 2},
{P8_6 , SPI_2, 3}, {P8_6 , SPI_2, 3},
{NC , NC , 0} {NC , NC , 0}