mirror of
https://github.com/sipeed/Maixduino.git
synced 2026-03-06 18:17:00 +01:00
@@ -12,6 +12,11 @@ void delay(uint64_t dwMs){
|
||||
msleep(dwMs);
|
||||
return;
|
||||
}
|
||||
void delayMicroseconds(uint64_t dwUs){
|
||||
usleep(dwUs);
|
||||
return;
|
||||
}
|
||||
|
||||
void pll_init(){
|
||||
sysctl_pll_set_freq(SYSCTL_PLL0, 800000000UL);
|
||||
sysctl_pll_set_freq(SYSCTL_PLL1, 300000000UL);
|
||||
|
||||
@@ -25,6 +25,8 @@ extern uint64_t micros(void);
|
||||
*/
|
||||
extern void delay(uint64_t dwMs);
|
||||
|
||||
extern void delayMicroseconds(uint64_t dwUs);
|
||||
|
||||
void pll_init(void);
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <stdint.h>
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
@@ -12,11 +13,11 @@ extern "C"{
|
||||
#define PortAddr_t uint32_t
|
||||
#define PortRegister_t volatile uint32_t *
|
||||
|
||||
#define digitalPinToPort(pin) ((PortAddr_t) GPIO_CTRL_ADDR)
|
||||
#define digitalPinToPortIn(pin) ((PortAddr_t) GPIO_CTRL_ADDR)
|
||||
#define digitalPinToBitMask(pin) ((PortValue_t) (1<<variant_pin_map[pin].bit_pos))
|
||||
#define portOutputRegister(port) ((PortRegister_t) (GPIO_CTRL_ADDR + GPIO_OUTPUT_VAL))
|
||||
#define portInputRegister(port) ((PortRegister_t) (GPIO_CTRL_ADDR + GPIO_INPUT_VAL))
|
||||
#define digitalPinToPort(pin) ((PortAddr_t) GPIOHS_BASE_ADDR)
|
||||
#define digitalPinToPortIn(pin) ((PortAddr_t) GPIOHS_BASE_ADDR)
|
||||
#define digitalPinToBitMask(pin) ((PortValue_t) (1<<pin))
|
||||
#define portOutputRegister(port) ((PortRegister_t) (GPIOHS_BASE_ADDR + GPIOHS_OUTPUT_VAL))
|
||||
#define portInputRegister(port) ((PortRegister_t) (GPIOHS_BASE_ADDR + GPIOHS_INPUT_VAL))
|
||||
|
||||
/**
|
||||
* \brief Configures the specified pin to behave either as an input or an output. See the description of digital pins for details.
|
||||
|
||||
Reference in New Issue
Block a user