mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 19:44:00 +00:00
nrf: add CPU frequency
This commit is contained in:
committed by
Ron Evans
parent
714d98354c
commit
b1c70d85f7
@@ -6,6 +6,8 @@ import (
|
|||||||
"device/nrf"
|
"device/nrf"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const CPU_FREQUENCY = 16000000
|
||||||
|
|
||||||
// Get peripheral and pin number for this GPIO pin.
|
// Get peripheral and pin number for this GPIO pin.
|
||||||
func (p GPIO) getPortPin() (*nrf.GPIO_Type, uint8) {
|
func (p GPIO) getPortPin() (*nrf.GPIO_Type, uint8) {
|
||||||
return nrf.GPIO, p.Pin
|
return nrf.GPIO, p.Pin
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const CPU_FREQUENCY = 64000000
|
||||||
|
|
||||||
// Get peripheral and pin number for this GPIO pin.
|
// Get peripheral and pin number for this GPIO pin.
|
||||||
func (p GPIO) getPortPin() (*nrf.GPIO_Type, uint8) {
|
func (p GPIO) getPortPin() (*nrf.GPIO_Type, uint8) {
|
||||||
return nrf.P0, p.Pin
|
return nrf.P0, p.Pin
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const CPU_FREQUENCY = 64000000
|
||||||
|
|
||||||
// Get peripheral and pin number for this GPIO pin.
|
// Get peripheral and pin number for this GPIO pin.
|
||||||
func (p GPIO) getPortPin() (*nrf.GPIO_Type, uint8) {
|
func (p GPIO) getPortPin() (*nrf.GPIO_Type, uint8) {
|
||||||
if p.Pin >= 32 {
|
if p.Pin >= 32 {
|
||||||
|
|||||||
Reference in New Issue
Block a user