Skip to content

Commit 6d3bfa5

Browse files
author
Owen L - SFE
committed
initial effort
1 parent bb7d06f commit 6d3bfa5

File tree

7 files changed

+786
-41
lines changed

7 files changed

+786
-41
lines changed

targets/TARGET_Ambiq_Micro/TARGET_Apollo3/TARGET_AMA3B1KK/device/PeripheralNames.h

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2013 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include "PeripheralPins.h"
18+
19+
/************RTC***************/
20+
const PinMap PinMap_RTC[] = {
21+
{NC, 0, 0},
22+
};
23+
24+
/************ADC***************/
25+
const PinMap PinMap_ADC[] = {
26+
{NC, NC, 0}};
27+
28+
/************DAC***************/
29+
const PinMap PinMap_DAC[] = {
30+
{NC, NC, 0}};
31+
32+
/************I2C***************/
33+
const PinMap PinMap_I2C_SDA[] = {
34+
{NC, NC, 0}};
35+
36+
const PinMap PinMap_I2C_SCL[] = {
37+
{NC, NC, 0}};
38+
39+
/************UART***************/
40+
const PinMap PinMap_UART_TX[] = {
41+
{1, UART_0, AM_HAL_PIN_1_UART0TX},
42+
{7, UART_0, AM_HAL_PIN_7_UART0TX},
43+
{16, UART_0, AM_HAL_PIN_16_UART0TX},
44+
{20, UART_0, AM_HAL_PIN_20_UART0TX},
45+
{22, UART_0, AM_HAL_PIN_22_UART0TX},
46+
{26, UART_0, AM_HAL_PIN_26_UART0TX},
47+
{28, UART_0, AM_HAL_PIN_28_UART0TX},
48+
{30, UART_0, AM_HAL_PIN_30_UART0TX},
49+
{39, UART_0, AM_HAL_PIN_39_UART0TX},
50+
{41, UART_0, AM_HAL_PIN_41_UART0TX},
51+
{48, UART_0, AM_HAL_PIN_48_UART0TX},
52+
{8, UART_1, AM_HAL_PIN_8_UART1TX},
53+
{12, UART_1, AM_HAL_PIN_12_UART1TX},
54+
{14, UART_1, AM_HAL_PIN_14_UART1TX},
55+
{18, UART_1, AM_HAL_PIN_18_UART1TX},
56+
{20, UART_1, AM_HAL_PIN_20_UART1TX},
57+
{24, UART_1, AM_HAL_PIN_24_UART1TX},
58+
{35, UART_1, AM_HAL_PIN_35_UART1TX},
59+
{37, UART_1, AM_HAL_PIN_37_UART1TX},
60+
{39, UART_1, AM_HAL_PIN_39_UART1TX},
61+
{42, UART_1, AM_HAL_PIN_42_UART1TX},
62+
{46, UART_1, AM_HAL_PIN_46_UART1TX},
63+
{NC, NC, 0}};
64+
65+
const PinMap PinMap_UART_RX[] = {
66+
{2, UART_0, AM_HAL_PIN_2_UART0RX},
67+
{4, UART_0, AM_HAL_PIN_4_UART0RX},
68+
{11, UART_0, AM_HAL_PIN_11_UART0RX},
69+
{17, UART_0, AM_HAL_PIN_17_UART0RX},
70+
{21, UART_0, AM_HAL_PIN_21_UART0RX},
71+
{23, UART_0, AM_HAL_PIN_23_UART0RX},
72+
{27, UART_0, AM_HAL_PIN_27_UART0RX},
73+
{29, UART_0, AM_HAL_PIN_29_UART0RX},
74+
{31, UART_0, AM_HAL_PIN_31_UART0RX},
75+
{34, UART_0, AM_HAL_PIN_34_UART0RX},
76+
{40, UART_0, AM_HAL_PIN_40_UART0RX},
77+
{45, UART_0, AM_HAL_PIN_45_UART0RX},
78+
{49, UART_0, AM_HAL_PIN_49_UART0RX},
79+
{9, UART_1, AM_HAL_PIN_9_UART1RX},
80+
{13, UART_1, AM_HAL_PIN_13_UART1RX},
81+
{15, UART_1, AM_HAL_PIN_15_UART1RX},
82+
{19, UART_1, AM_HAL_PIN_19_UART1RX},
83+
{21, UART_1, AM_HAL_PIN_21_UART1RX},
84+
{25, UART_1, AM_HAL_PIN_25_UART1RX},
85+
{36, UART_1, AM_HAL_PIN_36_UART1RX},
86+
{38, UART_1, AM_HAL_PIN_38_UART1RX},
87+
{40, UART_1, AM_HAL_PIN_40_UART1RX},
88+
{43, UART_1, AM_HAL_PIN_43_UART1RX},
89+
{47, UART_1, AM_HAL_PIN_47_UART1RX},
90+
{NC, NC, 0}};
91+
92+
const PinMap PinMap_UART_RTS[] = {
93+
{3, UART_0, AM_HAL_PIN_3_UART0RTS},
94+
{5, UART_0, AM_HAL_PIN_5_UART0RTS},
95+
{13, UART_0, AM_HAL_PIN_13_UART0RTS},
96+
{18, UART_0, AM_HAL_PIN_18_UART0RTS},
97+
{34, UART_0, AM_HAL_PIN_34_UART0RTS},
98+
{35, UART_0, AM_HAL_PIN_35_UART0RTS},
99+
{37, UART_0, AM_HAL_PIN_37_UART0RTS},
100+
{41, UART_0, AM_HAL_PIN_41_UART0RTS},
101+
{10, UART_1, AM_HAL_PIN_10_UART1RTS},
102+
{16, UART_1, AM_HAL_PIN_16_UART1RTS},
103+
{20, UART_1, AM_HAL_PIN_20_UART1RTS},
104+
{30, UART_1, AM_HAL_PIN_30_UART1RTS},
105+
{31, UART_1, AM_HAL_PIN_31_UART1RTS},
106+
{34, UART_1, AM_HAL_PIN_34_UART1RTS},
107+
{41, UART_1, AM_HAL_PIN_41_UART1RTS},
108+
{44, UART_1, AM_HAL_PIN_44_UART1RTS},
109+
{NC, NC, 0}};
110+
111+
const PinMap PinMap_UART_CTS[] = {
112+
{4, UART_0, AM_HAL_PIN_4_UART0CTS},
113+
{6, UART_0, AM_HAL_PIN_6_UART0CTS},
114+
{12, UART_0, AM_HAL_PIN_12_UART0CTS},
115+
{24, UART_0, AM_HAL_PIN_24_UART0CTS},
116+
{29, UART_0, AM_HAL_PIN_29_UART0CTS},
117+
{33, UART_0, AM_HAL_PIN_33_UART0CTS},
118+
{26, UART_0, AM_HAL_PIN_36_UART0CTS},
119+
{38, UART_0, AM_HAL_PIN_38_UART0CTS},
120+
{11, UART_1, AM_HAL_PIN_11_UART1CTS},
121+
{17, UART_1, AM_HAL_PIN_17_UART1CTS},
122+
{21, UART_1, AM_HAL_PIN_21_UART1CTS},
123+
{26, UART_1, AM_HAL_PIN_26_UART1CTS},
124+
{29, UART_1, AM_HAL_PIN_29_UART1CTS},
125+
{32, UART_1, AM_HAL_PIN_32_UART1CTS},
126+
{36, UART_1, AM_HAL_PIN_36_UART1CTS},
127+
{45, UART_1, AM_HAL_PIN_45_UART1CTS},
128+
{NC, NC, 0}};
129+
130+
/************SPI***************/
131+
const PinMap PinMap_SPI_SCLK[] = {
132+
{NC, NC, 0}};
133+
134+
const PinMap PinMap_SPI_MOSI[] = {
135+
{NC, NC, 0}};
136+
137+
const PinMap PinMap_SPI_MISO[] = {
138+
{NC, NC, 0}};
139+
140+
const PinMap PinMap_SPI_SSEL[] = {
141+
{NC, NC, 0}};
142+
143+
/************PWM***************/
144+
const PinMap PinMap_PWM[] = {
145+
{NC, NC, 0}};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2013 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#ifndef MBED_PERIPHERALNAMES_H
17+
#define MBED_PERIPHERALNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
UART_0 = 0,
27+
UART_1,
28+
} UARTName;
29+
30+
#ifdef __cplusplus
31+
}
32+
#endif
33+
34+
#endif
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (c) 2017-2018 Future Electronics
4+
* Copyright (c) 2018-2019 Cypress Semiconductor Corporation
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
#ifndef MBED_PERIPHERALPINS_H
21+
#define MBED_PERIPHERALPINS_H
22+
23+
#include "pinmap.h"
24+
#include "PeripheralNames.h"
25+
26+
//*** I2C ***
27+
#if DEVICE_I2C
28+
extern const PinMap PinMap_I2C_SDA[];
29+
extern const PinMap PinMap_I2C_SCL[];
30+
#endif
31+
32+
//*** PWM ***
33+
#if DEVICE_PWMOUT
34+
extern const PinMap PinMap_PWM_OUT[];
35+
#endif
36+
37+
//*** SERIAL ***
38+
#if DEVICE_SERIAL
39+
extern const PinMap PinMap_UART_TX[];
40+
extern const PinMap PinMap_UART_RX[];
41+
extern const PinMap PinMap_UART_RTS[];
42+
extern const PinMap PinMap_UART_CTS[];
43+
#endif
44+
45+
//*** SPI ***
46+
#if DEVICE_SPI
47+
extern const PinMap PinMap_SPI_MOSI[];
48+
extern const PinMap PinMap_SPI_MISO[];
49+
extern const PinMap PinMap_SPI_SCLK[];
50+
extern const PinMap PinMap_SPI_SSEL[];
51+
#endif
52+
53+
//*** ADC ***
54+
#if DEVICE_ANALOGIN
55+
extern const PinMap PinMap_ADC[];
56+
#endif
57+
58+
//*** DAC ***
59+
#if DEVICE_ANALOGOUT
60+
extern const PinMap PinMap_DAC[];
61+
#endif
62+
63+
//*** QSPI ***
64+
#if DEVICE_QSPI
65+
extern const PinMap PinMap_QSPI_SCLK[];
66+
extern const PinMap PinMap_QSPI_SSEL[];
67+
extern const PinMap PinMap_QSPI_DATA0[];
68+
extern const PinMap PinMap_QSPI_DATA1[];
69+
extern const PinMap PinMap_QSPI_DATA2[];
70+
extern const PinMap PinMap_QSPI_DATA3[];
71+
#endif
72+
73+
#endif

targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/objects_uart.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ extern "C"
4646

4747
struct serial_s
4848
{
49-
ap3_uart_inst_t inst; // UART module instance
50-
void *handle; // UART handle
51-
am_hal_uart_config_t cfg; // UART configuration
49+
ap3_uart_inst_t inst; // UART module instance
50+
void *handle; // UART handle
51+
am_hal_uart_config_t cfg; // UART configuration
52+
volatile uint32_t tx_idle; // UART tx idle indication
5253
};
5354

5455
#ifdef __cplusplus

0 commit comments

Comments
 (0)