-
Notifications
You must be signed in to change notification settings - Fork 3k
Add target RTL8710AF #7965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add target RTL8710AF #7965
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,9 @@ | |
extern "C" { | ||
#endif | ||
|
||
#if CONFIG_ADC_EN | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also a fix, should not be part of "adding a new target commit" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I'm going to make a new commit |
||
extern void analogin_deinit(analogin_t *obj); | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* mbed Microcontroller Library | ||
* Copyright (c) 2006-2013 ARM Limited | ||
* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new files should contain SPDX identifier (look at platform files for instance how to) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I understand. I'm going to update. |
||
* 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. | ||
*/ | ||
#ifndef MBED_PERIPHERALNAMES_H | ||
#define MBED_PERIPHERALNAMES_H | ||
|
||
#include "cmsis.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define UART_3 3 | ||
#define STDIO_UART_TX PB_0 | ||
#define STDIO_UART_RX PB_1 | ||
#define STDIO_UART UART_3 | ||
|
||
|
||
typedef enum { | ||
DAC_0 = 0, | ||
DAC_1 | ||
} DACName; | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* mbed Microcontroller Library | ||
* Copyright (c) 2006-2013 ARM Limited | ||
* | ||
* 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. | ||
*/ | ||
|
||
#include "PeripheralPins.h" | ||
|
||
// for spi_api.c | ||
const PinMap PinMap_SSI_MOSI[] = { | ||
{PC_2, RTL_PIN_PERI(SPI0, 0, S1), RTL_PIN_FUNC(SPI0, S1)}, | ||
{NC, NC, 0} | ||
}; | ||
|
||
const PinMap PinMap_SSI_MISO[] = { | ||
{PC_3, RTL_PIN_PERI(SPI0, 0, S1), RTL_PIN_FUNC(SPI0, S1)}, | ||
{NC, NC, 0} | ||
}; | ||
|
||
// for serial_api.c | ||
const PinMap PinMap_UART_TX[] = { | ||
{PA_4, RTL_PIN_PERI(UART2, 2, S0), RTL_PIN_FUNC(UART2, S0)}, | ||
{PB_0, RTL_PIN_PERI(LOG_UART, 3, S0), RTL_PIN_FUNC(LOG_UART, S0)}, | ||
{NC, NC, 0} | ||
}; | ||
|
||
const PinMap PinMap_UART_RX[] = { | ||
{PA_0, RTL_PIN_PERI(UART2, 2, S0), RTL_PIN_FUNC(UART2, S0)}, | ||
{PB_1, RTL_PIN_PERI(LOG_UART, 3, S0), RTL_PIN_FUNC(LOG_UART, S0)}, | ||
{NC, NC, 0} | ||
}; | ||
|
||
// for i2c_api.c | ||
const PinMap PinMap_I2C_SDA[] = { | ||
{PB_3, RTL_PIN_PERI(I2C3, 3, S0), RTL_PIN_FUNC(I2C3, S0)}, | ||
{NC, NC, 0} | ||
}; | ||
|
||
const PinMap PinMap_I2C_SCL[] = { | ||
{PB_2, RTL_PIN_PERI(I2C3, 3, S0), RTL_PIN_FUNC(I2C3, S0)}, | ||
{NC, NC, 0} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
/* mbed Microcontroller Library | ||
* Copyright (c) 2006-2013 ARM Limited | ||
* | ||
* 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. | ||
*/ | ||
#ifndef _PINNAMES_H_ | ||
#define _PINNAMES_H_ | ||
|
||
#include "cmsis.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef enum { | ||
PORT_A = 0, | ||
PORT_B = 1, | ||
PORT_C = 2, | ||
PORT_D = 3, | ||
PORT_E = 4, | ||
PORT_F = 5, | ||
PORT_G = 6, | ||
PORT_H = 7, | ||
PORT_I = 8, | ||
PORT_J = 9, | ||
PORT_K = 10, | ||
|
||
PORT_V = 11, | ||
PORT_U = 12, | ||
PORT_MAX | ||
} GPIO_PORT; | ||
|
||
#define RTL_PIN_PERI(FUN, IDX, SEL) ((int)(((FUN) << 8) | ((IDX)<<4) | (SEL))) | ||
#define RTL_PIN_FUNC(FUN, SEL) ((int)(((FUN) << 7) | (SEL))) | ||
#define RTL_GET_PERI_SEL(peri) ((int)((peri)&0x0F)) | ||
#define RTL_GET_PERI_IDX(peri) ((int)(((peri) >> 4)&0x0F)) | ||
|
||
typedef enum { | ||
PIN_INPUT=0, | ||
PIN_OUTPUT | ||
} PinDirection; | ||
|
||
|
||
typedef enum { | ||
PA_0 = (PORT_A<<4|0), | ||
PA_1 = (PORT_A<<4|1), | ||
PA_2 = (PORT_A<<4|2), | ||
PA_3 = (PORT_A<<4|3), | ||
PA_4 = (PORT_A<<4|4), | ||
PA_5 = (PORT_A<<4|5), | ||
PA_6 = (PORT_A<<4|6), | ||
PA_7 = (PORT_A<<4|7), | ||
|
||
PB_0 = (PORT_B<<4|0), | ||
PB_1 = (PORT_B<<4|1), | ||
PB_2 = (PORT_B<<4|2), | ||
PB_3 = (PORT_B<<4|3), | ||
PB_4 = (PORT_B<<4|4), | ||
PB_5 = (PORT_B<<4|5), | ||
PB_6 = (PORT_B<<4|6), | ||
PB_7 = (PORT_B<<4|7), | ||
|
||
PC_0 = (PORT_C<<4|0), | ||
PC_1 = (PORT_C<<4|1), | ||
PC_2 = (PORT_C<<4|2), | ||
PC_3 = (PORT_C<<4|3), | ||
PC_4 = (PORT_C<<4|4), | ||
PC_5 = (PORT_C<<4|5), | ||
PC_6 = (PORT_C<<4|6), | ||
PC_7 = (PORT_C<<4|7), | ||
PC_8 = (PORT_C<<4|8), | ||
PC_9 = (PORT_C<<4|9), | ||
|
||
PD_0 = (PORT_D<<4|0), | ||
PD_1 = (PORT_D<<4|1), | ||
PD_2 = (PORT_D<<4|2), | ||
PD_3 = (PORT_D<<4|3), | ||
PD_4 = (PORT_D<<4|4), | ||
PD_5 = (PORT_D<<4|5), | ||
PD_6 = (PORT_D<<4|6), | ||
PD_7 = (PORT_D<<4|7), | ||
PD_8 = (PORT_D<<4|8), | ||
PD_9 = (PORT_D<<4|9), | ||
|
||
PE_0 = (PORT_E<<4|0), | ||
PE_1 = (PORT_E<<4|1), | ||
PE_2 = (PORT_E<<4|2), | ||
PE_3 = (PORT_E<<4|3), | ||
PE_4 = (PORT_E<<4|4), | ||
PE_5 = (PORT_E<<4|5), | ||
PE_6 = (PORT_E<<4|6), | ||
PE_7 = (PORT_E<<4|7), | ||
PE_8 = (PORT_E<<4|8), | ||
PE_9 = (PORT_E<<4|9), | ||
PE_A = (PORT_E<<4|10), | ||
|
||
PF_0 = (PORT_F<<4|0), | ||
PF_1 = (PORT_F<<4|1), | ||
PF_2 = (PORT_F<<4|2), | ||
PF_3 = (PORT_F<<4|3), | ||
PF_4 = (PORT_F<<4|4), | ||
PF_5 = (PORT_F<<4|5), | ||
/* unavailable pins */ | ||
// PF_6 = (PORT_F<<4|6), | ||
// PF_7 = (PORT_F<<4|7), | ||
|
||
PG_0 = (PORT_G<<4|0), | ||
PG_1 = (PORT_G<<4|1), | ||
PG_2 = (PORT_G<<4|2), | ||
PG_3 = (PORT_G<<4|3), | ||
PG_4 = (PORT_G<<4|4), | ||
PG_5 = (PORT_G<<4|5), | ||
PG_6 = (PORT_G<<4|6), | ||
PG_7 = (PORT_G<<4|7), | ||
|
||
PH_0 = (PORT_H<<4|0), | ||
PH_1 = (PORT_H<<4|1), | ||
PH_2 = (PORT_H<<4|2), | ||
PH_3 = (PORT_H<<4|3), | ||
PH_4 = (PORT_H<<4|4), | ||
PH_5 = (PORT_H<<4|5), | ||
PH_6 = (PORT_H<<4|6), | ||
PH_7 = (PORT_H<<4|7), | ||
|
||
PI_0 = (PORT_I<<4|0), | ||
PI_1 = (PORT_I<<4|1), | ||
PI_2 = (PORT_I<<4|2), | ||
PI_3 = (PORT_I<<4|3), | ||
PI_4 = (PORT_I<<4|4), | ||
PI_5 = (PORT_I<<4|5), | ||
PI_6 = (PORT_I<<4|6), | ||
PI_7 = (PORT_I<<4|7), | ||
|
||
PJ_0 = (PORT_J<<4|0), | ||
PJ_1 = (PORT_J<<4|1), | ||
PJ_2 = (PORT_J<<4|2), | ||
PJ_3 = (PORT_J<<4|3), | ||
PJ_4 = (PORT_J<<4|4), | ||
PJ_5 = (PORT_J<<4|5), | ||
PJ_6 = (PORT_J<<4|6), | ||
/* unavailable pins */ | ||
// PJ_7 = (PORT_J<<4|7), | ||
|
||
PK_0 = (PORT_K<<4|0), | ||
PK_1 = (PORT_K<<4|1), | ||
PK_2 = (PORT_K<<4|2), | ||
PK_3 = (PORT_K<<4|3), | ||
PK_4 = (PORT_K<<4|4), | ||
PK_5 = (PORT_K<<4|5), | ||
PK_6 = (PORT_K<<4|6), | ||
/* unavailable pins */ | ||
// PK_7 = (PORT_K<<4|7), | ||
|
||
AD_1 = (PORT_V<<4|1), | ||
AD_2 = (PORT_V<<4|2), | ||
AD_3 = (PORT_V<<4|3), | ||
|
||
DA_0 = (PORT_U<<4|0), | ||
DA_1 = (PORT_U<<4|1), | ||
|
||
// Not connected | ||
NC = (int)0xFFFFFFFF, | ||
|
||
// Generic signals namings | ||
/* LED1~4 are defined as alias of GPIO pins, they are not the LEDs on board*/ | ||
// Pinmap is followed PADI IoT Stamp Pinout Diagram: | ||
// http://files.pine64.org/doc/PADI/documentation/padi-pinout-diagram.pdf | ||
LED1 = PA_5, | ||
LED2 = PA_5, | ||
LED3 = PA_5, | ||
LED4 = PA_5, | ||
SERIAL_TX = PA_4, | ||
SERIAL_RX = PA_0, | ||
USBTX = PB_0, | ||
USBRX = PB_1, | ||
I2C_SCL = PB_2, | ||
I2C_SDA = PB_3, | ||
SPI_MOSI = PC_2, | ||
SPI_MISO = PC_3, | ||
SPI_SCK = PC_1, | ||
SPI_CS = PC_0, | ||
|
||
} PinName; | ||
|
||
typedef enum { | ||
PullNone = 0, | ||
PullUp = 1, | ||
PullDown = 2, | ||
OpenDrain = 3, | ||
PullDefault = PullNone | ||
} PinMode; | ||
|
||
#define PORT_NUM(pin) (((uint32_t)(pin) >> 4) & 0xF) | ||
#define PIN_NUM(pin) ((uint32_t)(pin) & 0xF) | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs own commit, explaining why is this wait needed here - a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm going to make own commit with explaining.