cpu/lpc23xx: rename lpc2387 to lpc23xx
This commit is contained in:
parent
ea8e867611
commit
829b16b472
@ -24,7 +24,7 @@
|
|||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "periph_conf.h"
|
#include "periph_conf.h"
|
||||||
#include "lpc2387.h"
|
#include "lpc23xx.h"
|
||||||
|
|
||||||
#define CL_CPU_DIV 4
|
#define CL_CPU_DIV 4
|
||||||
|
|
||||||
@ -19,7 +19,7 @@
|
|||||||
#include "stdio_base.h"
|
#include "stdio_base.h"
|
||||||
#include "periph/init.h"
|
#include "periph/init.h"
|
||||||
|
|
||||||
void lpc2387_pclk_scale(uint32_t source, uint32_t target, uint32_t *pclksel, uint32_t *prescale)
|
void lpc23xx_pclk_scale(uint32_t source, uint32_t target, uint32_t *pclksel, uint32_t *prescale)
|
||||||
{
|
{
|
||||||
uint32_t pclkdiv;
|
uint32_t pclkdiv;
|
||||||
*prescale = source / target;
|
*prescale = source / target;
|
||||||
@ -52,7 +52,7 @@ void cpu_clock_scale(uint32_t source, uint32_t target, uint32_t *prescale)
|
|||||||
{
|
{
|
||||||
uint32_t pclksel;
|
uint32_t pclksel;
|
||||||
|
|
||||||
lpc2387_pclk_scale(source, target, &pclksel, prescale);
|
lpc23xx_pclk_scale(source, target, &pclksel, prescale);
|
||||||
|
|
||||||
PCLKSEL0 = (PCLKSEL0 & ~(BIT2 | BIT3)) | (pclksel << 2); /* timer 0 */
|
PCLKSEL0 = (PCLKSEL0 & ~(BIT2 | BIT3)) | (pclksel << 2); /* timer 0 */
|
||||||
PCLKSEL0 = (PCLKSEL0 & ~(BIT4 | BIT5)) | (pclksel << 4); /* timer 1 */
|
PCLKSEL0 = (PCLKSEL0 & ~(BIT4 | BIT5)) | (pclksel << 4); /* timer 1 */
|
||||||
@ -19,7 +19,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "lpc2387.h"
|
#include "lpc23xx.h"
|
||||||
#include "arm_cpu.h"
|
#include "arm_cpu.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -41,7 +41,7 @@ void cpu_init_mam(void);
|
|||||||
/**
|
/**
|
||||||
* @brief Scale lpc2387 cpu speed
|
* @brief Scale lpc2387 cpu speed
|
||||||
*/
|
*/
|
||||||
void lpc2387_pclk_scale(uint32_t source, uint32_t target, uint32_t *pclksel, uint32_t *prescale);
|
void lpc23xx_pclk_scale(uint32_t source, uint32_t target, uint32_t *pclksel, uint32_t *prescale);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize lpc2387 cpu clocks
|
* @brief Initialize lpc2387 cpu clocks
|
||||||
@ -8,8 +8,8 @@
|
|||||||
* Parts taken from FeuerWhere-Project, lpc2387.h.
|
* Parts taken from FeuerWhere-Project, lpc2387.h.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LPC2387_H
|
#ifndef LPC23XX_H
|
||||||
#define LPC2387_H
|
#define LPC23XX_H
|
||||||
|
|
||||||
#include "vendor/lpc23xx.h"
|
#include "vendor/lpc23xx.h"
|
||||||
#include "arm7_common.h"
|
#include "arm7_common.h"
|
||||||
@ -154,4 +154,4 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* LPC2387_H */
|
#endif /* LPC23XX_H */
|
||||||
@ -12,8 +12,8 @@
|
|||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#ifndef LPC23XX_H
|
#ifndef LPC23XX_VENDOR_H
|
||||||
#define LPC23XX_H
|
#define LPC23XX_VENDOR_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -1256,4 +1256,4 @@ with the spec. update in USB Device Section. */
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* LPC23XX_H */
|
#endif /* LPC23XX_VENDOR_H */
|
||||||
@ -24,7 +24,7 @@
|
|||||||
#include "irq.h"
|
#include "irq.h"
|
||||||
#include "flashrom.h"
|
#include "flashrom.h"
|
||||||
#include "iap.h"
|
#include "iap.h"
|
||||||
#include "lpc2387.h"
|
#include "lpc23xx.h"
|
||||||
|
|
||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
@ -124,7 +124,7 @@ void i2c_release(i2c_t dev)
|
|||||||
static void _set_baud(lpc23xx_i2c_t *i2c, uint32_t baud)
|
static void _set_baud(lpc23xx_i2c_t *i2c, uint32_t baud)
|
||||||
{
|
{
|
||||||
uint32_t pclksel, prescale;
|
uint32_t pclksel, prescale;
|
||||||
lpc2387_pclk_scale(CLOCK_CORECLOCK, baud, &pclksel, &prescale);
|
lpc23xx_pclk_scale(CLOCK_CORECLOCK, baud, &pclksel, &prescale);
|
||||||
|
|
||||||
switch ((uint32_t)i2c) {
|
switch ((uint32_t)i2c) {
|
||||||
case I2C0_BASE_ADDR:
|
case I2C0_BASE_ADDR:
|
||||||
@ -29,7 +29,7 @@
|
|||||||
/* cpu */
|
/* cpu */
|
||||||
#include "periph/rtc.h"
|
#include "periph/rtc.h"
|
||||||
#include "VIC.h"
|
#include "VIC.h"
|
||||||
#include "lpc2387.h"
|
#include "lpc23xx.h"
|
||||||
|
|
||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
@ -119,7 +119,7 @@ int spi_acquire(spi_t bus, spi_cs_t cs, spi_mode_t mode, spi_clk_t clk)
|
|||||||
dev->CR0 = 7;
|
dev->CR0 = 7;
|
||||||
|
|
||||||
/* configure bus clock */
|
/* configure bus clock */
|
||||||
lpc2387_pclk_scale(CLOCK_CORECLOCK / 1000, (uint32_t)clk, &pclksel, &cpsr);
|
lpc23xx_pclk_scale(CLOCK_CORECLOCK / 1000, (uint32_t)clk, &pclksel, &cpsr);
|
||||||
|
|
||||||
switch ((uint32_t)dev) {
|
switch ((uint32_t)dev) {
|
||||||
case SSP0_BASE_ADDR:
|
case SSP0_BASE_ADDR:
|
||||||
@ -137,7 +137,7 @@ int timer_init(tim_t tim, unsigned long freq, timer_cb_t cb, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t scale, prescale;
|
uint32_t scale, prescale;
|
||||||
lpc2387_pclk_scale(CLOCK_PCLK, freq, &scale, &prescale);
|
lpc23xx_pclk_scale(CLOCK_PCLK, freq, &scale, &prescale);
|
||||||
|
|
||||||
/* save the callback */
|
/* save the callback */
|
||||||
isr_ctx[tim].cb = cb;
|
isr_ctx[tim].cb = cb;
|
||||||
Loading…
x
Reference in New Issue
Block a user