nrf: add CPU frequency
Этот коммит содержится в:
родитель
714d98354c
коммит
b1c70d85f7
3 изменённых файлов: 6 добавлений и 0 удалений
|
@ -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 {
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче