This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental/host packages am335x, beagle and pruicss
- Loading branch information
Showing
12 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
package am335x | ||
|
||
import ( | ||
"errors" | ||
|
||
"periph.io/x/periph" | ||
) | ||
|
||
// Present returns true if an am335x processor is detected. | ||
// | ||
// TODO(maruel): Implement. | ||
func Present() bool { | ||
if isArm { | ||
return false | ||
} | ||
return false | ||
} | ||
|
||
// driver implements periph.Driver. | ||
type driver struct { | ||
} | ||
|
||
func (d *driver) String() string { | ||
return "am335x" | ||
} | ||
|
||
func (d *driver) Prerequisites() []string { | ||
return nil | ||
} | ||
|
||
func (d *driver) Init() (bool, error) { | ||
if !Present() { | ||
return false, errors.New("am335x CPU not detected") | ||
} | ||
return true, nil | ||
} | ||
|
||
func init() { | ||
if isArm { | ||
periph.MustRegister(&driver{}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
package am335x | ||
|
||
const isArm = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
// +build !arm | ||
|
||
package am335x | ||
|
||
const isArm = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
// Package am335x exposes functionality for the Texas Instruments Sitara AM335x | ||
// processor family. | ||
// | ||
// This processor family is found on the BeagleBone. PRU-ICSS functionality is | ||
// implemented in package pruicss. | ||
// | ||
// Datasheet | ||
// | ||
// Technical Reference Manual | ||
// https://www.ti.com/lit/ug/spruh73p/spruh73p.pdf | ||
// | ||
// Other | ||
// | ||
// Marketing page | ||
// https://www.ti.com/processors/sitara/arm-cortex-a8/am335x/overview.html | ||
// | ||
// Family overview | ||
// https://www.ti.com/lit/ds/symlink/am3359.pdf | ||
package am335x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
package beagle | ||
|
||
import ( | ||
"errors" | ||
|
||
"periph.io/x/periph" | ||
) | ||
|
||
// driver implements periph.Driver. | ||
type driver struct { | ||
} | ||
|
||
func (d *driver) String() string { | ||
return "beagle" | ||
} | ||
|
||
func (d *driver) Prerequisites() []string { | ||
return nil | ||
} | ||
|
||
func (d *driver) Init() (bool, error) { | ||
if !Present() { | ||
return false, errors.New("BeagleBoard/BeagleBone board not detected") | ||
} | ||
return true, nil | ||
} | ||
|
||
func init() { | ||
if isArm { | ||
periph.MustRegister(&driver{}) | ||
} | ||
} | ||
|
||
var _ periph.Driver = &driver{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
package beagle | ||
|
||
const isArm = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
// +build !arm | ||
|
||
package beagle | ||
|
||
const isArm = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
// Package beagle contains BeagleBoard/BeagleBone board family headers | ||
// definition. | ||
// | ||
// While most boards uses Texas Instruments CPUs, some use CPUs from Octavo | ||
// Systems. | ||
// | ||
// Physical | ||
// | ||
// The physical pin out is based on information at | ||
// https://beagleboard.org/support/bone101/. | ||
package beagle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
// Package pruicss exposes the Programmable Real-Time Unit Subsystem and | ||
// Industrial Communication Subsystem (PRUICSS) functionality found on many | ||
// Texas Instruments processors. | ||
// | ||
// This one of the rare way of doing true realtime on a linux microcomputer. | ||
// | ||
// Each PRU is a 32 bits "5ns per instruction" processor running at 200MHz, | ||
// with 8Kb of program memory and 8Kb of data memory. | ||
// | ||
// The PRU processor can be found on this non-exhaustive list of processors: | ||
// | ||
// - 2x PRUs on am3356, am3357, am3358, am3359 https://www.ti.com/product/am3359 | ||
// | ||
// - 4x PRUs on am4376, am4377, am4378, am4379 https://www.ti.com/product/am4379 | ||
// | ||
// - 4x PRUs on 66ak2g02; http://www.ti.com/product/66ak2g02 | ||
// | ||
// Datasheet | ||
// | ||
// Technical Reference Manual starting at page 199: | ||
// https://www.ti.com/lit/ug/spruh73p/spruh73p.pdf | ||
// | ||
// Help | ||
// | ||
// Hands-on videos | ||
// http://beagleboard.org/pru | ||
// | ||
// https://elinux.org/Ti_AM33XX_PRUSSv2 | ||
package pruicss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
package pruicss | ||
|
||
import ( | ||
"errors" | ||
|
||
"periph.io/x/periph" | ||
) | ||
|
||
// Present returns true if an Texas Instrument PRU-ICSS processor is detected. | ||
// | ||
// TODO(maruel): Implement. | ||
func Present() bool { | ||
if isArm { | ||
return false | ||
} | ||
return false | ||
} | ||
|
||
// driver implements periph.Driver. | ||
type driver struct { | ||
} | ||
|
||
func (d *driver) String() string { | ||
return "pruicss" | ||
} | ||
|
||
func (d *driver) Prerequisites() []string { | ||
return nil | ||
} | ||
|
||
func (d *driver) Init() (bool, error) { | ||
if !Present() { | ||
return false, errors.New("real time PRU-ICSS CPU not detected") | ||
} | ||
return true, nil | ||
} | ||
|
||
func init() { | ||
if isArm { | ||
periph.MustRegister(&driver{}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
package pruicss | ||
|
||
const isArm = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2017 The Periph Authors. All rights reserved. | ||
// Use of this source code is governed under the Apache License, Version 2.0 | ||
// that can be found in the LICENSE file. | ||
|
||
// +build !arm | ||
|
||
package pruicss | ||
|
||
const isArm = false |