Skip to content
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

Review-ready driver #6

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1ea1695
Review-ready driver
noxuz Mar 24, 2020
b04e489
Brief update on some comments
noxuz Mar 25, 2020
2747c46
Update README.md
noxuz Mar 25, 2020
de472a2
Deleted __attribute__ , and verified running of Demo
noxuz Mar 26, 2020
88d069b
Driver separated into source and header, changed uavcan node board co…
noxuz Mar 27, 2020
c313c3b
Forgot include guards in build_config.hpp and typo fix form previous …
noxuz Mar 27, 2020
75d1fd2
Added measurement of the number of cycles that the ISR takes to complete
noxuz Mar 27, 2020
b1fd067
stopInterface updated and verified: released LPIT peripheral also, an…
noxuz Mar 29, 2020
2622c26
Encapsulated away the interrupt_handler from the interfacegGroup clas…
noxuz Mar 29, 2020
8f9db3e
Quick example of Ithe creation of Interface Group added in readme
noxuz Mar 29, 2020
9d70450
Quick example moved to bottom
noxuz Mar 29, 2020
7777755
Additional styling
noxuz Mar 29, 2020
5066943
Update README.md
noxuz Mar 29, 2020
aa35143
Update README.md
noxuz Mar 29, 2020
bdbfd35
Update nxp_s32k/libuavcan/driver/src/s32k_libuavcan.cpp (1 to 1u)
noxuz Mar 29, 2020
00e671a
change of 1 to 1u in multiple shift operations
noxuz Mar 29, 2020
322b5d4
CAN_WMBn_CS_DLC fix in tramission
noxuz Mar 29, 2020
8b6c0c3
Updated namespaces and folder structures, s32k_libuavcan files to can…
noxuz Mar 30, 2020
660c6db
Forgot to format the previous commit with clang-format
noxuz Mar 30, 2020
517b0cd
typo
noxuz Mar 30, 2020
8b1771e
deleted S32K from build_config include guards
noxuz Mar 30, 2020
12d1353
Updated quick example to new namespace
noxuz Mar 30, 2020
60b077c
Added Scott's .vscode and test folders. Couldn't rebase due to differ…
noxuz Mar 31, 2020
f86edb5
Moved includes from header to source, removed doxygen symbols from so…
noxuz Mar 31, 2020
fa77665
Clang-formating
noxuz Mar 31, 2020
309b5d2
further comment formatting and updated path to header in test_sanity
noxuz Mar 31, 2020
a9cfc7d
clang-formatting last commit
noxuz Mar 31, 2020
1457df9
ready for sanity check
noxuz Mar 31, 2020
092f9d4
small update in LPIT release at stopInterface
noxuz Mar 31, 2020
efc6cbd
includes fix
noxuz Mar 31, 2020
9379a48
correct paths and reflected changes available in demo repo
noxuz Mar 31, 2020
45d1c06
added src folder for canfd.cpp
noxuz Mar 31, 2020
97c95d8
Variable length array fix inside ISR, used S32K driver's frametype fo…
noxuz Apr 1, 2020
408beca
Added module folder and updated CMakeLists.txt
noxuz Apr 7, 2020
d1ddbb7
Use of InterfaceGroup::Frametype instead of template class inside ISR…
noxuz Apr 11, 2020
b2425ca
fixed doxygen commenting
noxuz Apr 13, 2020
146251e
enhanced select() with a single return
noxuz Apr 17, 2020
3782737
dlc -> 0x20 fix
noxuz Apr 28, 2020
7eeffb6
frame.getdlc to dlc
noxuz Apr 28, 2020
2c5280e
34.5% faster ISR, moved the byte swap procecure from the ISR to the r…
noxuz Apr 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 66 additions & 0 deletions S32K/README.md
@@ -0,0 +1,66 @@
# S32K Libuavcan V1
### Bare-metal media layer driver for the NXP S32K14x family of automotive-grade microcontrollers, featuring CAN-FD running at 4 Mb/s and 1 Mb/s in data and nominal phases, respectively.
An example project of it's usage for custom applications, and file dependencies used, is available in this **[Demo.](https://github.com/noxuz/libuavcan_demo)**
| Peripheral used by this driver | Resources utilized |
| ------------- | ------------- |
| LPIT | Channels 0,1 and 2, 3rd channel is available |
| FlexCAN | All message buffers from each instance; the frame's reception interrupt handler is enabled and its priority is set to default, could be modified to meet application-specific requirements |


| Clocks in Normal RUN | Frequency set |
| ------------- | ------------- |
| CORE_CLK | 80Mhz |
| SYS_CLK | 80Mhz |
| BUS_CLK | 40Mhz |
| FLASH_CLK | 26.67Mhz |

| Asynchronous peripheral clock sources | Divider value |
| ------------- | ------------- |
| SPLLDIV2 | 1 |

*Asynchronous clock dividers not mentioned are left unset and SCG registers are locked after initial setup.*
<br/>
<br/>
| Peripheral's functional clock | Source and frequency |
| ------------- | ------------- |
| LPIT | SPLLDIV2 @ 80Mhz |
| FlexCAN | SYS_CLK @ 80Mhz |

| Pin location | MUX |
| ------------- | ------------- |
| PTE4 | CAN0 RX |
| PTE5 | CAN0 TX |
| PTA12 | CAN1 RX |
| PTA13 | CAN1 TX |
| PTB12 | CAN2 RX |
| PTB13 | CAN2 TX |
| PTE10 | CAN0 STB° (GPIO) |
| PTE11 | CAN1 STB° (GPIO) |

*° UAVCAN UCANS32K146 node board-only setup, which uses the TJA1044 transceiver featuring standby (STB) mode.*

*S32K146 and S32K148 although having multiple CAN-FD capable FlexCAN instances, their evaluation boards (EVB's) have
only one transceiver, the other instances's digital signals do are set, to the board's pin headers.*
<br/>
<br/>
#### Creating the Interface Group:
```
/* Instantiate factory object */
libuavcan::media::S32K_InterfaceManager demo_Manager;

/* Create pointer to Interface object */
libuavcan::media::S32K_InterfaceGroup* demo_InterfacePtr;

/* Initialize the node with the previously defined filtering using factory method */
status = demo_Manager.startInterfaceGroup(&demo_Filter,Node_Filters_Count,demo_InterfacePtr);
noxuz marked this conversation as resolved.
Show resolved Hide resolved
```
<br/>
<br/>

**For further details consult the S32K1 reference manual [here.](https://www.nxp.com/webapp/Download?colCode=S32K1XXRM)**
![alt text](https://s3-prod-europe.autonews.com/s3fs-public/NXP_logo%20web.jpg)
### Copyright© 2020, NXP. All rights reserved.