Skip to content

Commit 87f3620

Browse files
committed
Moved lpc175x dma driver to lpc17xx
1 parent 13c883e commit 87f3620

4 files changed

Lines changed: 45 additions & 12 deletions

File tree

targets/chip/lpc1754/io/dma.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <array>
55

6-
#include <targets/core/nxp/lpc175x/dma.hpp>
6+
#include <targets/core/nxp/lpc17xx/dma.hpp>
77

88
namespace klib::lpc1754::io::periph {
99
struct dma0 {
@@ -26,10 +26,10 @@ namespace klib::lpc1754::io::periph {
2626

2727
namespace klib::lpc1754::io {
2828
template <typename Dma>
29-
using dma = core::lpc175x::io::dma<Dma>;
29+
using dma = core::lpc17xx::io::dma<Dma>;
3030

3131
template <typename Dma, uint8_t Channel, typename Source, typename Destination>
32-
using dma_channel = core::lpc175x::io::dma_channel<Dma, Channel, Source, Destination>;
32+
using dma_channel = core::lpc17xx::io::dma_channel<Dma, Channel, Source, Destination>;
3333
}
3434

3535
#endif

targets/chip/lpc1756/io/dma.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <array>
55

6-
#include <targets/core/nxp/lpc175x/dma.hpp>
6+
#include <targets/core/nxp/lpc17xx/dma.hpp>
77

88
namespace klib::lpc1756::io::periph {
99
struct dma0 {
@@ -26,10 +26,10 @@ namespace klib::lpc1756::io::periph {
2626

2727
namespace klib::lpc1756::io {
2828
template <typename Dma>
29-
using dma = core::lpc175x::io::dma<Dma>;
29+
using dma = core::lpc17xx::io::dma<Dma>;
3030

3131
template <typename Dma, uint8_t Channel, typename Source, typename Destination>
32-
using dma_channel = core::lpc175x::io::dma_channel<Dma, Channel, Source, Destination>;
32+
using dma_channel = core::lpc17xx::io::dma_channel<Dma, Channel, Source, Destination>;
3333
}
3434

3535
#endif

targets/chip/lpc1788/io/dma.hpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#ifndef KLIB_LPC1788_DMA_HPP
2+
#define KLIB_LPC1788_DMA_HPP
3+
4+
#include <array>
5+
6+
#include <targets/core/nxp/lpc17xx/dma.hpp>
7+
8+
namespace klib::lpc1788::io::periph {
9+
struct dma0 {
10+
// peripheral id (e.g dma0, dma1)
11+
constexpr static uint32_t id = 0;
12+
13+
// interrupt id (including the arm vector table)
14+
constexpr static uint32_t interrupt_id = 26 + 16;
15+
16+
// peripheral clock bit position
17+
constexpr static uint32_t clock_id = 29;
18+
19+
// port to the GPDMA hardware
20+
static inline GPDMA_Type *const port = GPDMA;
21+
22+
// available channels in the dma
23+
constexpr static uint32_t max_channels = 8;
24+
};
25+
}
26+
27+
namespace klib::lpc1788::io {
28+
template <typename Dma>
29+
using dma = core::lpc17xx::io::dma<Dma>;
30+
31+
template <typename Dma, uint8_t Channel, typename Source, typename Destination>
32+
using dma_channel = core::lpc17xx::io::dma_channel<Dma, Channel, Source, Destination>;
33+
}
34+
35+
#endif
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef KLIB_NXP_LPC175X_DMA_HPP
2-
#define KLIB_NXP_LPC175X_DMA_HPP
1+
#ifndef KLIB_NXP_LPC17XX_DMA_HPP
2+
#define KLIB_NXP_LPC17XX_DMA_HPP
33

44
#include <array>
55
#include <span>
@@ -11,9 +11,7 @@
1111

1212
#include <io/power.hpp>
1313

14-
#include "clocks.hpp"
15-
16-
namespace klib::core::lpc175x::io::detail::dma {
14+
namespace klib::core::lpc17xx::io::detail::dma {
1715
// using to the interrupt callback in the transfer helper
1816
using interrupt_callback = void(*)();
1917

@@ -112,7 +110,7 @@ namespace klib::core::lpc175x::io::detail::dma {
112110
}
113111
}
114112

115-
namespace klib::core::lpc175x::io {
113+
namespace klib::core::lpc17xx::io {
116114
template <typename Dma>
117115
class dma {
118116
public:

0 commit comments

Comments
 (0)