-
Notifications
You must be signed in to change notification settings - Fork 954
[Board] Adafruit Trinket #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
deadprogram
merged 10 commits into
tinygo-org:dev
from
Munsio:feature/adafruit-trinket-board
May 14, 2019
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
31161d6
Initial commit for Adafruit Trinket-M0 board
Munsio 5d58b90
Add trinket build test to circle-ci config
Munsio 3923cf0
Add UART0 USBCDC pins
Munsio 0b0c76a
Add machine and runtime information
Munsio 772df1f
Remove change from .gitignore
Munsio 4ba5230
Merge remote-tracking branch 'origin/dev' into feature/adafruit-trink…
Munsio 7d81564
change PinMode to get I2C to work
Munsio 79983f7
Merge remote-tracking branch 'origin/dev' into feature/adafruit-trink…
Munsio 2b46811
Add I2S pins needed after #331
Munsio 2e4a02b
Merge branch 'feature/adafruit-trinket-board' of github.com:Munsio/ti…
Munsio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,66 @@ | ||
// +build sam,atsamd21,trinket_m0 | ||
|
||
package machine | ||
|
||
import "device/sam" | ||
|
||
// GPIO Pins | ||
const ( | ||
D0 = PA08 // PWM available | ||
D1 = PA02 | ||
D2 = PA09 // PWM available | ||
D3 = PA07 // PWM available / UART0 RX | ||
D4 = PA06 // PWM available / UART0 TX | ||
D13 = PA10 // LED | ||
) | ||
|
||
// Analog pins | ||
const ( | ||
A0 = D1 | ||
A1 = D2 | ||
A2 = D0 | ||
A3 = D3 | ||
A4 = D4 | ||
) | ||
|
||
const ( | ||
LED = D13 | ||
) | ||
|
||
// UART0 aka USBCDC pins | ||
const ( | ||
USBCDC_DM_PIN = PA24 | ||
USBCDC_DP_PIN = PA25 | ||
) | ||
|
||
// UART1 pins | ||
const ( | ||
UART_TX_PIN = D4 | ||
UART_RX_PIN = D3 | ||
) | ||
|
||
// SPI pins | ||
const ( | ||
SPI0_SCK_PIN = D3 | ||
SPI0_MOSI_PIN = D4 | ||
SPI0_MISO_PIN = D2 | ||
) | ||
|
||
// SPI on the Trinket M0. | ||
var ( | ||
SPI0 = SPI{Bus: sam.SERCOM0_SPI} | ||
) | ||
|
||
// I2C pins | ||
const ( | ||
SDA_PIN = D0 // SDA | ||
SCL_PIN = D2 // SCL | ||
) | ||
|
||
// I2C on the Trinket M0. | ||
var ( | ||
I2C0 = I2C{Bus: sam.SERCOM2_I2CM, | ||
SDA: SDA_PIN, | ||
SCL: SCL_PIN, | ||
PinMode: GPIO_SERCOM} | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
GPIO_SERCOM_ALT
here, I think.