diff --git a/.gitignore b/.gitignore index 3117d20..5837aff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,12 @@ -# Untracked files in MPLABX projects -/**/build/* -/**/nbproject/* -!/**/nbproject/*.xml -/**/[Ff]ree/production/* -/**/[Pp]ro/production/* -/**/.generated_files/* - -# Uncomment these to include hex/elf files -#!/**/[Ff]ree/production/*.hex -#!/**/[Ff]ree/production/*.elf -#!/**/[Pp]ro/production/*.hex -#!/**/[Pp]ro/production/*.elf \ No newline at end of file +/*/dist/ +/*/debug/ +/*/build/ +/*/nbproject/private/ +/*/nbproject/*.properties +/*/nbproject/*.mk +/*/nbproject/*.bash +**/*.bak +**/*.o +**/*.d +**/*.elf +**/*.map diff --git a/.main-meta/main.json b/.main-meta/main.json index 5a65df8..691a367 100644 --- a/.main-meta/main.json +++ b/.main-meta/main.json @@ -2,29 +2,29 @@ "metaDataVersion": "1.0.0", "category": "com.microchip.ide.project", "content": { - "metaDataVersion": "1.1.0", + "metaDataVersion": "1.3.0", "name": "com.microchip.mcu8.mplabx.project.avr128da48-cnano-ws2812-mplab-mcc", - "version": "1.0.1", - "displayName": "RGB lighting with WS2812 using SPI and CCL", + "version": "1.0.2", + "displayName": "RGB lighting with WS2812 using AVR128DA48 Microcontroller with MCC Melody", "projectName": "avr128da48-cnano-ws2812-mplab-mcc", - "shortDescription": "This repository contains an MCC generated code example that interfaces the WS2812 RGB LED with AVR128DA48 microcontroller using CCL, SPI, TCA and EVSYS.", + "shortDescription": "This repository provides an MPLAB® X project with an MPLAB® Code Configurator (MCC) generated code example for interfacing the CCL (Configurable Custom Logic) and SPI (Serial Peripheral Interface) peripherals with the WS2812 LED.", "ide": { "name": "MPLAB X", - "semverRange": ">=5.40.0" + "semverRange": ">=6.10.0" }, "compiler": [ { "name": "XC8", - "semverRange": "^2.30.0" + "semverRange": "^2.41.0" } ], "dfp": { "name": "AVR-Dx", - "semverRange": "1.6.88" + "semverRange": "^2.3.272" }, "configurator": { "name": "MCC", - "semverRange": "4.0.1" + "semverRange": ">=5.3.7" }, "device": { "metaDataVersion": "1.0.0", @@ -37,16 +37,10 @@ } }, "author": "Microchip", - "subcategories": [ - [ - "Peripherals", - "CCL" - ] - ], "peripherals": [ - "CCL" + "CCL", "TCA", "SPI", "EVSYS", "GPIO" ], - "keywords": [ "WS2812", "RGB LED", "RGB lighting" + "keywords": [ "WS2812/11", "RGB LED", "RGB lighting", "AVR128DA48" ], "additionalData": { "longDescription": { diff --git a/README.md b/README.md index e5af0b9..fd8798c 100644 --- a/README.md +++ b/README.md @@ -1,109 +1,140 @@ -[![MCHP](images/microchip.png)](https://www.microchip.com) + -# AVR128DA48 RGB lighting with WS2812 using SPI and CCL +MCHP -This repository provides an MPLAB® X project with an MPLAB® Code Configurator (MCC) generated code example for interfacing the CCL and SPI peripherals with the WS2812 LED. -
The messages compatible with the WS2812 LED are formed from ones and zeros with a specific duration and form. The application translates the messages sent by SPI into messages intelligible by WS2812, using CCL. -
Furthermore, it creates a light game on a WS2812 LED band. -
The peripherals used are: -- Serial Peripheral Interface (SPI) -- Configurable Custom Logic (CCL) -- Timer/Counter Type A (TCA) -- Event System (EVSYS) +# RGB lighting with WS2812 using AVR128DA48 Microcontroller with MCC Melody + +This repository provides an MPLAB® X project with an MPLAB® Code Configurator (MCC) generated code example for interfacing the CCL (Configurable Custom Logic) and SPI (Serial Peripheral Interface) peripherals with the WS2812 LED. The messages compatible with the WS2812 LED are formed from ones and zeros with a specific duration and form. The application translates the messages sent by SPI into messages intelligible by WS2812, using CCL. Furthermore, it creates a light game on a WS2812 LED band. ## Related Documentation + More details and code examples on the AVR128DA48 can be found at the following links: + - [AVR128DA48 Product Page](https://www.microchip.com/wwwproducts/en/AVR128DA48) - [AVR128DA48 Code Examples on GitHub](https://github.com/microchip-pic-avr-examples?q=avr128da48) -- [AVR128DA48 Project Examples in START](https://start.atmel.com/#examples/AVR128DA48CuriosityNano) -- [WS2812 Datasheet](https://cdn-shop.adafruit.com/datasheets/WS2812.pdf) - +- [WS2812 Datasheet](https://www.tme.com/Document/1d930d9b83e8cce43e5d1c490ab0fbe8/WS2818A.pdf) ## Software Used -- MPLAB® X IDE 5.40 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide) -- MPLAB® XC8 2.30 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers) -- MPLAB® Code Configurator (MCC) 4.0.1 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator) -- MPLAB® Code Configurator (MCC) Device Libraries 8-bit AVR MCUs 2.5.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator) -- AVR-Dx 1.6.88 or newer Device Pack +- [MPLAB® X IDE](http://www.microchip.com/mplab/mplab-x-ide) v6.10 or newer +- [MPLAB® XC8](http://www.microchip.com/mplab/compilers) v2.41 or newer +- [AVR-Dx Series Device Pack](https://packs.download.microchip.com/) v2.3.272 or newer ## Hardware Used -- AVR128DA48 Curiosity Nano [(DM164151)](https://www.microchip.com/Developmenttools/ProductDetails/DM164151) -- LED Stripe WS2812 -- 12V Charger/Voltage Source for the LEDs -## Setup -The AVR128DA48 Curiosity Nano Development Board is used as test platform. -
- -The following configurations must be made for this project: - -System clock: 24 MHz - -SPI0: -- Mode: Host -- Clock frequency: 750 kHz - -LUT0: -- IN0: TCA0-WO0 -- IN1: SPI-CLK -- IN2: TCA0-WO2 -- TRUTH table: 0xE0 -- Clock source: CLKPER - -TCA0: -- Single-slope PWM mode -- Compare channel 0: enabled -- Compare channel 2: enabled -- Channel 0 waveform duty cycle: 0.4% -- Channel 2 waveform duty cycle: 0.7% -- Period: 100 us - -EVSYS: -- Event Generators: - - SPI0_CLK: CHANNEL0 -- Event Users: - - CHANNEL 0: TCA0CNTB - - -|Pin | Configuration | -| :--------------: | :----------------: | -|PA0 (TCA0-WO0) | Digital Output | -|PA2 (TCA0-WO2) | Digital Output | -|PA3 (LUT0_OUT) | Digital Output | -|PA4 (SPI0-MOSI) | Digital Output | -|PA6 (SPI0-CLK) | Digital Output | - -
**Note:** Only PA3(LUT0_OUT) will be used to transmit data to the WS2812 LED. The rest of the pins are routed outside for visualization of intermediary signals. +- AVR128DA48 Curiosity Nano Development Board is used as a test platform. +
+- WS2812 LED Stripe +- 12V Charger / Voltage Source for the LEDs ## Operation - 1. Connect the board to the PC. - 2. Open the avr128da48-cnano-ws2812-mplab-mcc.X project in MPLAB® X IDE. +To program the Curiosity Nano board with this MPLAB X project, follow the steps provided in the [How to Program the Curiosity Nano Board](#how-to-program-the-curiosity-nano-board) chapter.
- 3. Set the avr128da48-cnano-ws2812-mplab-mcc.X project as main project. Right click the project in the **Projects** tab and click **Set as Main Project**. -
+## Setup - 4. Clean and build the avr128da48-cnano-ws2812-mplab-mcc.X project: right click the **avr128da48-cnano-ws2812-mplab-mcc.X** project and select **Clean and Build**. -
+The following peripheral and clock configurations are set up using MCC Melody for the AVR128DA48: - 5. Select **AVR128DA48 Curiosity Nano** in the Connected Hardware Tool section of the project settings: - - Right click the project and click **Properties**; - - Click the arrow right next to Connected Hardware Tool; - - Select AVR128DA48 Curiosity Nano (click the **SN**), click **Apply** and then click **OK**: +- CLKCTRL: + - Clock Selection: Internal high-frequency oscillator + - Internal Oscillator Frequency: 1-32MHz internal oscillator + - Oscillator Frequency Selection: 24 MHz system clock -
+- SPI0: + - Enable SPI: Enabled + - Modes: Host + - SPI Mode: 1 + - Desired Clock Speed (Hz): 750000 (750 kHz) - 6. Program the project to the board: right click the project and click **Make and Program Device**. -
+- CCL: + - Enable CCL: Enabled + - LUT0: + - Enable LUT: Enabled + - Enable LUT Output: Enabled + - Input 0: TCA0 (WO0) + - Input 1: SPI0 (MOSI) + - Input 2: TCA0 (WO2) + - Gate Type: Custom + - Output Result: 0xE0 -Demo: -
The output waveforms are shown in the figure below. SPI_MOSI is the data sent through SPI and the LUT0_OUT is the translated message, intelligible by WS2812 LED. -
+- TCA0: + - Enable Timer: Enabled + - Clock Selection: System Clock + - Timer Mode: 16 Bit (Normal) + - Count Direction: UP + - Requested Timeout (s): 0.0001 (100 μs) + - Enable Count on Event Input B: Enabled + - Event Action B: Restart on Positive Event Edge + - Waveform Generation Mode: Single Slope PWM + - Enable Channel 0: Enabled + - Enable Channel 2: Enabled + - Duty Cycle 0 (%): 0.4% + - Duty Cycle 2 (%): 0.7% + +- EVSYS: + - Generators: SPI0_SCK -> CHANNEL0 + - Users: CHANNEL0 -> TCA0CNTB + - Routing: SPI0_SCK -> CHANNEL0 -> TCA0CNTB + +| Pin | Configuration | +| :--------------: | :-------------: | +|PA0 (TCA0 WO0) | Digital Output | +|PA2 (TCA0 WO2) | Digital Output | +|PA3 (LUT0 OUT) | Digital Output | +|PA4 (SPI0 MOSI) | Digital Output | +|PA6 (SPI0 SCK) | Digital Output | +|PA7 (SPI0 SS) | Digital Output | + +**Note:** Only PA3 (LUT0 OUT) will be used to transmit data to the WS2812 LED. The rest of the pins are routed outside for visualization of intermediary signals. + +## Demo + +The output waveforms are shown in the figure below. SPI MOSI is the data sent through SPI and the LUT0 OUT is the translated message, intelligible by WS2812 LED. + +
The light game is created on a LED strip which allows control of LEDs in groups of 3. The LED groups are lit from one end to another continuously. -
-
**Note:** The number of LEDs (groups of LEDs) must be configured in firmware. See `NUMBER_OF_LEDS` macro define. + +
+ +**Note:** The number of LEDs (groups of LEDs) must be configured in firmware. See `NUMBER_OF_LEDS` macro define. ## Summary + The demo shows how to interface WS2812 LED with the SPI peripheral using CCL and TCA. + +## How to Program the Curiosity Nano board + +This chapter shows how to use the MPLAB X IDE to program an AVR® device with an Example_Project.X. This can be applied for any other projects. + +- Connect the board to the PC. + +- Open the Example_Project.X project in MPLAB X IDE. + +- Set the Example_Project.X project as main project. + + - Right click on the project in the **Projects** tab and click **Set as Main Project**. +
+ +- Clean and build the Example_Project.X project. + + - Right click on the **Example_Project.X** project and select **Clean and Build**. +
+ +- Select the **AVRxxxxx Curiosity Nano** in the Connected Hardware Tool section of the project settings: + + - Right click on the project and click **Properties** + - Click on the arrow under the Connected Hardware Tool + - Select the **AVRxxxxx Curiosity Nano** (click on the **SN**), click **Apply** and then click **OK**: +
+ +- Program the project to the board. + - Right click on the project and click **Make and Program Device**. +
+ +
+ +- [Back to Setup](#setup) +- [Back to Demo](#demo) +- [Back to Summary](#summary) +- [Back to Top](#rgb-lighting-with-ws2812-using-avr128da48-microcontroller-with-mcc-melody) \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/MyConfig.mc3 b/avr128da48-cnano-ws2812-mplab-mcc.X/MyConfig.mc3 deleted file mode 100644 index 0556723..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/MyConfig.mc3 +++ /dev/null @@ -1,16208 +0,0 @@ - - - - SPI0 - class com.microchip.mcc.mcu8.modules.spi.tiny_mega_init.SPI - - - CPUINT - class com.microchip.mcc.mcu8.interruptManager.cpuint.CPUINT - - - WDT - class com.microchip.mcc.mcu8.systemManager.tiny_mega_init.wdt.WDT - - - EVSYS - class com.microchip.mcc.mcu8.modules.evsys.avr_da.EVSYS - - - Pin Module - class com.microchip.mcc.mcu8.pinManager.PinManager - - - CPU - class com.microchip.mcc.mcu8.systemManager.tiny_mega_init.cpu.CPU - - - CCL - class com.microchip.mcc.mcu8.modules.ccl.tiny_mega_init.CCL - - - System Module - class com.microchip.mcc.mcu8.systemManager.SystemManager - - - BOD - class com.microchip.mcc.mcu8.systemManager.tiny_mega_init.bod.BOD - - - TCA0 - class com.microchip.mcc.mcu8.modules.tca.tiny_mega_init.TCA - - - SLPCTRL - class com.microchip.mcc.mcu8.systemManager.tiny_mega_init.slpctrl.SLPCTRL - - - RSTCTRL - class com.microchip.mcc.mcu8.systemManager.tiny_mega_init.rstctrl.RSTCTRL - - - CLKCTRL - class com.microchip.mcc.mcu8.systemManager.tiny_mega_init.clkctrl.CLKCTRL - - - Interrupt Manager - class com.microchip.mcc.mcu8.interruptManager.InterruptManager - - - - - - - - - 3 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 12 - - - - 2 - - - - 2 - - - - 1 - - - - 176 - - - - 0 - - - - 1 - - - - 8 - - - - 0 - - - - 13 - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - 3 - - - - 0 - - - - 1 - - - - 11 - - - - 10 - - - - 0 - - - - 0 - - - - 0 - - - - 4 - - - - 0 - - - - 0 - - - - 140 - - - - 0 - - - - 0 - - - - LUT0_OUT0_DEF - - - - disabled - - - - 13 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 1 - - - - disabled - - - - disabled - - - - 33 - - - - disabled - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - disabled - - - - 165 - - - - 0 - - - - ISR_TCA0_CMP0I - - - - 0 - - - - disabled - - - - disabled - - - - 0 - - - - disabled - - - - 2 - - - - 1.00 - - - - 9 - - - - 1 - - - - 1 - - - - CLKPER - - - - disabled - - - - disabled - - - - 7 - - - - Disabled - - - - 0 s - - - - 3 - - - - 134 - - - - 1 - - - - 1 - - - - 0 - - - - OSCHF - - - - alternate - - - - true - - - - INTDISABLE - - - - alternate - - - - alternate - - - - 162 - - - - disabled - - - - 1 - - - - alternate - - - - 137 - - - - 0 - - - - 105 - - - - 0 - - - - 3 - - - - 0 - - - - OFF - - - - 0 - - - - 3 - - - - false - - - - 5 - - - - 1 - - - - disabled - - - - 0 - - - - 100 - - - - 0 - - - - 133 - - - - disabled - - - - 0 - - - - 4 - - - - 1 - - - - 1 - - - - 8 - - - - disabled - - - - 0 - - - - 0 - - - - 1 - - - - 1 - - - - 2 - - - - 0 - - - - 1 - - - - 0 - - - - 2 - - - - 0 - - - - SPI Mode 1 - - - - 2 - - - - disabled - - - - 3 - - - - 21 - - - - 19 - - - - 20 - - - - 17 - - - - 5 - - - - 18 - - - - 16 - - - - 1 - - - - 3 - - - - 140 - - - - 1 - - - - 0 - - - - OFF - - - - 5 - - - - 1 - - - - disabled - - - - INTDISABLE - - - - INTDISABLE - - - - 9 - - - - 1 - - - - 0 - - - - 1 - - - - 0 - - - - 0 - - - - 2 - - - - 3 - - - - 160 - - - - 1 - - - - 6 - - - - 48 - - - - 49 - - - - 1 - - - - 12 - - - - 9 - - - - 8 - - - - INTDISABLE - - - - 0 - - - - 10 - - - - 1 - - - - 11 - - - - 1 - - - - 0 - - - - 3 - - - - 0 - - - - 11 - - - - 10 - - - - 0 - - - - SINGLESLOPE - - - - 2 - - - - disabled - - - - 0 - - - - disabled - - - - - - - - 128 - - - - disabled - - - - 1 - - - - disabled - - - - 1 - - - - 0 - - - - 8 - - - - 0 - - - - false - - - - 4 - - - - 165 - - - - 105 - - - - 33 - - - - true - - - - 0 - - - - 0 - - - - disabled - - - - disabled - - - - 97 - - - - disabled - - - - 0 - - - - 1 - - - - 2399 - - - - false - - - - 0 - - - - 3 - - - - 0 - - - - alternate - - - - 0 - - - - 0 - - - - 0 Hz - - - - OFF - - - - disabled - - - - 3 - - - - 100 - - - - 0 - - - - 8 - - - - 24000000 - - - - 12 - - - - OFF - - - - 0 - - - - 2 - - - - 0 - - - - 8 - - - - 7 - - - - 10 - - - - 9 - - - - false - - - - disabled - - - - 2 - - - - 1 - - - - 4 - - - - OFF - - - - 3 - - - - 6 - - - - 5 - - - - 4 - - - - disabled - - - - 3 - - - - 2 - - - - 1 - - - - 0 - - - - disabled - - - - 34 - - - - 100 - - - - 3 - - - - 0 - - - - CLKPER - - - - disabled - - - - 21 - - - - 20 - - - - 19 - - - - 18 - - - - 17 - - - - 16 - - - - 132 - - - - 5 - - - - 5 - - - - 0 - - - - 1 - - - - 4 - - - - 1 - - - - 0 - - - - 133 - - - - 0 Hz - - - - 6 - - - - disabled - - - - 0 - - - - 2 - - - - 1 - - - - 164 - - - - 97 - - - - 0 - - - - 0 - - - - disabled - - - - 104 - - - - 0 - - - - 4 - - - - 8 - - - - disabled - - - - 1 - - - - 2 - - - - 64 - - - - 128 - - - - 16 - - - - 0 s - - - - 32 - - - - 167 - - - - 5 - - - - 4 - - - - 7 - - - - 6 - - - - 6 - - - - 9 - - - - 8 - - - - 163 - - - - 10 - - - - - - - - 0 - - - - 1 - - - - 3 - - - - 1 - - - - 36 - - - - OFF - - - - disabled - - - - 0 - - - - INTDISABLE - - - - 1 - - - - INTDISABLE - - - - 3 - - - - 2 - - - - 1 - - - - 136 - - - - 4 - - - - 1 - - - - false - - - - 0 - - - - OFF - - - - 0 - - - - disabled - - - - 142 - - - - 8 - - - - 1 - - - - 0 - - - - 0 - - - - 1 - - - - INTDISABLE - - - - 1 - - - - 0 - - - - 10 - - - - 36 - - - - 6 - - - - 7 - - - - 6 - - - - 9 - - - - disabled - - - - 2 - - - - 8 - - - - 3 - - - - 2 - - - - 5 - - - - 4 - - - - 11 - - - - WO0_DEF - - - - 4 - - - - 8 - - - - disabled - - - - 166 - - - - 0 - - - - 0 - - - - 5 - - - - 0 - - - - 6 - - - - 1 - - - - 1 - - - - 1 - - - - 0 - - - - 6 - - - - 0 - - - - disabled - - - - 1 - - - - 0 - - - - 3 - - - - 1 - - - - 4 - - - - 0 - - - - 1 - - - - 9 - - - - 141 - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - 1 - - - - DEFAULT - - - - 0 - - - - 72 - - - - 73 - - - - 74 - - - - 75 - - - - 76 - - - - 77 - - - - 78 - - - - 11 - - - - 0 - - - - OFF - - - - ISR_TCA0_LCMP0I - - - - 129 - - - - 0 - - - - 164 - - - - 0 - - - - NONE - - - - INTDISABLE - - - - CCL - - - - 0 - - - - 0 - - - - 1 - - - - 0 - - - - 0 - - - - 34 - - - - 2 - - - - 0 - - - - 0 - - - - 5 - - - - 5 - - - - INTDISABLE - - - - 0 - - - - 142 - - - - 1 - - - - 4 - - - - 0 - - - - 1 - - - - 0 - - - - 4 - - - - 4 - - - - 1 - - - - 0 - - - - 1 - - - - 0 - - - - 9 - - - - 1 - - - - 0 - - - - OFF - - - - 5 - - - - 1 - - - - 0 - - - - 0 - - - - 178 - - - - WO3_DEF - - - - 1 - - - - 0 - - - - 4 - - - - 9 - - - - 0 - - - - 0 - - - - 49 - - - - 0 - - - - 99 - - - - 48 - - - - 7 - - - - 137 - - - - 0 - - - - 40 - - - - disabled - - - - 1 - - - - 1 - - - - 1 - - - - 179 - - - - 1 - - - - 3 - - - - ISR_CCL_INT1 - - - - 2 - - - - 32 - - - - 166 - - - - 96 - - - - 0 - - - - 1 - - - - 0 - - - - INTDISABLE - - - - 0 - - - - 2 - - - - 2 - - - - 3 - - - - 4 - - - - 1 - - - - 1 - - - - 163 - - - - 177 - - - - 100 - - - - 0 - - - - - - - - - - - - - - - - - - - - 1 - - - - 0 Hz - - - - 48 - - - - 49 - - - - 0 - - - - 24000000 - - - - - - - - 0 - - - - - - - - disabled - - - - - - - - - - - - - - - - 4 - - - - - - - - - - - - - - - - - - - - 140 - - - - 0 - - - - - - - - 1 - - - - 3 - - - - 4 - - - - 1.00 - - - - 166 - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - 0 - - - - 0 - - - - 12 - - - - 165 - - - - 0 - - - - 3 - - - - 1 - - - - 1 - - - - 0 - - - - - - - - 0 - - - - - - - - - - - - 5 - - - - - - - - DIS - - - - - - - - 21 - - - - - - - - 19 - - - - 36 - - - - 20 - - - - - - - - 0 - - - - 17 - - - - - - - - 0 - - - - 6 - - - - 18 - - - - 16 - - - - 24M - - - - 1 - - - - 98 - - - - disabled - - - - 0 - - - - 2 - - - - 0 - - - - - - - - - - - - - - - - MASK - - - - - - - - - - - - - - - - disabled - - - - 1 - - - - 2 - - - - 105 - - - - 0 - - - - 1 - - - - 10 - - - - 0 - - - - 6 - - - - false - - - - disabled - - - - disabled - - - - 0.00 - - - - 0 - - - - - - - - - - - - - - - - - - - - MASK - - - - 0 - - - - disabled - - - - 2 - - - - 133 - - - - 0 - - - - 10 - - - - 5 - - - - 6 - - - - 1 - - - - 7 - - - - 8 - - - - 1 - - - - 96 - - - - 1 - - - - 2 - - - - alternate - - - - 3 - - - - 4 - - - - - - - - - - - - 9 - - - - - - - - 10 - - - - - - - - 1 - - - - - - - - 0 - - - - 8 - - - - 1 - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - MASK - - - - disabled - - - - disabled - - - - 0 - - - - QFN48 - - - - 1 - - - - 0 - - - - 3 - - - - 161 - - - - 0 - - - - 3 - - - - 128 - - - - disabled - - - - 10 - - - - 0 - - - - disabled - - - - 104 - - - - 9 - - - - INTDISABLE - - - - disabled - - - - 1 - - - - 21 - - - - 20 - - - - 19 - - - - 18 - - - - 2 - - - - 17 - - - - 16 - - - - true - - - - disabled - - - - 40 - - - - 2 - - - - 1 - - - - false - - - - 5 - - - - 4 - - - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 5 - - - - 176 - - - - 6 - - - - 7 - - - - 0 - - - - 8 - - - - 9 - - - - 4 - - - - 5 - - - - 0 - - - - 1 - - - - 1 - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - INTDISABLE - - - - 4 - - - - 0 - - - - 49 - - - - 48 - - - - 178 - - - - disabled - - - - disabled - - - - CHANNEL0 - - - - 132 - - - - 0 - - - - disabled - - - - 0 s - - - - DISABLE - - - - 1 - - - - false - - - - 1 - - - - 1 - - - - 100 - - - - 11 - - - - disabled - - - - 128HZ - - - - 3 - - - - 4 - - - - 4 - - - - 0 - - - - 6 - - - - 0 - - - - 129 - - - - 134 - - - - 3 - - - - 5 - - - - 0 - - - - false - - - - 33 - - - - 3 - - - - 6 - - - - 162 - - - - 9 - - - - 137 - - - - INTDISABLE - - - - 2 - - - - 0 - - - - 0 - - - - 0 - - - - disabled - - - - NONE - - - - 0 - - - - 4 - - - - 2.731 ms - - - - disabled - - - - 3 - - - - 0 - - - - 5 - - - - OFF - - - - 1 - - - - disabled - - - - 0 - - - - 0 - - - - 1 - - - - 1 - - - - 0 - - - - 0 Hz - - - - 1 - - - - 0 - - - - disabled - - - - 5 - - - - 1 - - - - disabled - - - - 1 - - - - 1K - - - - disabled - - - - 1 - - - - 160 - - - - DIS - - - - 9 - - - - disabled - - - - ISR_TCA0_LUNFI - - - - 0 - - - - 1 - - - - 0 - - - - alternate - - - - 0 - - - - - - - - 7 - - - - 1 - - - - SPM - - - - 0 - - - - 8 - - - - 7 - - - - 6 - - - - 5 - - - - 4 - - - - 3 - - - - 2 - - - - 1 - - - - disabled - - - - alternate - - - - disabled - - - - enabled - - - - 5 - - - - 0 - - - - 1 - - - - 97 - - - - 0 - - - - 1 - - - - 8 - - - - 0 s - - - - LUT2_OUT0_DEF - - - - 1 - - - - 10 - - - - 0 - - - - 72 - - - - 73 - - - - 74 - - - - 75 - - - - 76 - - - - 77 - - - - 1 - - - - 78 - - - - 1 - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - true - - - - 1 - - - - 10 - - - - 9 - - - - 1 - - - - 9 - - - - 8 - - - - disabled - - - - 7 - - - - 6 - - - - 0 - - - - disabled - - - - 10 - - - - 1 - - - - PORTA - - - - 5 - - - - 5 - - - - 4 - - - - 3 - - - - 2 - - - - 0 - - - - 0 - - - - 9 - - - - 163 - - - - 13 - - - - 0 - - - - 5 - - - - 33 - - - - false - - - - 100 - - - - 0 - - - - 165 - - - - 0 - - - - 0 - - - - 0 - - - - 98 - - - - 0 - - - - 0 - - - - 1 - - - - PORTB - - - - 0 - - - - 100 - - - - 141 - - - - 2 - - - - 1 - - - - 0 - - - - 134 - - - - 0 - - - - OFF - - - - 0 - - - - DISABLE - - - - 0 - - - - 3 - - - - 67 - - - - 66 - - - - 4 - - - - 65 - - - - 0 - - - - ISR_CCL_INT2 - - - - 0 - - - - 0 s - - - - 64 - - - - 0 - - - - 0 - - - - 1 - - - - 0 - - - - 179 - - - - 0 - - - - OFF - - - - disabled - - - - 97 - - - - 0 - - - - 0 s - - - - 0 - - - - 2 - - - - 3 - - - - 0 - - - - 750000.0 - - - - 0 Hz - - - - 3 - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - 1 - - - - 0 - - - - 0 - - - - 0 - - - - 1 - - - - 1 - - - - 3 - - - - 0 - - - - 141 - - - - 0 - - - - disabled - - - - 5 - - - - 164 - - - - 6 - - - - 3 - - - - 4 - - - - 3 - - - - 9 - - - - 105 - - - - 3 - - - - disabled - - - - 10 - - - - 7 - - - - false - - - - 8 - - - - 11 - - - - 0 Hz - - - - 100.00 - - - - 0 - - - - 140 - - - - 2 - - - - 7 - - - - 1 - - - - 2 - - - - INTDISABLE - - - - 16 - - - - 0 - - - - 2 - - - - 5 - - - - 0 - - - - 1 - - - - 6 - - - - 3 - - - - 4 - - - - 9 - - - - 2 - - - - 1 - - - - 10 - - - - 4 - - - - 7 - - - - 8 - - - - disabled - - - - 0 - - - - disabled - - - - 1 - - - - 2 - - - - 150 - - - - 2 - - - - 0 - - - - 5 - - - - 6 - - - - 0 - - - - 165 - - - - 4 - - - - 1 - - - - 34 - - - - 1 - - - - 2 - - - - 1 - - - - 0 - - - - 0 - - - - 142 - - - - 1 - - - - 1 - - - - INTDISABLE - - - - 8 - - - - 7 - - - - 10 - - - - 9 - - - - 4 - - - - 3 - - - - 9 - - - - 6 - - - - 5 - - - - 1 - - - - 1 - - - - 0 - - - - 7 - - - - 0 - - - - 0 - - - - 5 - - - - 4 - - - - 0 - - - - 3 - - - - 3 - - - - 1 - - - - 2 - - - - 1 - - - - disabled - - - - 10 - - - - 9 - - - - 8 - - - - 7 - - - - 6 - - - - false - - - - INTDISABLE - - - - 7 - - - - 100 - - - - 0 - - - - 166 - - - - 1 - - - - 8 - - - - 5 - - - - 1 - - - - 7 - - - - 3 - - - - disabled - - - - VLM Disabled - - - - 1 - - - - disabled - - - - 3 - - - - 0 - - - - 40 - - - - 2 - - - - 0 - - - - none - - - - none - - - - none - - - - none - - - - none - - - - 0 - - - - 0 - - - - 2 - - - - 177 - - - - CLKPER - - - - 95 - - - - 1 - - - - 0 - - - - disabled - - - - 1 - - - - 1 - - - - 10 - - - - 104 - - - - 164 - - - - disabled - - - - disabled - - - - none - - - - 0 - - - - none - - - - DIS - - - - 34 - - - - disabled - - - - OFF - - - - 1 - - - - 0 - - - - ISR_TCA0_CMP1I - - - - 5 - - - - 3 - - - - 1 - - - - 9 - - - - TCA0 - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - 0 - - - - 4 - - - - 0 - - - - 0.00 - - - - 0 - - - - 136 - - - - 5 - - - - 0 - - - - 0 - - - - 2 - - - - 5 - - - - 0 - - - - 0 - - - - 49 - - - - 48 - - - - 142 - - - - 0 - - - - none - - - - 1 - - - - false - - - - 2 - - - - OFF - - - - 5 - - - - 4 - - - - 2 - - - - 7 - - - - INTDISABLE - - - - 6 - - - - 1 - - - - 3 - - - - 2 - - - - none - - - - none - - - - none - - - - none - - - - 8 - - - - none - - - - 1 - - - - none - - - - none - - - - 2 - - - - none - - - - 99 - - - - none - - - - false - - - - none - - - - 0 - - - - 3 - - - - 4 - - - - 0 - - - - 9 - - - - 8 - - - - 10 - - - - DISABLE - - - - 132 - - - - enabled - - - - 1 - - - - 1 - - - - 3 - - - - none - - - - 0 - - - - none - - - - none - - - - none - - - - 0 - - - - none - - - - none - - - - 0 - - - - none - - - - none - - - - 4 - - - - 3 - - - - 4 - - - - 5 - - - - 1 - - - - OFF - - - - 0 - - - - 166.7 ns - - - - 2 - - - - 2.731 ms - - - - INTDISABLE - - - - none - - - - none - - - - 3 - - - - 166.7 ns - - - - none - - - - 36 - - - - none - - - - none - - - - none - - - - none - - - - 1 - - - - none - - - - none - - - - none - - - - 1 - - - - disabled - - - - 40 - - - - 1 - - - - 0 - - - - 0 - - - - 2 - - - - 1 - - - - 0 - - - - 0 - - - - 32 - - - - 0 - - - - none - - - - 0 - - - - none - - - - none - - - - none - - - - none - - - - 5 - - - - 7 - - - - disabled - - - - 6 - - - - 5 - - - - 0 - - - - 4 - - - - 3 - - - - 2 - - - - 1 - - - - disabled - - - - 11 - - - - disabled - - - - 10 - - - - 0 - - - - 1 - - - - 9 - - - - 129 - - - - 6 - - - - 5 - - - - 8 - - - - 7 - - - - 2 - - - - 0 - - - - 1 - - - - 4 - - - - 3 - - - - 104 - - - - disabled - - - - 1 - - - - 167 - - - - - - - - 6 - - - - 136 - - - - 0 - - - - disabled - - - - 177 - - - - 2 - - - - INTDISABLE - - - - 0 - - - - 0 - - - - 2 - - - - 10 - - - - 2 - - - - 9 - - - - 8 - - - - 0 - - - - 1 - - - - 0 - - - - 2 - - - - EVSYS - - - - alternate - - - - 98 - - - - 96 - - - - 0 - - - - - - - - 0 - - - - 0 - - - - 3 - - - - false - - - - 1 - - - - disabled - - - - 0 - - - - 0 - - - - 166 - - - - 1 - - - - 0 - - - - 0 - - - - 0 - - - - 1 - - - - 5 - - - - 4 - - - - 5 - - - - 6 - - - - 7 - - - - 0 - - - - 10 - - - - 1 - - - - 2 - - - - 0 - - - - 3 - - - - disabled - - - - 0 - - - - 0 - - - - 8 - - - - 9 - - - - 10 - - - - 6 - - - - 1 - - - - 1 - - - - 0 - - - - 0 - - - - 0 - - - - 1 - - - - 11 - - - - 1 - - - - 141 - - - - 800000 - - - - 4 - - - - 2 - - - - disabled - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - 7 - - - - 163 - - - - 216 - - - - 0 s - - - - 40 - - - - 5 - - - - 0 - - - - 0 - - - - 176 - - - - false - - - - alternate - - - - alternate - - - - 0 - - - - alternate - - - - 6 - - - - alternate - - - - 2 - - - - 5 - - - - 0 - - - - 4 - - - - 0 - - - - 0 - - - - 0 - - - - 2 - - - - 1 - - - - 1 - - - - 0 - - - - 1 - - - - 8 - - - - 7 - - - - 0 - - - - 178 - - - - 1 - - - - disabled - - - - disabled - - - - disabled - - - - 0 - - - - 0 - - - - 1 - - - - disabled - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - 132 - - - - 100.00 - - - - 0 - - - - disabled - - - - 0 - - - - 1 - - - - 0 - - - - 2 - - - - 3 - - - - 4 - - - - OFF - - - - 32 - - - - 5 - - - - 165 - - - - 7 - - - - 1 - - - - 1 - - - - 1 - - - - 10 - - - - disabled - - - - 9 - - - - 160 - - - - 2 - - - - OFF - - - - 8 - - - - 8 - - - - 7 - - - - 129 - - - - 2 - - - - 6 - - - - 5 - - - - 3 - - - - 4 - - - - 105 - - - - 3 - - - - 1 - - - - 3 - - - - 1 - - - - 68 - - - - 6 - - - - 67 - - - - 7 - - - - 6 - - - - 66 - - - - 8 - - - - 65 - - - - 9 - - - - 64 - - - - 10 - - - - INTDISABLE - - - - 71 - - - - 70 - - - - 69 - - - - 7 - - - - 0 - - - - disabled - - - - 0 - - - - 2 - - - - 5 - - - - 5 - - - - 162 - - - - - - - - 0 - - - - 1 - - - - disabled - - - - 3 - - - - enabled - - - - 0 - - - - 140 - - - - 0 - - - - 13 - - - - 3 - - - - 1 - - - - 2 - - - - disabled - - - - 1 - - - - 0 - - - - 0 - - - - disabled - - - - disabled - - - - DEFAULT - - - - 0 - - - - 1 - - - - 1 - - - - 1 - - - - 33 - - - - 178 - - - - DIV64 - - - - 0 - - - - 1 - - - - 8 - - - - 0 - - - - 3 - - - - 3 - - - - 0 - - - - 9 - - - - 1 - - - - disabled - - - - 0 - - - - disabled - - - - 0 - - - - 7 - - - - DEFAULT - - - - ISR_CCL_INT4 - - - - 134 - - - - Interrupt disabled - - - - 0 s - - - - 2 - - - - 3 - - - - 4 - - - - 137 - - - - 0 - - - - 4 - - - - 0 - - - - 1 - - - - 1 - - - - 141 - - - - 1 - - - - 83.3 ns - - - - 10 - - - - 0 - - - - alternate - - - - 1 - - - - 0 - - - - disabled - - - - false - - - - 0 - - - - MASK - - - - INTDISABLE - - - - 8 - - - - 154 - - - - disabled - - - - 2 - - - - 0 - - - - 134 - - - - 4 - - - - 0 - - - - disabled - - - - 9 - - - - disabled - - - - 65 - - - - SPI0_SCK - - - - 0 - - - - 162 - - - - WO4_DEF - - - - 6 - - - - 0 - - - - 83.3 ns - - - - 0 - - - - 3 - - - - 0 - - - - 5 - - - - 100 - - - - INTDISABLE - - - - 0 - - - - 1 - - - - 0 - - - - 2 - - - - 8 - - - - disabled - - - - 0 s - - - - 3 - - - - OFF - - - - 2 - - - - 0 - - - - disabled - - - - OFF - - - - 5 - - - - 0 - - - - 4 - - - - disabled - - - - 0 s - - - - 100.00 - - - - OFF - - - - 4 - - - - 2 - - - - 0 - - - - 140 - - - - DEFAULT - - - - 128 - - - - disabled - - - - 1 - - - - 0 - - - - 0 - - - - 2 - - - - 1 - - - - 2 - - - - 0 - - - - 176 - - - - Off - - - - 165 - - - - 1 - - - - 6 - - - - 0 - - - - 97 - - - - 0 - - - - OFF - - - - 4 - - - - 3 - - - - disabled - - - - 0 - - - - - - - - false - - - - 1 - - - - true - - - - disabled - - - - 0 - - - - 0 - - - - 0 - - - - 1 - - - - false - - - - 0 - - - - 24000000 - - - - 98 - - - - disabled - - - - 4 - - - - 3 - - - - 0 - - - - 6 - - - - disabled - - - - 5 - - - - 8 - - - - enabled - - - - 7 - - - - 0 - - - - 10 - - - - 9 - - - - 1 - - - - 1 - - - - 5 - - - - 2 - - - - 1 - - - - disabled - - - - 161 - - - - 0 - - - - 6 - - - - 3 - - - - 3 - - - - 0 - - - - disabled - - - - 0 - - - - disabled - - - - 0 - - - - 2 - - - - 0 - - - - ISR_SPI0_RXC - - - - 0 - - - - 3 - - - - 21 - - - - 7 - - - - 0 - - - - 19 - - - - 20 - - - - 17 - - - - 18 - - - - 16 - - - - 0 - - - - 167 - - - - 0 - - - - 4 - - - - INTDISABLE - - - - 0 - - - - disabled - - - - ISR_SPI0_IE - - - - 8 - - - - 3 - - - - 0 - - - - 11 - - - - 0 - - - - 160 - - - - 24000000 - - - - 1 - - - - 3 - - - - 33 - - - - 0 - - - - disabled - - - - 1 - - - - disabled - - - - INTDISABLE - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - MOSI_DEF - - - - 0 - - - - 0 - - - - 0 - - - - 97 - - - - disabled - - - - 164 - - - - 0 - - - - 0 - - - - 0 - - - - 0MS - - - - 1 - - - - Single Slope PWM - - - - 12 - - - - 2 - - - - disabled - - - - 104 - - - - 11 - - - - 0 - - - - 163 - - - - alternate - - - - 2 - - - - 0 s - - - - 5 - - - - 179 - - - - 0 - - - - 10 - - - - 0 - - - - 0 - - - - disabled - - - - 8 - - - - 0 - - - - 11 - - - - 9 - - - - 10 - - - - 4 - - - - 4 - - - - 3 - - - - 5 - - - - 6 - - - - 7 - - - - 1 - - - - 13 - - - - 2 - - - - 3 - - - - INTDISABLE - - - - 0 - - - - 3 - - - - 4 - - - - 3 - - - - 0 - - - - 2 - - - - disabled - - - - 40 - - - - 0 - - - - 10 - - - - disabled - - - - 0 - - - - INTDISABLE - - - - 1 - - - - 132 - - - - 0 - - - - 64 - - - - 66 - - - - 8 - - - - 65 - - - - 68 - - - - 67 - - - - 70 - - - - 1 - - - - 69 - - - - 0 - - - - SS_DEF - - - - 71 - - - - 141 - - - - 1 - - - - 5 - - - - 1 - - - - 83 - - - - 1 - - - - disabled - - - - 160 - - - - 1 - - - - 3 - - - - 0 - - - - FALLING - - - - 0 - - - - 4 - - - - 4 - - - - 0 - - - - false - - - - 0 - - - - 1 - - - - 13 - - - - 1 - - - - 1 - - - - 1 - - - - 4 - - - - 2 - - - - disabled - - - - 3 - - - - 1 - - - - 0 - - - - disabled - - - - LUT1_OUT0_DEF - - - - disabled - - - - 4 - - - - 2 - - - - 100 - - - - 1 - - - - 0 - - - - 2 - - - - disabled - - - - 0 - - - - 24 MHz system clock - - - - disabled - - - - 1 - - - - disabled - - - - 0 - - - - 9 - - - - 1 - - - - 8 - - - - 32 - - - - 192 - - - - 2 - - - - false - - - - 1 - - - - 1 - - - - 0 - - - - 10 - - - - 0 - - - - 5 - - - - 142 - - - - 1 - - - - TCA0 - - - - 1 - - - - 4 - - - - disabled - - - - 0 - - - - IDLE - - - - disabled - - - - DISABLE - - - - 0 - - - - 2 - - - - disabled - - - - 6 - - - - 66 - - - - 1 - - - - 65 - - - - 64 - - - - 2 - - - - 67 - - - - 0 - - - - 12 - - - - 0 - - - - 179 - - - - 0 - - - - false - - - - 34 - - - - 1 - - - - 0 - - - - 6X - - - - 1 - - - - 3 - - - - 0 - - - - DISABLE - - - - 11 - - - - 36 - - - - disabled - - - - 10 - - - - OFF - - - - 2 - - - - 0 - - - - 8 - - - - 157 - - - - 0 - - - - disabled - - - - 1 - - - - disabled - - - - disabled - - - - disabled - - - - 0 - - - - NONE - - - - 0 s - - - - 0 - - - - 99 - - - - 1 - - - - disabled - - - - 0 - - - - 1 - - - - 0 - - - - 2 - - - - 3 - - - - 2 - - - - 7 - - - - 5 - - - - 141 - - - - 0 - - - - 0 - - - - 5 - - - - 7 - - - - 8 - - - - 1 - - - - 5 - - - - 6 - - - - 0 - - - - 9 - - - - 1 - - - - 10 - - - - 165 - - - - 0 - - - - 0 - - - - 4 - - - - disabled - - - - 0 - - - - 7 - - - - false - - - - INTDISABLE - - - - 32 - - - - 0 - - - - 0 - - - - 21 - - - - 19 - - - - 20 - - - - 3 - - - - 17 - - - - 99 - - - - 18 - - - - 16 - - - - false - - - - 129 - - - - 0 - - - - 0 - - - - disabled - - - - INTDISABLE - - - - disabled - - - - 137 - - - - 0 Hz - - - - 0 - - - - 1 - - - - 2 - - - - 0 - - - - 6 - - - - disabled - - - - 3 - - - - 132 - - - - 6 - - - - 1 - - - - 1 - - - - 0 - - - - 3 - - - - 0 - - - - 96 - - - - 0 - - - - 2 - - - - BODLEVEL0 - - - - 7 - - - - CH0 - - - - 3 - - - - 4 - - - - 1 - - - - 2 - - - - 8 - - - - 8 - - - - 178 - - - - 7 - - - - 161 - - - - 3 - - - - DEFAULT - - - - 0 - - - - OFF - - - - 6X - - - - 0 - - - - 100.00 - - - - INTDISABLE - - - - 157 - - - - DEFAULT - - - - disabled - - - - 5 - - - - 1 - - - - CHANNEL0 - - - - 1 - - - - BODLEVEL0 - - - - 4 - - - - 5 - - - - MASK - - - - 2 - - - - 0 Hz - - - - 1 - - - - NONE - - - - 128 - - - - 4 - - - - disabled - - - - 0 - - - - OFF - - - - 2 - - - - 104 - - - - DEFAULT - - - - 0 - - - - 0 - - - - 177 - - - - 1 - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - ISR_TCA0_OVFI - - - - 0 - - - - 0 - - - - 164 - - - - 0 - - - - 0 - - - - 167 - - - - 0 - - - - 1 - - - - disabled - - - - disabled - - - - 1 - - - - 1 - - - - 2 - - - - 6 - - - - disabled - - - - DEFAULT - - - - 3 - - - - 32 - - - - 0 - - - - 0 - - - - 9 - - - - 3 - - - - 0 - - - - 2 - - - - 0 - - - - 48 - - - - 49 - - - - 2 - - - - 4 - - - - 0 - - - - INTDISABLE - - - - 136 - - - - 1 - - - - 4 - - - - 66 - - - - 0 - - - - 3 - - - - 65 - - - - 1 - - - - 0 - - - - 6 - - - - 64 - - - - 5 - - - - 176 - - - - 1 - - - - 2 - - - - 0 - - - - 1 - - - - 71 - - - - 70 - - - - 69 - - - - 68 - - - - 0 - - - - 0 - - - - 1 - - - - 1 - - - - 67 - - - - 0 - - - - 2 - - - - 2 - - - - 1 - - - - 133 - - - - enabled - - - - DEFAULT - - - - false - - - - DISABLE - - - - 0 - - - - 8 - - - - 7 - - - - 10 - - - - 9 - - - - 8 - - - - disabled - - - - 162 - - - - 0 - - - - 8 - - - - 1 - - - - 7 - - - - 10 - - - - 9 - - - - 4 - - - - 3 - - - - 129 - - - - 1 - - - - 0 s - - - - 1 - - - - 6 - - - - OFF - - - - 5 - - - - 0 - - - - disabled - - - - disabled - - - - disabled - - - - OFF - - - - 2 - - - - 1 - - - - OFF - - - - 0 - - - - 3 - - - - disabled - - - - disabled - - - - disabled - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - 98 - - - - 0 - - - - alternate - - - - 4 - - - - DEFAULT - - - - 0 - - - - 178 - - - - 0 - - - - 1 - - - - 0 - - - - - - - - 1 - - - - 0 - - - - 2 - - - - 0 - - - - 167 - - - - 1 - - - - 1 - - - - 9 - - - - 0 - - - - DEFAULT - - - - 0 - - - - disabled - - - - 0 - - - - DISABLE - - - - 3 - - - - 0 - - - - 1 - - - - 21 - - - - 20 - - - - 19 - - - - 18 - - - - OFF - - - - 17 - - - - 16 - - - - 33 - - - - 0 - - - - 134 - - - - false - - - - disabled - - - - 3 - - - - 6 - - - - 1 - - - - 137 - - - - 3 - - - - disabled - - - - DEFAULT - - - - Interrupt disabled - - - - 0 - - - - false - - - - 160 - - - - DIS - - - - 100 - - - - 0 - - - - 1 - - - - 0 - - - - 1 - - - - 0 - - - - 1 - - - - 0 - - - - 0 - - - - 2 - - - - disabled - - - - 1 - - - - 0 - - - - 1 - - - - disabled - - - - 8 - - - - 134 - - - - 1 - - - - 1 - - - - OFF - - - - 0 - - - - 10 - - - - 0 - - - - 0 - - - - 0 - - - - 7 - - - - 6 - - - - 12 - - - - 9 - - - - 162 - - - - 8 - - - - disabled - - - - 3 - - - - 2 - - - - 5 - - - - INTDISABLE - - - - 4 - - - - 10 - - - - 5 - - - - 1 - - - - 0 - - - - alternate - - - - 8 - - - - 0 - - - - disabled - - - - 9 - - - - 10 - - - - 4 - - - - 5 - - - - ISR_TCA0_CMP2I - - - - 6 - - - - 7 - - - - 11 - - - - 1 - - - - 2 - - - - 3 - - - - 10 - - - - 3 - - - - 1 - - - - 0 - - - - 4 - - - - 3 - - - - disabled - - - - disabled - - - - AUTO - - - - 128 - - - - 137 - - - - 0 - - - - disabled - - - - 0 s - - - - 0 - - - - 4 - - - - 9 - - - - 6 - - - - 0 - - - - 3 - - - - 0 - - - - 0 - - - - 140 - - - - false - - - - 13 - - - - 0 - - - - SINGLE - - - - MASK - - - - INTDISABLE - - - - 176 - - - - 0 - - - - false - - - - 179 - - - - 0 - - - - 4 - - - - 0 - - - - disabled - - - - 4 - - - - 0 - - - - 0 - - - - 0 - - - - 1 - - - - OFF - - - - Interrupt disabled - - - - disabled - - - - 1 - - - - 1 - - - - 0 - - - - 5 - - - - 7 - - - - 33 - - - - 1 - - - - BOD disabled - - - - 12 - - - - false - - - - disabled - - - - 160 - - - - CHANNEL0 - - - - 0 - - - - true - - - - 2 - - - - 0 - - - - disabled - - - - INTDISABLE - - - - 98 - - - - 10 - - - - 11 - - - - 9 - - - - 13 - - - - alternate - - - - 128 - - - - 105 - - - - 0 - - - - 0 - - - - INTDISABLE - - - - disabled - - - - 2 - - - - 137 - - - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 5 - - - - 6 - - - - 3 - - - - 7 - - - - 8 - - - - 9 - - - - 10 - - - - 7 - - - - 0 - - - - 1 - - - - 0 - - - - 1 - - - - 133 - - - - DISABLE - - - - 1 - - - - 0 - - - - 0 - - - - 165 - - - - 1 - - - - 4 - - - - 3 - - - - 1 - - - - 1 - - - - disabled - - - - 1 - - - - 1 - - - - 1 - - - - 0 - - - - 0 - - - - 0 - - - - 5 - - - - 2 - - - - 2 - - - - INTDISABLE - - - - 161 - - - - disabled - - - - 0 - - - - disabled - - - - 0 - - - - 1 - - - - 3 - - - - DISABLE - - - - 4 - - - - 1 - - - - disabled - - - - 0 - - - - 9 - - - - 0 - - - - 0 - - - - 2 - - - - Master - - - - 21 - - - - 19 - - - - INTDISABLE - - - - 20 - - - - 17 - - - - 1 - - - - 18 - - - - 16 - - - - 0 - - - - disabled - - - - 160 - - - - 0 - - - - 4 - - - - 1 - - - - 0 - - - - 0 - - - - 64 - - - - 0 - - - - 66 - - - - 65 - - - - 5 - - - - 68 - - - - 67 - - - - 70 - - - - 69 - - - - 3 - - - - 71 - - - - 142 - - - - 1 - - - - 0 - - - - 3 - - - - 1 - - - - 2 - - - - disabled - - - - 1 - - - - 4 - - - - 3 - - - - 0 - - - - 0 - - - - 10 - - - - 9 - - - - 6 - - - - INTDISABLE - - - - 5 - - - - 8 - - - - 1 - - - - 7 - - - - 0 - - - - 0 - - - - 1 - - - - 8 - - - - 9 - - - - 10 - - - - 4 - - - - 5 - - - - 6 - - - - 7 - - - - ALT1 - - - - {"lutSequentialSelection":"DISABLE","lutInput0Selection":"MASK","module":"CCL-write","isLutEdgeDetectorEnabled":false,"type":"custom","isLutOutputEnabled":false,"lutClockSelection":"CLKPER","lutInput1Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN1","AC1","USART1","SPI0","TCA0","TCB1","TCD0","ZCD1","TCA1"],"lutInput2Selection":"MASK","lutFilterOptions":["DISABLE","SYNCH","FILTER"],"lutFilterSelection":"DISABLE","lutInput0Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN0","AC0","ZCD0","USART0","SPI0","TCA0","TCB0","TCD0","TCA1"],"lutInput2Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN2","AC2","USART2","SPI0","TCA0","TCB2","TCD0","TCA1"],"lutClockSelectionOptions":["CLKPER","IN2","OSCHF","OSC32K","OSC1K"],"ttOut":0,"lut-name":"lut-4","lutInput1Selection":"MASK","selectedGateType":"Custom","isLutEnabled":false,"lutSequentialOptions":["DISABLE","DFF","JK","LATCH","RS"]} - - - - false - - - - {"lutSequentialSelection":"DISABLE","lutInput0Selection":"MASK","module":"CCL-write","isLutEdgeDetectorEnabled":false,"type":"custom","isLutOutputEnabled":false,"lutClockSelection":"CLKPER","lutInput1Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN1","AC1","USART1","SPI0","TCA0","TCB1","TCD0","ZCD1","TCA1"],"lutInput2Selection":"MASK","lutFilterOptions":["DISABLE","SYNCH","FILTER"],"lutFilterSelection":"DISABLE","lutInput0Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN0","AC0","ZCD0","USART0","SPI0","TCA0","TCB0","TCD0","TCA1"],"lutInput2Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN2","AC2","USART2","SPI0","TCA0","TCB2","TCD0","TCA1"],"lutClockSelectionOptions":["CLKPER","IN2","OSCHF","OSC32K","OSC1K"],"ttOut":0,"lut-name":"lut-3","lutInput1Selection":"MASK","selectedGateType":"Custom","isLutEnabled":false,"lutSequentialOptions":["DISABLE","DFF","JK","LATCH","RS"]} - - - - false - - - - false - - - - {"lutSequentialSelection":"DISABLE","lutInput0Selection":"MASK","module":"CCL-write","isLutEdgeDetectorEnabled":false,"type":"custom","isLutOutputEnabled":false,"lutClockSelection":"CLKPER","lutInput1Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN1","AC1","USART1","SPI0","TCA0","TCB1","TCD0","ZCD1","TCA1"],"lutInput2Selection":"MASK","lutFilterOptions":["DISABLE","SYNCH","FILTER"],"lutFilterSelection":"DISABLE","lutInput0Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN0","AC0","ZCD0","USART0","SPI0","TCA0","TCB0","TCD0","TCA1"],"lutInput2Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN2","AC2","USART2","SPI0","TCA0","TCB2","TCD0","TCA1"],"lutClockSelectionOptions":["CLKPER","IN2","OSCHF","OSC32K","OSC1K"],"ttOut":0,"lut-name":"lut-5","lutInput1Selection":"MASK","selectedGateType":"Custom","isLutEnabled":false,"lutSequentialOptions":["DISABLE","DFF","JK","LATCH","RS"]} - - - - false - - - - DIV1 - - - - {"lutSequentialSelection":"DISABLE","lutInput0Selection":"TCA0","module":"CCL-write","isLutEdgeDetectorEnabled":false,"type":"custom","isLutOutputEnabled":true,"lutClockSelection":"CLKPER","lutInput1Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN1","AC1","USART1","SPI0","TCA0","TCB1","TCD0","ZCD1","TCA1"],"lutInput2Selection":"TCA0","lutFilterOptions":["DISABLE","SYNCH","FILTER"],"lutFilterSelection":"DISABLE","lutInput0Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN0","AC0","ZCD0","USART0","SPI0","TCA0","TCB0","TCD0","TCA1"],"lutInput2Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN2","AC2","USART2","SPI0","TCA0","TCB2","TCD0","TCA1"],"lutClockSelectionOptions":["CLKPER","IN2","OSCHF","OSC32K","OSC1K"],"ttOut":224,"lut-name":"lut-0","lutInput1Selection":"SPI0","selectedGateType":"Custom","isLutEnabled":true,"lutSequentialOptions":["DISABLE","DFF","JK","LATCH","RS"]} - - - - false - - - - false - - - - {"lutSequentialSelection":"DISABLE","lutInput0Selection":"MASK","module":"CCL-write","isLutEdgeDetectorEnabled":false,"type":"custom","isLutOutputEnabled":false,"lutClockSelection":"CLKPER","lutInput1Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN1","AC1","USART1","SPI0","TCA0","TCB1","TCD0","ZCD1","TCA1"],"lutInput2Selection":"MASK","lutFilterOptions":["DISABLE","SYNCH","FILTER"],"lutFilterSelection":"DISABLE","lutInput0Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN0","AC0","ZCD0","USART0","SPI0","TCA0","TCB0","TCD0","TCA1"],"lutInput2Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN2","AC2","USART2","SPI0","TCA0","TCB2","TCD0","TCA1"],"lutClockSelectionOptions":["CLKPER","IN2","OSCHF","OSC32K","OSC1K"],"ttOut":0,"lut-name":"lut-2","lutInput1Selection":"MASK","selectedGateType":"Custom","isLutEnabled":false,"lutSequentialOptions":["DISABLE","DFF","JK","LATCH","RS"]} - - - - disabled - - - - {"lutSequentialSelection":"DISABLE","lutInput0Selection":"MASK","module":"CCL-write","isLutEdgeDetectorEnabled":false,"type":"custom","isLutOutputEnabled":false,"lutClockSelection":"CLKPER","lutInput1Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN1","AC1","USART1","SPI0","TCA0","TCB1","TCD0","ZCD1","TCA1"],"lutInput2Selection":"MASK","lutFilterOptions":["DISABLE","SYNCH","FILTER"],"lutFilterSelection":"DISABLE","lutInput0Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN0","AC0","ZCD0","USART0","SPI0","TCA0","TCB0","TCD0","TCA1"],"lutInput2Options":["MASK","FEEDBACK","LINK","EVENTA","EVENTB","IN2","AC2","USART2","SPI0","TCA0","TCB2","TCD0","TCA1"],"lutClockSelectionOptions":["CLKPER","IN2","OSCHF","OSC32K","OSC1K"],"ttOut":0,"lut-name":"lut-1","lutInput1Selection":"MASK","selectedGateType":"Custom","isLutEnabled":false,"lutSequentialOptions":["DISABLE","DFF","JK","LATCH","RS"]} - - - - 1 - - - - 0 - - - - 1 - - - - 7 - - - - 0 - - - - 1 - - - - 2 - - - - 3 - - - - 36 - - - - 1 - - - - 0 - - - - false - - - - false - - - - 5 - - - - 24000000 - - - - 1 - - - - false - - - - 5 - - - - false - - - - 0 - - - - 0 - - - - false - - - - false - - - - 5 - - - - false - - - - disabled - - - - false - - - - disabled - - - - 76 - - - - 77 - - - - false - - - - 72 - - - - 73 - - - - 74 - - - - 0 - - - - 75 - - - - 2 - - - - 0 s - - - - false - - - - 1 - - - - false - - - - false - - - - 0 - - - - 0 - - - - false - - - - false - - - - false - - - - DEFAULT - - - - DIS - - - - false - - - - 0 - - - - Interrupt disabled - - - - DEFAULT - - - - 1 - - - - 0 - - - - disabled - - - - disabled - - - - disabled - - - - 2 - - - - 1 - - - - false - - - - disabled - - - - 0 s - - - - false - - - - DEFAULT - - - - false - - - - false - - - - 166 - - - - false - - - - false - - - - false - - - - false - - - - 0 - - - - 1 - - - - 1 - - - - 0 - - - - false - - - - 13 - - - - false - - - - 11 - - - - false - - - - 0 - - - - WO5_DEF - - - - 3 - - - - CRC16 - - - - 7 - - - - 0 - - - - 1 - - - - 0 - - - - false - - - - 1 - - - - false - - - - false - - - - 0 - - - - false - - - - 3 - - - - 0 - - - - 5 - - - - 1 - - - - false - - - - false - - - - 9 - - - - 3 - - - - 1 - - - - 1 - - - - 0 - - - - MASK - - - - false - - - - false - - - - disabled - - - - 5 - - - - 99 - - - - 97 - - - - 0 - - - - 1 - - - - 5 - - - - 12 - - - - UP - - - - 0 - - - - enabled - - - - 0 - - - - DEFAULT - - - - false - - - - 49 - - - - 48 - - - - 0 - - - - 132 - - - - 6 - - - - 1 - - - - 5 - - - - 167 - - - - - - - - 133 - - - - 10 - - - - 0 - - - - DIS - - - - 34 - - - - MASK - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - 48 - - - - 49 - - - - 99 - - - - false - - - - 96 - - - - disabled - - - - 0 Hz - - - - 0 - - - - 0 - - - - 0 - - - - 142 - - - - 0 - - - - 1 - - - - 163 - - - - 1 - - - - 0 - - - - 0 - - - - 3 - - - - 0 - - - - 32 - - - - 1 - - - - DISABLE - - - - 2.731 ms - - - - 1 - - - - 0 - - - - disabled - - - - ALT1 - - - - 0 - - - - 0 - - - - 177 - - - - 179 - - - - 40 - - - - disabled - - - - INTDISABLE - - - - 0 - - - - 0 - - - - 1 - - - - 0 - - - - 8 - - - - 0 s - - - - 4 - - - - Internal high-frequency oscillator - - - - disabled - - - - INTDISABLE - - - - disabled - - - - 0 - - - - 4 - - - - 3 - - - - 0 - - - - 0 - - - - 2 - - - - disabled - - - - false - - - - 1 - - - - DEFAULT - - - - 8 - - - - OFF - - - - disabled - - - - 0 - - - - 83.3 ns - - - - 0 - - - - DEFAULT - - - - OFF - - - - 1 - - - - 0 - - - - 136 - - - - 1 - - - - 164 - - - - 2 - - - - INTDISABLE - - - - 0 - - - - 0 - - - - 11 - - - - 0 - - - - 1 - - - - false - - - - false - - - - ISR_TCA0_HUNFI - - - - 0 - - - - 4 - - - - disabled - - - - 1 - - - - 0 - - - - 0 Hz - - - - disabled - - - - - - - - 0 - - - - 4 - - - - alternate - - - - System Clock / 16 - - - - 0 - - - - INTDISABLE - - - - 1 - - - - disabled - - - - 36 - - - - 133 - - - - DEFAULT - - - - 0 - - - - 0 - - - - 1 - - - - 4 - - - - 177 - - - - OFF - - - - disabled - - - - disabled - - - - 134 - - - - 12 - - - - OFF - - - - 3 - - - - 162 - - - - false - - - - 0 - - - - 0 - - - - CLKPER - - - - 2 - - - - 2 - - - - 178 - - - - INTDISABLE - - - - GPIO - - - - 0 - - - - 32 - - - - 0 - - - - 0 - - - - 4 - - - - 1 - - - - 13 - - - - 161 - - - - 10 - - - - 1 - - - - 8 - - - - 9 - - - - disabled - - - - 6 - - - - 7 - - - - 4 - - - - 5 - - - - 2 - - - - 3 - - - - 0 - - - - 0 - - - - 0 - - - - 1 - - - - 1 - - - - 0 - - - - 128 - - - - 100.00 - - - - 0 - - - - disabled - - - - 0 - - - - 18 - - - - 17 - - - - 16 - - - - 5 - - - - 0 - - - - 98 - - - - 176 - - - - 4 - - - - 2 - - - - 166 - - - - 4 - - - - disabled - - - - 1 - - - - 0 - - - - 3 - - - - OFF - - - - 0 - - - - disabled - - - - 1 - - - - 0 - - - - 0 - - - - WO1_DEF - - - - false - - - - 0 - - - - 1 - - - - 0 - - - - 0 - - - - 2 - - - - DEFAULT - - - - 100 us - - - - 0 - - - - 5 - - - - disabled - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - 7 - - - - 0 - - - - 0 - - - - enabled - - - - 0 - - - - 0 - - - - 1 - - - - 129 - - - - disabled - - - - 1 - - - - 21 - - - - 0 - - - - 20 - - - - 19 - - - - 11 - - - - 0 - - - - disabled - - - - 1 - - - - false - - - - 0 - - - - disabled - - - - 0 - - - - 137 - - - - 0 - - - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 5 - - - - 1 - - - - disabled - - - - DEFAULT - - - - 6 - - - - UPDOWN - - - - 136 - - - - 10 - - - - OFF - - - - 0 - - - - 1 - - - - 0 - - - - Sample frequency is 128 Hz - - - - disabled - - - - 0 - - - - 1 - - - - 0 - - - - 3 - - - - 0 - - - - 134 - - - - 0 - - - - 0 - - - - ISR_TCA0_LCMP1I - - - - 0 - - - - OFF - - - - DIV1 - - - - 74 - - - - 75 - - - - 1 - - - - 76 - - - - {"type":"tableDynamicControls","key":"interruptVectorTable","dataArray": [{"Module": {"id":"Module_rowCount_0","data":{"text":"CCL","value":"CCL"}},"Interrupt": {"id":"Interrupt_rowCount_0","data":{"text":"INT1","value":"INT1"}},"Enable": {"id":"Enable_rowCount_0","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_1","data":{"text":"CCL","value":"CCL"}},"Interrupt": {"id":"Interrupt_rowCount_1","data":{"text":"INT2","value":"INT2"}},"Enable": {"id":"Enable_rowCount_1","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_2","data":{"text":"CCL","value":"CCL"}},"Interrupt": {"id":"Interrupt_rowCount_2","data":{"text":"INT0","value":"INT0"}},"Enable": {"id":"Enable_rowCount_2","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_3","data":{"text":"CCL","value":"CCL"}},"Interrupt": {"id":"Interrupt_rowCount_3","data":{"text":"INT5","value":"INT5"}},"Enable": {"id":"Enable_rowCount_3","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_4","data":{"text":"CCL","value":"CCL"}},"Interrupt": {"id":"Interrupt_rowCount_4","data":{"text":"INT3","value":"INT3"}},"Enable": {"id":"Enable_rowCount_4","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_5","data":{"text":"CCL","value":"CCL"}},"Interrupt": {"id":"Interrupt_rowCount_5","data":{"text":"INT4","value":"INT4"}},"Enable": {"id":"Enable_rowCount_5","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_6","data":{"text":"SPI0","value":"SPI0"}},"Interrupt": {"id":"Interrupt_rowCount_6","data":{"text":"SSI","value":"SSI"}},"Enable": {"id":"Enable_rowCount_6","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_7","data":{"text":"TCA0","value":"TCA0"}},"Interrupt": {"id":"Interrupt_rowCount_7","data":{"text":"CMP2I","value":"CMP2I"}},"Enable": {"id":"Enable_rowCount_7","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_8","data":{"text":"TCA0","value":"TCA0"}},"Interrupt": {"id":"Interrupt_rowCount_8","data":{"text":"CMP1I","value":"CMP1I"}},"Enable": {"id":"Enable_rowCount_8","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_9","data":{"text":"TCA0","value":"TCA0"}},"Interrupt": {"id":"Interrupt_rowCount_9","data":{"text":"CMP0I","value":"CMP0I"}},"Enable": {"id":"Enable_rowCount_9","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_10","data":{"text":"TCA0","value":"TCA0"}},"Interrupt": {"id":"Interrupt_rowCount_10","data":{"text":"OVFI","value":"OVFI"}},"Enable": {"id":"Enable_rowCount_10","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_11","data":{"text":"SPI0","value":"SPI0"}},"Interrupt": {"id":"Interrupt_rowCount_11","data":{"text":"DRE","value":"DRE"}},"Enable": {"id":"Enable_rowCount_11","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_12","data":{"text":"BOD","value":"BOD"}},"Interrupt": {"id":"Interrupt_rowCount_12","data":{"text":"VLM","value":"VLM"}},"Enable": {"id":"Enable_rowCount_12","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_13","data":{"text":"SPI0","value":"SPI0"}},"Interrupt": {"id":"Interrupt_rowCount_13","data":{"text":"RXC","value":"RXC"}},"Enable": {"id":"Enable_rowCount_13","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_14","data":{"text":"SPI0","value":"SPI0"}},"Interrupt": {"id":"Interrupt_rowCount_14","data":{"text":"IE","value":"IE"}},"Enable": {"id":"Enable_rowCount_14","data":{"text":"false","value":"false"}}},{"Module": {"id":"Module_rowCount_15","data":{"text":"SPI0","value":"SPI0"}},"Interrupt": {"id":"Interrupt_rowCount_15","data":{"text":"TXC","value":"TXC"}},"Enable": {"id":"Enable_rowCount_15","data":{"text":"false","value":"false"}}}] } - - - - 77 - - - - 161 - - - - 72 - - - - 73 - - - - 100 - - - - DEFAULT - - - - RESTART_POSEDGE - - - - INTDISABLE - - - - disabled - - - - disabled - - - - 0 - - - - 3 - - - - 1 - - - - 104 - - - - 167 - - - - 0 - - - - 1 - - - - 1 - - - - 11 - - - - 10 - - - - 0 - - - - INTDISABLE - - - - CLKPER - - - - disabled - - - - 166 - - - - 0 - - - - 0 - - - - 0 - - - - 1 - - - - 0 - - - - 9 - - - - 12 - - - - 12 - - - - DEFAULT - - - - 0 - - - - 0 - - - - 8 - - - - 1 - - - - 2 - - - - 6 - - - - 0 - - - - 128Hz - - - - alternate - - - - 0 - - - - 0 - - - - 0 - - - - 1 - - - - 98 - - - - 96 - - - - Off - - - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 2 - - - - 10 - - - - 5 - - - - 11 - - - - 6 - - - - 7 - - - - 8 - - - - 3 - - - - 9 - - - - 10 - - - - 0 - - - - 1 - - - - 2 - - - - 0 - - - - 0 Hz - - - - 0 - - - - disabled - - - - 1 - - - - 2 - - - - 0 - - - - 0 Hz - - - - enabled - - - - 13 - - - - 49 - - - - 3 - - - - 48 - - - - 0 - - - - 178 - - - - disabled - - - - 0 - - - - 10 - - - - 0 - - - - 11 - - - - 0 - - - - 0 - - - - 4 - - - - 179 - - - - 0 - - - - 1 - - - - 0 - - - - 2 - - - - 0 - - - - 3 - - - - INTDISABLE - - - - 4 - - - - 33 - - - - 2 - - - - 0 - - - - 1 - - - - 163 - - - - CLKPER - - - - 1 - - - - 176 - - - - 40 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 72 - - - - disabled - - - - 73 - - - - disabled - - - - disabled - - - - 141 - - - - disabled - - - - disabled - - - - disabled - - - - INTDISABLE - - - - 0 - - - - false - - - - false - - - - 78 - - - - 79 - - - - false - - - - 76 - - - - false - - - - 77 - - - - true - - - - 74 - - - - false - - - - 0 - - - - 75 - - - - 8 - - - - 0 - - - - 0 - - - - 1 - - - - 0 - - - - 1 - - - - disabled - - - - 0 - - - - disabled - - - - 1 - - - - false - - - - OFF - - - - true - - - - 1 - - - - true - - - - true - - - - false - - - - 3 - - - - true - - - - 3 - - - - true - - - - true - - - - 0 - - - - 0 - - - - 1 - - - - 0 - - - - 1 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 0 - - - - disabled - - - - 1 - - - - disabled - - - - MASK - - - - 3 - - - - 0 - - - - 6 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 0 - - - - SPI0 - - - - 1 - - - - 0 - - - - 8 - - - - 9 - - - - 10 - - - - 4 - - - - 6 - - - - 5 - - - - 6 - - - - 7 - - - - disabled - - - - 1 - - - - disabled - - - - 2 - - - - 3 - - - - disabled - - - - 0 - - - - 6 - - - - 0 - - - - disabled - - - - 3 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 10 - - - - VDD falls below VLM threshold - - - - disabled - - - - 0 - - - - disabled - - - - 10 - - - - 1 - - - - 105 - - - - disabled - - - - 162 - - - - disabled - - - - 4 - - - - 2 - - - - disabled - - - - 0 - - - - 0 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - ISR_BOD_VLM - - - - 0 - - - - 2 - - - - 1 - - - - 0 - - - - 0 - - - - 1 - - - - 0 - - - - 1 - - - - 12 - - - - 5 - - - - 3 - - - - 0 - - - - - - - - 99 - - - - 1 - - - - false - - - - disabled - - - - 4 - - - - 3 - - - - 10 - - - - ISR_SPI0_DRE - - - - 11 - - - - 0 - - - - INTDISABLE - - - - 4 - - - - disabled - - - - 0 - - - - 0 - - - - 1 - - - - 0 - - - - 0 - - - - 5 - - - - false - - - - 1 - - - - 9 - - - - 179 - - - - 0 - - - - 1 - - - - 1 - - - - disabled - - - - 1 - - - - 1 - - - - 0 - - - - 9 - - - - INTDISABLE - - - - false - - - - false - - - - 0 - - - - 0 - - - - 3 - - - - false - - - - disabled - - - - false - - - - true - - - - false - - - - 0 - - - - disabled - - - - false - - - - 1 - - - - false - - - - false - - - - 100 - - - - 0 - - - - 1 - - - - disabled - - - - 2 - - - - alternate - - - - 140 - - - - 4 - - - - 7 - - - - INTDISABLE - - - - false - - - - false - - - - false - - - - false - - - - false - - - - false - - - - 2 - - - - true - - - - 0 - - - - false - - - - false - - - - alternate - - - - false - - - - 5 - - - - alternate - - - - false - - - - alternate - - - - alternate - - - - INTDISABLE - - - - 1 - - - - disabled - - - - 165 - - - - 34 - - - - 13 - - - - 11 - - - - 0 - - - - 0 - - - - false - - - - 5 - - - - false - - - - disabled - - - - 166.7 ns - - - - 166.7 ns - - - - false - - - - false - - - - false - - - - disabled - - - - 105 - - - - false - - - - 0 - - - - 0 Hz - - - - 11 - - - - 0 - - - - false - - - - 97 - - - - disabled - - - - disabled - - - - 40 - - - - disabled - - - - 4 - - - - disabled - - - - disabled - - - - INTDISABLE - - - - disabled - - - - 13 - - - - 10 - - - - 11 - - - - OFF - - - - 0 - - - - 8 - - - - 0 - - - - 1 - - - - 6 - - - - false - - - - disabled - - - - 0 - - - - 0 - - - - 132 - - - - disabled - - - - disabled - - - - disabled - - - - 5 - - - - disabled - - - - 95 - - - - 1 - - - - disabled - - - - 12 - - - - 96 - - - - 0 - - - - disabled - - - - disabled - - - - disabled - - - - 1 - - - - 3 - - - - disabled - - - - 12 - - - - 0 - - - - 161 - - - - 1 - - - - 0 - - - - 32 - - - - 0 - - - - disabled - - - - 0 - - - - 6 - - - - 0 - - - - NOCRC - - - - false - - - - disabled - - - - 1 - - - - 0 - - - - disabled - - - - 0 - - - - 99 - - - - 129 - - - - 0 - - - - 0 - - - - alternate - - - - 0 - - - - disabled - - - - 0 - - - - 3 - - - - 1 - - - - 1 - - - - NONE - - - - 0 - - - - 36 - - - - 4 - - - - 0 - - - - 2 - - - - MASK - - - - 0 - - - - alternate - - - - alternate - - - - alternate - - - - alternate - - - - disabled - - - - 100us - - - - disabled - - - - 177 - - - - 0 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 0 - - - - 0 - - - - disabled - - - - 4 - - - - 49 - - - - disabled - - - - 0 - - - - 3 - - - - 48 - - - - disabled - - - - 0 - - - - disabled - - - - 10 - - - - 0 - - - - 11 - - - - 0 - - - - 164 - - - - 0 - - - - 1 - - - - 0 - - - - 104 - - - - 5 - - - - 0 - - - - disabled - - - - disabled - - - - 0 - - - - 167 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 0 - - - - disabled - - - - 0 - - - - 0 - - - - 7 - - - - 0 - - - - 163 - - - - disabled - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - disabled - - - - DEFAULT - - - - 3 - - - - disabled - - - - 142 - - - - disabled - - - - disabled - - - - MASK - - - - disabled - - - - disabled - - - - disabled - - - - 11 - - - - 104 - - - - 4 - - - - disabled - - - - disabled - - - - disabled - - - - 136 - - - - disabled - - - - disabled - - - - 0 - - - - enabled - - - - 0 - - - - 0 - - - - 0 - - - - 9 - - - - 0 - - - - Interrupt disabled - - - - disabled - - - - disabled - - - - disabled - - - - 0 - - - - 34 - - - - 10 - - - - 1 - - - - OFF - - - - 36 - - - - 0 - - - - 1 - - - - 0 - - - - 1 - - - - CHANNEL0 - - - - 0 - - - - 1 - - - - disabled - - - - 1 - - - - disabled - - - - 1 - - - - 132 - - - - 32 - - - - 0 - - - - 0 - - - - 141 - - - - 1 - - - - disabled - - - - disabled - - - - 1 - - - - 1 - - - - 4 - - - - 0 - - - - 167 - - - - 3 - - - - 5 - - - - 2 - - - - 5 - - - - 0 - - - - 136 - - - - 0 - - - - 1 - - - - 0 - - - - disabled - - - - 0 - - - - 0 - - - - disabled - - - - disabled - - - - 2 - - - - 0 - - - - 8 - - - - 3 - - - - 166 - - - - alternate - - - - disabled - - - - disabled - - - - 1 - - - - 0 - - - - 1 - - - - 8 - - - - 0 - - - - 1 - - - - 1 - - - - 0 - - - - 1 - - - - disabled - - - - 0 - - - - 13 - - - - 1 - - - - 0 - - - - disabled - - - - 1 - - - - 0 - - - - 5 - - - - OFF - - - - 0 - - - - 5 - - - - ISR_CCL_INT3 - - - - 1 - - - - 0 - - - - 5 - - - - INTDISABLE - - - - disabled - - - - 1 - - - - 0 - - - - 9 - - - - 10 - - - - 7 - - - - 0 - - - - 8 - - - - 5 - - - - 6 - - - - 0 - - - - 3 - - - - 4 - - - - 1 - - - - 2 - - - - 1 - - - - DIS - - - - 0 - - - - disabled - - - - 0 - - - - false - - - - 1 - - - - 0 - - - - Up - - - - 1 - - - - 0 - - - - 0 - - - - 3 - - - - 98 - - - - 128 - - - - false - - - - 0 - - - - 2 - - - - 0 - - - - 7 - - - - 8 - - - - 100 - - - - disabled - - - - alternate - - - - 0 - - - - 177 - - - - alternate - - - - 16 Bit (Normal) - - - - 0 - - - - 0 - - - - disabled - - - - 4 - - - - 134 - - - - 0 - - - - 1 - - - - 0 - - - - 0 - - - - 178 - - - - 179 - - - - 4 - - - - 1 - - - - 0 - - - - 9 - - - - disabled - - - - 160 - - - - 1 - - - - 1 - - - - 0 - - - - 0 - - - - 1 - - - - 7 - - - - 0 - - - - OFF - - - - 0 - - - - 129 - - - - false - - - - 1 - - - - disabled - - - - ISR_SPI0_TXC - - - - 0 - - - - 2 - - - - false - - - - 2 - - - - 162 - - - - 105 - - - - 1 - - - - 140 - - - - 0 - - - - 176 - - - - 2 - - - - 1 - - - - 40 - - - - OFF - - - - 0 - - - - MISO_DEF - - - - 1 - - - - 9 - - - - 165 - - - - 96 - - - - 1 - - - - 0 - - - - 5 - - - - 0 - - - - alternate - - - - 0 - - - - 2 - - - - 6 - - - - 10 - - - - 0 - - - - 11 - - - - 10 - - - - 1 - - - - INTDISABLE - - - - 4 - - - - 2 - - - - enabled - - - - SPI0 - - - - 6 - - - - 0 - - - - 1 - - - - disabled - - - - 161 - - - - 1 - - - - 3 - - - - 4 - - - - 0 - - - - 3 - - - - 1 - - - - 3 - - - - 2 - - - - 10 - - - - disabled - - - - 4 - - - - 0 - - - - 8 - - - - 0 - - - - 9 - - - - 8 - - - - 1 - - - - 10 - - - - 5 - - - - 0 - - - - 4 - - - - 7 - - - - 6 - - - - 1.9V - - - - 33 - - - - 12 - - - - 5 - - - - 0 Hz - - - - 0 - - - - TCA0 - - - - alternate - - - - 1 - - - - alternate - - - - 74 - - - - 6 - - - - alternate - - - - 0 - - - - 75 - - - - 7 - - - - 72 - - - - 4 - - - - 73 - - - - 5 - - - - 10 - - - - 5 - - - - 8 - - - - 9 - - - - 5 - - - - 1 - - - - disabled - - - - 78 - - - - 2 - - - - - - - - 79 - - - - 3 - - - - 0 - - - - 76 - - - - 77 - - - - 1 - - - - 9 - - - - disabled - - - - disabled - - - - 10 - - - - 5 - - - - 6 - - - - disabled - - - - 7 - - - - 8 - - - - 1 - - - - 2 - - - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 3 - - - - 0 - - - - 6 - - - - 3 - - - - 0 - - - - 0 - - - - 133 - - - - 0 - - - - 0 - - - - disabled - - - - 0 - - - - 0 - - - - 13 - - - - 0 - - - - OFF - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - 7 - - - - 0 - - - - 1 - - - - 5 - - - - 1 - - - - 0 - - - - 0 - - - - 10 - - - - 1 - - - - 53 - - - - disabled - - - - 3 - - - - 2 - - - - 5 - - - - 4 - - - - 1 - - - - disabled - - - - 7 - - - - 6 - - - - 9 - - - - 8 - - - - 0 - - - - 0 - - - - false - - - - 0 - - - - 6 - - - - 7 - - - - 0 - - - - disabled - - - - 0 - - - - 0 - - - - 0 Hz - - - - 162 - - - - disabled - - - - 2 - - - - 1 - - - - 4 - - - - 1 - - - - 1 - - - - 3 - - - - 100.00 - - - - 0 - - - - OFF - - - - 99 - - - - 5 - - - - 13 - - - - 1 - - - - 3 - - - - 4 - - - - 10 - - - - 11 - - - - CH8 - - - - 10 - - - - 0 - - - - 9 - - - - 1 - - - - 6 - - - - 5 - - - - ISR_SPI0_SSI - - - - 8 - - - - 141 - - - - 7 - - - - WO2_DEF - - - - 8 - - - - 0 - - - - 0 - - - - DIS - - - - 0 - - - - Interrupt disabled - - - - disabled - - - - 0 - - - - 5 - - - - 0 - - - - DISABLE - - - - 4 - - - - disabled - - - - 24000000 - - - - 6 - - - - SCK_DEF - - - - 3 - - - - 0 - - - - 1 - - - - disabled - - - - 100 - - - - 0 - - - - disabled - - - - 2 - - - - 0 - - - - false - - - - disabled - - - - 0 - - - - 160 - - - - 8 - - - - 1 - - - - 0 - - - - 3 - - - - OFF - - - - 12 - - - - 1 - - - - 0 - - - - disabled - - - - true - - - - 1 - - - - 100 - - - - 0 s - - - - alternate - - - - disabled - - - - 10 - - - - 9 - - - - 1 - - - - 0 - - - - 2 - - - - 1 - - - - 1 - - - - 4 - - - - 3 - - - - 6 - - - - 5 - - - - 8 - - - - 97 - - - - 7 - - - - 0 - - - - 0 - - - - OFF - - - - MASK - - - - 1 - - - - 0 - - - - 6 - - - - 1 - - - - false - - - - 1 - - - - 2 - - - - true - - - - 12 - - - - MASK - - - - 163 - - - - INTDISABLE - - - - 3 - - - - 1 - - - - 136 - - - - disabled - - - - 5 - - - - ABOVE - - - - 9 - - - - INTDISABLE - - - - 9 - - - - 142 - - - - 10 - - - - 11 - - - - 8 - - - - 5 - - - - 0 - - - - disabled - - - - 1 - - - - disabled - - - - 3 - - - - 128 - - - - 0 - - - - 0 - - - - 140 - - - - alternate - - - - 0 - - - - 0 - - - - 10 - - - - 11 - - - - 1 - - - - 179 - - - - 0 - - - - OFF - - - - OFF - - - - 5 - - - - 34 - - - - 0 - - - - 5 - - - - 0 - - - - 99 - - - - 1 - - - - 0 - - - - disabled - - - - 5 - - - - disabled - - - - 97 - - - - 0 - - - - 2 - - - - alternate - - - - 36 - - - - ISR_TCA0_LCMP2I - - - - 5 - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - INTDISABLE - - - - 1 - - - - 8 - - - - 3 - - - - 5 - - - - disabled - - - - 3 - - - - 164 - - - - 0 - - - - 9 - - - - 1 - - - - 0 - - - - 0 - - - - LUT4_OUT0_DEF - - - - 3 - - - - 0 - - - - 1 - - - - 1 - - - - 4 - - - - 13 - - - - 0 - - - - 177 - - - - OFF - - - - disabled - - - - 0 - - - - 105 - - - - 10 - - - - 1 - - - - 9 - - - - true - - - - 8 - - - - 7 - - - - false - - - - 8 - - - - 2 - - - - 1 - - - - 1 - - - - 6 - - - - 5 - - - - 4 - - - - 3 - - - - 0 - - - - 1 - - - - 0 - - - - 9 - - - - 0 - - - - 6 - - - - disabled - - - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 5 - - - - 6 - - - - 1 - - - - 7 - - - - 8 - - - - 9 - - - - 10 - - - - 0 - - - - 1 - - - - 1000000 - - - - 224 - - - - 9 - - - - 0 Hz - - - - disabled - - - - 0 Hz - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - disabled - - - - 5 - - - - 34 - - - - 1 - - - - 0 - - - - 161 - - - - 5 - - - - 36 - - - - 3 - - - - 7 - - - - 128 - - - - 2 - - - - 1 - - - - disabled - - - - 1 - - - - 1 - - - - 1 - - - - DEFAULT - - - - 142 - - - - 5 - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - 0 - - - - 1 - - - - 0 - - - - 0 - - - - 4 - - - - 0 Hz - - - - 1 - - - - 0 - - - - 5 - - - - 0 - - - - 0 - - - - 4 - - - - disabled - - - - 104 - - - - 1-32MHz internal oscillator - - - - INTDISABLE - - - - 5 - - - - 1 - - - - 164 - - - - 0 - - - - 1 - - - - 32 - - - - ISR_CCL_INT0 - - - - 2 - - - - 0 - - - - 4 - - - - 0 - - - - 0 - - - - 1 - - - - 1 - - - - 0 - - - - 0 - - - - 0 - - - - 2 - - - - 2 - - - - 0 - - - - 0 - - - - - - - - alternate - - - - 0 - - - - 0 - - - - 6 - - - - 1 - - - - 2 - - - - - - - - MASK - - - - alternate - - - - 0 - - - - disabled - - - - alternate - - - - 7 - - - - 9 - - - - 0 - - - - 96 - - - - 166 - - - - false - - - - 1 - - - - 133 - - - - 6 - - - - 2 - - - - 5 - - - - 0 - - - - 0 - - - - 0 - - - - disabled - - - - false - - - - false - - - - 0 - - - - 1 - - - - NONE - - - - 0 - - - - 0 - - - - MASK - - - - INTDISABLE - - - - 0 - - - - 4 - - - - 3 - - - - 4 - - - - 98 - - - - 0 - - - - DEFAULT - - - - 0 - - - - ISR_CCL_INT5 - - - - 1 - - - - 5 - - - - 1 - - - - 5 - - - - 11 - - - - 178 - - - - 4 - - - - 0 - - - - 10 - - - - 1 - - - - 1 - - - - alternate - - - - DISABLE - - - - 161 - - - - 0 - - - - 1 - - - - System Clock - - - - 0 - - - - 12 - - - - 0 - - - - 132 - - - - 8 - - - - 0 - - - - 0 - - - - 21 - - - - 1 - - - - 19 - - - - 20 - - - - 17 - - - - 18 - - - - 18 - - - - 5 - - - - 3 - - - - 16 - - - - 104 - - - - 6 - - - - 0 - - - - 1 - - - - 137 - - - - 5 - - - - 0 - - - - 167 - - - - 7 - - - - 0 - - - - 0 - - - - OSCHF - - - - 2 - - - - 0 - - - - 1 - - - - 1 - - - - 1 - - - - disabled - - - - DEFAULT - - - - 177 - - - - 0 - - - - 4 - - - - 1 - - - - disabled - - - - 0 - - - - 13 - - - - 1 - - - - 10 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 1 - - - - disabled - - - - disabled - - - - 133 - - - - 0 - - - - INTDISABLE - - - - 96 - - - - 0 - - - - 1 - - - - 5 - - - - disabled - - - - 0 - - - - disabled - - - - disabled - - - - disabled - - - - disabled - - - - 0 - - - - disabled - - - - disabled - - - - 1 - - - - disabled - - - - DEFAULT - - - - disabled - - - - 8 - - - - disabled - - - - 0 - - - - 0 - - - - 9 - - - - false - - - - 6 - - - - enabled - - - - 0 - - - - 1 - - - - 1 - - - - 0 - - - - disabled - - - - 3 - - - - INTDISABLE - - - - 0 - - - - 1 - - - - 0 - - - - 1 - - - - 129 - - - - 136 - - - - 0 - - - - 0 - - - - 1 - - - - disabled - - - - disabled - - - - 11 - - - - disabled - - - - 0 - - - - disabled - - - - 0 - - - - 163 - - - - DEFAULT - - - - 5 - - - - disabled - - - - 0 - - - - disabled - - - - disabled - - - - disabled - - - - 176 - - - - 1 - - - - 0 - - - - 0 - - - - 6 - - - - 0 - - - - 3 - - - - 0 - - - - 1 - - - - - mcc_generated_files\src\protected_io.S - 69d7d2c54bccf38027e4950b66dadc2d9c0be7a2523ffbe4648ec79e87f33522 - - - mcc_generated_files\include\pin_manager.h - b7894e9dd981ea42888149217a2be557882be597dbd7c91cb80ad7dbec5eb9d7 - - - mcc_generated_files\utils\compiler.h - 3f2d7b47b12f2ecbd4c3971644ea7ecd10d2562fc8605a4495bd597eb0f59750 - - - mcc_generated_files\include\spi0.h - cec92f42938499356b1d8121ee5deb2c168dbc06b1d0eb2d304f65dfe3ba3eb2 - - - mcc_generated_files\utils\atomic.h - 80e018fe02cd0c54394bb9a54dcf927d346410567dc6dded62bea9b49e322acf - - - mcc_generated_files\src\pin_manager.c - f3d9eb9acd1b9eee5b706142c69431519b925cb6b51a03cb94a10abeb64068ba - - - mcc_generated_files\src\cpuint.c - caeb52768999d91897f0ac3b19f4b61e8089d3306ffface466d36a3b680d875d - - - mcc_generated_files\utils\interrupt_avr8.h - 98adc596175f2e76d4d918685cf050032a3efb605901edb6be0a35dda05a57e9 - - - mcc_generated_files\include\evsys.h - 54b930d44203c05f1498ef6e27e6b115b4d5fae70244d4020632a37b47c38e3f - - - mcc_generated_files\include\ccp.h - 60059cb974788916ec20d13197b009f4436b347f7eed014aa44aaebf6c516ff1 - - - mcc_generated_files\include\protected_io.h - 1dd02ce5af5c0f4624172e0ef0bb52d6c8bacb87beabf9d7129d684def52db23 - - - mcc_generated_files\mcc.c - bb4324e52a3ef6b0ea32a18ac7b3b7722b2c763a1192bea710249db0056f841b - - - mcc_generated_files\include\ccl.h - 1479bb8445e2909237e61b9b3c082ff2acae240aaf61043d722802d37abaf40c - - - mcc_generated_files\utils\assembler\iar.h - 02efe91f6b4b8b31e5d6141c604f6f918f641f26433ffc12de9de3106df36a2e - - - mcc_generated_files\mcc.h - 0ee6043adace9fcebd307c9e5f0a3e443e4d404cedd562dbff2edadc9a971b02 - - - mcc_generated_files\include\port.h - 2cbca36d0ae0501333b71a678a15eb5f30b7d2829c091e5b0331a8d8350bed79 - - - mcc_generated_files\include\tca0.h - 9348df821279b8b3f1bbcde896ba008aedeb8dbc7ba016b66dd5d28be4ca8484 - - - main.c - ad6433d2c98b42e7128f2ebaca15eb375df8a83f923bb0a884d7b0373577396a - - - mcc_generated_files\device_config.c - 832fa864b162a566ac803d20eb541f6a8c7a75fa4c8151e57f5949a68a815aaa - - - mcc_generated_files\utils\utils.h - 38ff19ccdabdd432c321983f3c9190d1767c6e2ac0dc1bba384fc36c62989559 - - - mcc_generated_files\utils\assembler.h - 90b346ff1c59de9e2d44827ebdb0d696965fdfc8a741bc69a880a8ebc2bf61cc - - - mcc_generated_files\src\tca0.c - e92c9ed6c4bb65f4bf96bd05690f98e80c02cc2d05d0d3f67b2a54c1eed3cc6e - - - mcc_generated_files\utils\utils_assert.h - 002db199835943a5e634d5e9904119d0f50eb94af5300454791a93c81c5353b7 - - - mcc_generated_files\include\cpuint.h - 802591ef9a8f76d82a9ebdd96dac4c62c9a3c56d991188efaebd5ec3ca4228e2 - - - mcc_generated_files\include\rstctrl.h - 3aaf94dcc7f4f51ce811c4b290f1dbcd29748fb231cb4d3e7f27f49586651c83 - - - mcc_generated_files\src\ccl.c - 965642087506b1f4bfd8c5ee6d7c13a3665491e1d2e86a9ed21dd5630b1572c1 - - - mcc_generated_files\config\clock_config.h - 04b6e55dcba9f9bed703717cfb1f99994506fdd1a72546e3debf8e4b072d0a46 - - - mcc_generated_files\src\evsys.c - 7f245e48e52bfb30797396eb93f35e135250f0db90707d9b83f342ddef72a61e - - - mcc_generated_files\utils\assembler\gas.h - a866545cef7518629f24cbd3ca0494f523bf2d19d9b486b2a1c57be653f54d63 - - - mcc_generated_files\src\spi0.c - 28f1ec6ac4439ff6f44bb02bb7e79a46774710965fa5eb6913fa1592fd9da187 - - - - \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/avr128da48-cnano-ws2812-mplab-mcc.mc3 b/avr128da48-cnano-ws2812-mplab-mcc.X/avr128da48-cnano-ws2812-mplab-mcc.mc3 new file mode 100644 index 0000000..393e058 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/avr128da48-cnano-ws2812-mplab-mcc.mc3 @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Application Builder + class com.microchip.mcc.melody.module.FrameworkModule + + + CCL + class com.microchip.mcc.melody.hw.module.HardwareModule + + + CLKCTRL + class com.microchip.mcc.melody.hw.module.HardwareModule + + + CPUINT + class com.microchip.mcc.melody.hw.module.HardwareModule + + + Configuration Bits + class com.microchip.mcc.melody.hw.module.HardwareModule + + + EVSYS + class com.microchip.mcc.melody.hw.module.HardwareModule + + + MAIN MANAGER + class com.microchip.mcc.melody.hw.module.HardwareModule + + + Pin Manager + class com.microchip.mcc.melody.hw.module.HardwareModule + + + SPI0 + class com.microchip.mcc.melody.hw.module.HardwareModule + + + TCA0 + class com.microchip.mcc.melody.hw.module.HardwareModule + + + meta + class com.microchip.mcc.melody.hw.module.HardwareModule + + + module0 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module1 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module10 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module2 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module25 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module3 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module38 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module4 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module50 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module71 + class com.microchip.mcc.melody.script.module.ScriptModule + + + + + + + + + {"mccDevice":{"loc":"0 0","pos":"0 0"},"systemGroup":{"loc":"171 0","pos":"171 0"},"module10":{"loc":"343 0","pos":"343 0"},"module38":{"loc":"0 171","pos":"0 171"},"module50":{"loc":"172 171","pos":"172 171"},"module71":{"loc":"344 171","pos":"344 171"}} + + + + {"userAddedModules":["module10","module4","module25","module38","module1","module50","module0","module71","module3","module2"],"version":"CURRENT","modules":{"module10":{"scriptId":"@mchp-mcc/scf-avr8-tca-v1","imports":{"osc_clock":{"interfaceId":{"name":"osc-clocks","version":"^0"},"handle":{"providerId":"module3","exportId":"osc_clocks"}},"pin_standard":{"interfaceId":{"name":"pin-standard","version":"^0"},"handle":{"providerId":"module2","exportId":"pin-standard"}},"scf_avr8_tca_v1":{"interfaceId":{"name":"scf-avr8-tca-v1","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"TCA0"}},"interrupt_standard":{"interfaceId":{"name":"interrupt-standard","version":"^1"},"handle":{"providerId":"module4","exportId":"interrupt"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0"},"handle":{"providerId":"module0","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"waveform":{"wgmodeTcaSingleCtrlb":"Single Slope PWM","wo0":true,"wo2":true,"PWMDC0":0.4,"PWMDC2":0.7},"hardware":{"requestedTimeNorm":1.0E-4,"evactbTcaSingleEvctrl":"RESTART_POSEDGE","cntbeiTcaSingleEvctrl":true},"timerChannels":{"PWMModeTable":[{"rowId":0.0,"uid":"channel0","reqDuty":"0.4"},{"rowId":2.0,"uid":"channel2","reqDuty":"0.7"}]}}}},"module4":{"scriptId":"@mchp-mcc/scf-avr8-interrupt-v1","imports":{"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"scf_avr8_interrupt_v1":{"interfaceId":{"name":"scf-avr8-interrupt-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"CPUINT"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0"},"handle":{"providerId":"module0","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]}},"module25":{"scriptId":"@mchp-mcc/main-manager","imports":{"main":{"interfaceId":{"name":"main-manager","version":"^1.*"},"handle":{"providerId":"mccDevice","exportId":"MAIN MANAGER"}}},"framewSpecificState":{"userEditedImports":[]}},"module38":{"scriptId":"@mchp-mcc/scf-avr8-ccl-v1","imports":{"scf_avr8_ccl_v1":{"interfaceId":{"name":"scf-avr8-ccl-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"CCL"}},"pin_standard":{"interfaceId":{"name":"pin-standard","version":"^0.*"},"handle":{"providerId":"module2","exportId":"pin-standard"}},"interrupt_standard":{"interfaceId":{"name":"interrupt-standard","version":"^1"},"handle":{"providerId":"module4","exportId":"interrupt"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"osc_clocks":{"interfaceId":{"name":"osc-clocks","version":"^0"},"handle":{"providerId":"module3","exportId":"osc_clocks"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0"},"handle":{"providerId":"module0","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"hardware":{"insel0Lut0ctrlb":"TCA0","insel1Lut0ctrlb":"SPI0","insel2Lut0ctrlc":"TCA0","enableLut0ctrla":true,"outenLut0ctrla":true}},"lut0GateType":"Custom","lut0CustomOutput":224.0}},"module1":{"scriptId":"@mchp-mcc/avr8-pin-manager","imports":{"avr8-pin-manager":{"interfaceId":{"name":"avr8-pin-manager","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"Pin Manager"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0.*"},"handle":{"providerId":"module0","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"adapterdata":{"cname":{"eview":{"dataMap":{"PA0":{"value":"TCA0_WO0"},"PA2":{"value":"TCA0_WO2"},"PA3":{"value":"LUT0_OUT"},"PA5":{"value":"SPI0_MISO"},"PA4":{"value":"SPI0_MOSI"},"PA6":{"value":"SPI0_SCK"},"PA7":{"value":"SPI0_SS"}}}}}}},"module50":{"scriptId":"@mchp-mcc/scf-avr8-spi-v1","imports":{"pin_standard":{"interfaceId":{"name":"pin-standard","version":"^0"},"handle":{"providerId":"module2","exportId":"pin-standard"}},"scf_avr8_spi_v1":{"interfaceId":{"name":"scf-avr8-spi-v1","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"SPI0"}},"interrupt_standard":{"interfaceId":{"name":"interrupt-standard","version":"^1"},"handle":{"providerId":"module4","exportId":"interrupt"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"osc_clocks":{"interfaceId":{"name":"osc-clocks","version":"^0"},"handle":{"providerId":"module3","exportId":"osc_clocks"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0"},"handle":{"providerId":"module0","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"hardware":{"mode":"Host","desiredClockSpeed":750000.0,"enableCtrla":true,"modeCtrlb":"1"}}}},"module0":{"scriptId":"@mchp-mcc/avr8-configuration-bits-v1","imports":{"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"initializer_main":{"interfaceId":{"name":"initializer-main","version":"^0.3.0"},"handle":{"providerId":"module25","exportId":"initializer_main"}},"avr8_configuration_bits_v1":{"interfaceId":{"name":"avr8-configuration-bits-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"Configuration Bits"}}},"framewSpecificState":{"userEditedImports":[]}},"module71":{"scriptId":"@mchp-mcc/scf-avr8-evsys-v1","imports":{"scf_avr8_evsys_v1":{"interfaceId":{"name":"scf-avr8-evsys-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"EVSYS"}},"pin_standard":{"interfaceId":{"name":"pin-standard","version":"^0"},"handle":{"providerId":"module2","exportId":"pin-standard"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0.*"},"handle":{"providerId":"module0","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"software":{"componentName":"EVSYS"},"hardware":{"channel0Channel0":"SPI0_SCK","userUsertca0cntb":"CHANNEL0"},"linkedArrowData":[{"__gohashid":12363.0,"from":"channel0Channel0SPI 0 SCK","to":"CHANNEL0","linkingData":{"regName":"channel0Channel0","value":"SPI0_SCK","__gohashid":12374.0},"toPort":"ChannelInput","key":-1.0},{"__gohashid":12900.0,"from":"CHANNEL0","to":"USERTCA0CNTB","linkingData":"ChannelOutput","toPort":{"regName":"userUsertca0cntb","value":"Usertca0cntb","__gohashid":12911.0},"key":-2.0}]}}},"module3":{"scriptId":"@mchp-mcc/scf-avr8-clkctrl-v1","imports":{"pin_standard":{"interfaceId":{"name":"pin-standard","version":"^0"},"handle":{"providerId":"module2","exportId":"pin-standard"}},"scf_avr8_clkctrl_v1":{"interfaceId":{"name":"scf-avr8-clkctrl-v1","version":"^1.0.0"},"handle":{"providerId":"mccDevice","exportId":"CLKCTRL"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"config_device":{"interfaceId":{"name":"config-device","version":"^1.1.1"},"handle":{"providerId":"module0","exportId":"config_device"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0"},"handle":{"providerId":"module0","exportId":"initializer_system"}},"config_request":{"interfaceId":{"name":"config-request","version":"^2.0.1"},"handle":{"providerId":"module0","exportId":"config_request"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"hardware":{"frqselOschfctrla":"24 MHz system clock"}}}},"module2":{"scriptId":"@mchp-mcc/pin-content-processor","imports":{"device-meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"pin-architecture":{"interfaceId":{"name":"pin-architecture","version":"1.0.0"},"handle":{"providerId":"module1","exportId":"pin-architecture"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"saved":{"rows":{"pcp":{"GPIO$GPIO$input":{"pins":{"PA7":{"state":"MUL"}}},"GPIO$GPIO$output":{"pins":{"PA7":{"state":"L"}}}}},"userEditedData":{"cname":{"eview":{"PA0":"TCA0_WO0","PA2":"TCA0_WO2","PA3":"LUT0_OUT","PA5":"SPI0_MISO","PA4":"SPI0_MOSI","PA6":"SPI0_SCK","PA7":"SPI0_SS"}}}}}}},"content":{"@mchp-mcc/avr-8bit":"4.7.0","@mchp-mcc/pin-content-processor":"3.6.0","@mchp-mcc/avr8-pin-manager":"4.5.0","@mchp-mcc/scf-avr8-tca-v1":"6.0.9","@mchp-mcc/scf-avr8-evsys-v1":"1.1.0","@mchp-mcc/scf-avr8-spi-v1":"4.1.12","@mchp-mcc/scf-avr8-ccl-v1":"3.1.4","@mchp-mcc/scf-avr8-interrupt-v1":"5.0.12","@mchp-mcc/scf-avr8-clkctrl-v1":"5.3.5","@mchp-mcc/main-manager":"3.1.1","@mchp-mcc/avr8-configuration-bits-v1":"4.2.12"}} + + + + + mcc_generated_files\evsys\src\evsys.c + 366ee2a7eee22d2ab40eaa8863fc7e32ced613de9c26ca79efee0f0ba93b3ed9 + + + mcc_generated_files\system\interrupt.h + 75695d9cc1e45b240332ce98cce195022df36e1a15d4891d26cff6e390f2b765 + + + mcc_generated_files\system\utils\compiler.h + 78fc7aaa9215a68e38da793ec09d384598330944557b49c79aef4af747e76e08 + + + mcc_generated_files\timer\timer_interface.h + c663a68f1004f660bf34cd96cf61a9012847f97b9cff5098686010e234deb62a + + + mcc_generated_files\system\port.h + 3683f158a55d8eef2efa3d884de6deac57477b7705af0b8241682cb869f2fe90 + + + mcc_generated_files\system\utils\interrupt_avr8.h + bf66a9d1b57d17151c1aa3b9e207a694bbf854df962b69135c6d922d026ce7cf + + + mcc_generated_files\system\pins.h + 7183406fdaa1b44246627da5d1e24dfdbd1dd29e8f7fcf7c40a252d8036dacc0 + + + mcc_generated_files\system\utils\utils_assert.h + e6a57e1164f862da6a703fa67c200945b7a21fb6ab9e9b57ff14507467e04cc6 + + + mcc_generated_files\system\utils\assembler\iar.h + baafb63c988a088a34457e1d6433e87a0b658d1486fce12eec427b9457991549 + + + mcc_generated_files\system\src\pins.c + 3a82a60e5c80027d4d83571c3313c45e3920df2ab19d03860e1e407a5b1b6378 + + + mcc_generated_files\timer\tca0.h + 5aac000bbb51c8915bdd2fefdd2604375562c69acef5023955296a387357647e + + + mcc_generated_files\spi\spi_interface.h + cd755e06457e2bb365bd4f949fdf7e49f12f9a89a3316457f3ff05083b538ffe + + + mcc_generated_files\system\src\clock.c + eda4f3409a15cd330130372b9234994128d27fa3dd4fe016de2547b00d4c7dcb + + + mcc_generated_files\system\clock.h + 16a585c7b05f16a3c58c7ae6532e14d89531132b73db5bc122f5bd1662cd1968 + + + mcc_generated_files\system\utils\atomic.h + 2a0975cf197fcfdec0a503a3e3b899336a83d123a3066d0e8c2b3fc5dbc3d6ac + + + mcc_generated_files\evsys\evsys.h + 1d3222a1bf28723b150f56182472a0e804022e01ee8c053d656845f15dcd41e1 + + + mcc_generated_files\spi\src\spi0.c + 502c1a7ed02cfc4c589af641c475e82cb60f88c8a67139ed8e63e702eae285e8 + + + mcc_generated_files\system\ccp.h + 771ef1ef56b145740365ded07000a4e9820fc4e2c7025b40ab80bf13288ee5e3 + + + mcc_generated_files\system\system.h + cf357a2a0cbe35c2d96a59a3e8628fa8599dafe0543f89a3f22075136130aeb2 + + + main.c + a0e31898f37822d5d434ac96e346238a6de7354dfb7de5e96fdcb0bb33f746ed + + + mcc_generated_files\system\utils\assembler\gas.h + 05129f00ef45a989573a0427f37de7661fa3005f22778ad24c0dca228468a018 + + + mcc_generated_files\system\src\interrupt.c + 913ff00e35adde59c34b51fdd0c16fa67096f7dd67900cead6dc1c6d9021ffde + + + mcc_generated_files\timer\src\tca0.c + 4cd505cf1b84f1b903d9e73424dcd583a7177a4545293d2f78aa0f1f19ac57c0 + + + mcc_generated_files\system\utils\utils.h + d02918b46fc138c440e381cb9a557c9f69c1cc3eb141f007b0a3738f02f4d543 + + + mcc_generated_files\system\config_bits.h + fa24220622dc1f4ebda67e226cb7480d29e7dcb70ba069c8a618c7d1cc67a0ef + + + mcc_generated_files\system\utils\assembler.h + a51d2178d0c940ae2d1b51eff122d0d63e53efe29edb2fb8c7fbd78b1c2fcabe + + + mcc_generated_files\spi\spi0.h + 7de4979dec97bef47aade18f454cef7c02916896d149595bcd90195c53dc19bc + + + mcc_generated_files\system\src\protected_io.S + 3bb77a623e934d19f38ed22bfd302ac90e929cb841406c027d11193bd5358b36 + + + mcc_generated_files\system\src\config_bits.c + 479702ca19c388e4bc8accc237cb66c1d44ad0b9494ce470bfb3875e5e592c08 + + + mcc_generated_files\ccl\ccl.h + ed2c1caf432a0d981f1705c5e43fbdecffce26b9f3c5afe27d4e9458c43d0736 + + + mcc_generated_files\system\protected_io.h + 2197a3749e9525a893011ccc9095321665641b68aeda5ebbea9d2711ab3f9aa7 + + + mcc_generated_files\ccl\src\ccl.c + 47d2dcd036ab110c724ea967dbec8fdac10ad461ee1d793984582653e6e0e42e + + + mcc_generated_files\system\src\system.c + 16ac3426d50cafe78dfd209cf965ac0edf74de8f49f1f365e722500558d3a323 + + + \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/main.c b/avr128da48-cnano-ws2812-mplab-mcc.X/main.c index 8f5955a..58ba466 100644 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/main.c +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/main.c @@ -1,139 +1,131 @@ /* - (c) 2020 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that + (c) 2023 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS + + THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER + EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY + IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS + + IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND + WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP + HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO + THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL + CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT + OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. */ -#include "mcc_generated_files/mcc.h" +#include "mcc_generated_files/system/system.h" + #include -#define TCA0_Enable() do {TCA0.SINGLE.CTRLA |= TCA_SINGLE_ENABLE_bm;} while(0) -#define TCA0_Disable() do {TCA0.SINGLE.CTRLA &= ~TCA_SINGLE_ENABLE_bm;} while(0) -#define LED_MAX_BRIGHT 0xFF -#define LED_MIN_BRIGHT 0x00 -#define NUMBER_OF_LEDS 13 -#define DELAY_TIME 100 //milliseconds -#define POSITION_MIN 0 -#define POSITION_MAX (NUMBER_OF_LEDS - 1) +#define NUMBER_OF_LEDS ( 10 ) +#define DELAY_TIME_MS ( 100 ) -const uint8_t colorTable[] = -{ - LED_MAX_BRIGHT, LED_MIN_BRIGHT, LED_MIN_BRIGHT, // red - LED_MAX_BRIGHT, LED_MAX_BRIGHT, LED_MIN_BRIGHT, // yellow - LED_MIN_BRIGHT, LED_MAX_BRIGHT, LED_MIN_BRIGHT, // green - LED_MIN_BRIGHT, LED_MAX_BRIGHT, LED_MAX_BRIGHT, // cyan - LED_MIN_BRIGHT, LED_MIN_BRIGHT, LED_MAX_BRIGHT, // blue - LED_MAX_BRIGHT, LED_MIN_BRIGHT, LED_MAX_BRIGHT // purple -}; -typedef struct +#define LED_MIN_BRIGHT ( 0x00 ) +#define LED_MAX_BRIGHT ( 0xFF ) +#define POSITION_MIN ( 0 ) +#define POSITION_MAX ( NUMBER_OF_LEDS - 1 ) + + +typedef struct COLOR { uint8_t redChannel; uint8_t greenChannel; uint8_t blueChannel; } color_t; -void WalkLight(color_t color); -void LightIntoPosition(color_t color, uint8_t position); -void SetLEDColor(color_t color); -void ClearLEDs(void); + +inline void ClearLEDs(void); +void WalkLight(color_t const color); +void LightIntoPosition(color_t const color, uint8_t const position); +void SetLEDColor(color_t const color); + + +color_t const colorTable[] = +{ + { LED_MAX_BRIGHT, LED_MIN_BRIGHT, LED_MIN_BRIGHT }, // Red + { LED_MAX_BRIGHT, LED_MAX_BRIGHT, LED_MIN_BRIGHT }, // Yellow + { LED_MIN_BRIGHT, LED_MAX_BRIGHT, LED_MIN_BRIGHT }, // Green + { LED_MIN_BRIGHT, LED_MAX_BRIGHT, LED_MAX_BRIGHT }, // Cyan + { LED_MIN_BRIGHT, LED_MIN_BRIGHT, LED_MAX_BRIGHT }, // Blue + { LED_MAX_BRIGHT, LED_MIN_BRIGHT, LED_MAX_BRIGHT } // Purple +}; + +color_t const off = {LED_MIN_BRIGHT, LED_MIN_BRIGHT, LED_MIN_BRIGHT}; + int main(void) { - color_t currentColor; - uint8_t colorIndex = 0; - uint8_t i; - - /* Initializes MCU, drivers and middle ware */ SYSTEM_Initialize(); - ClearLEDs(); - - _delay_ms(DELAY_TIME); - while (1) + ClearLEDs(); + + _delay_ms(DELAY_TIME_MS); + + while (true) { - colorIndex = 0; - for(i = 0; i < 6; i++) + for(uint8_t colorIdx = 0; colorIdx < 6; ++colorIdx) { - currentColor.redChannel = colorTable[colorIndex++]; - currentColor.greenChannel = colorTable[colorIndex++]; - currentColor.blueChannel = colorTable[colorIndex++]; + color_t const currentColor = colorTable[colorIdx]; WalkLight(currentColor); } } } -void WalkLight(color_t color) +inline void ClearLEDs(void) { - uint8_t i; - - for(i = POSITION_MIN; i < POSITION_MAX; i++) + for (uint8_t ledIdx = 0; ledIdx < NUMBER_OF_LEDS; ++ledIdx) { - LightIntoPosition(color, i); - _delay_ms(DELAY_TIME); - } - - for(i = POSITION_MAX+1; i > POSITION_MIN; i--) - { - LightIntoPosition(color, i-1); - _delay_ms(DELAY_TIME); + SetLEDColor(off); } } -void LightIntoPosition(color_t color, uint8_t position) +void WalkLight(color_t const color) { - uint8_t i; - color_t off = {LED_MIN_BRIGHT, LED_MIN_BRIGHT, LED_MIN_BRIGHT}; - - for(i = 0; i < position; i++) + for (uint8_t position = POSITION_MIN; position < POSITION_MAX; ++position) + { + LightIntoPosition(color, position); + _delay_ms(DELAY_TIME_MS); + } + + for (uint8_t position = POSITION_MAX + 1; position > POSITION_MIN; --position) + { + LightIntoPosition(color, position - 1); + _delay_ms(DELAY_TIME_MS); + } +} + +void LightIntoPosition(color_t const color, uint8_t const position) +{ + for (uint8_t idx = 0; idx < position; ++idx) { SetLEDColor(off); } - + SetLEDColor(color); - - for(i = position + 1; i < NUMBER_OF_LEDS; i++) + + for (uint8_t idx = position + 1; idx < NUMBER_OF_LEDS; ++idx) { SetLEDColor(off); } } -void SetLEDColor(color_t color) +void SetLEDColor(color_t const color) { - TCA0_Enable(); - - SPI0_ExchangeByte(color.redChannel); - SPI0_ExchangeByte(color.blueChannel); - SPI0_ExchangeByte(color.greenChannel); - - TCA0_Disable(); -} + TCA0_Start(); -void ClearLEDs(void) -{ - int i; - color_t off = {LED_MIN_BRIGHT, LED_MIN_BRIGHT, LED_MIN_BRIGHT}; - - for(i = 0; i < NUMBER_OF_LEDS; i++) - { - SetLEDColor(off); - } -} \ No newline at end of file + SPI0_ByteExchange(color.redChannel); + SPI0_ByteExchange(color.blueChannel); + SPI0_ByteExchange(color.greenChannel); + + TCA0_Stop(); +} diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/ccl/ccl.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/ccl/ccl.h new file mode 100644 index 0000000..7ca2f76 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/ccl/ccl.h @@ -0,0 +1,38 @@ +/** + * CCL Generated Header File + * + * @file ccl.h + * + * @defgroup ccl CCL + * + * @brief This file contains the API prototype for the CCL driver. + * + * @version Driver Version 1.1.0 +*/ + +#include +#include + +#ifndef CCL_H_INCLUDED +#define CCL_H_INCLUDED + +#include "../system/utils/compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @ingroup ccl + * @brief Initializes the CCL. This is called only once during the system initialization. + * @pre None. + * @param None. + * @return None. + */ +int8_t CCL_Initialize(void); + +#ifdef __cplusplus +} +#endif + +#endif /* CCL_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/ccl/src/ccl.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/ccl/src/ccl.c new file mode 100644 index 0000000..7395b92 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/ccl/src/ccl.c @@ -0,0 +1,144 @@ +/** + * CCL Generated Driver File + * + * @file ccl.c + * + * @ingroup ccl + * + * @brief This file contains the API implementations for the CCL driver. + * + * @version Driver Version 1.1.1 +*/ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include "../ccl.h" + +int8_t CCL_Initialize(void) +{ + //INTMODE0 INTDISABLE; INTMODE1 INTDISABLE; INTMODE2 INTDISABLE; INTMODE3 INTDISABLE; + CCL.INTCTRL0 = 0x0; + + //INTMODE4 INTDISABLE; INTMODE5 INTDISABLE; + CCL.INTCTRL1 = 0x0; + + //INT 0x0; + CCL.INTFLAGS = 0x0; + + //INSEL0 TCA0; INSEL1 SPI0; + CCL.LUT0CTRLB = 0x9A; + + //INSEL2 TCA0; + CCL.LUT0CTRLC = 0xA; + + //INSEL0 MASK; INSEL1 MASK; + CCL.LUT1CTRLB = 0x0; + + //INSEL2 MASK; + CCL.LUT1CTRLC = 0x0; + + //INSEL0 MASK; INSEL1 MASK; + CCL.LUT2CTRLB = 0x0; + + //INSEL2 MASK; + CCL.LUT2CTRLC = 0x0; + + //INSEL0 MASK; INSEL1 MASK; + CCL.LUT3CTRLB = 0x0; + + //INSEL2 MASK; + CCL.LUT3CTRLC = 0x0; + + //INSEL0 MASK; INSEL1 MASK; + CCL.LUT4CTRLB = 0x0; + + //INSEL2 MASK; + CCL.LUT4CTRLC = 0x0; + + //INSEL0 MASK; INSEL1 MASK; + CCL.LUT5CTRLB = 0x0; + + //INSEL2 MASK; + CCL.LUT5CTRLC = 0x0; + + //SEQSEL DISABLE; + CCL.SEQCTRL0 = 0x0; + + //SEQSEL DISABLE; + CCL.SEQCTRL1 = 0x0; + + //SEQSEL DISABLE; + CCL.SEQCTRL2 = 0x0; + + //TRUTH 224; + CCL.TRUTH0 = 0xE0; + + //TRUTH 0; + CCL.TRUTH1 = 0x0; + + //TRUTH 0; + CCL.TRUTH2 = 0x0; + + //TRUTH 0; + CCL.TRUTH3 = 0x0; + + //TRUTH 0; + CCL.TRUTH4 = 0x0; + + //TRUTH 0; + CCL.TRUTH5 = 0x0; + + //CLKSRC CLKPER; EDGEDET DIS; ENABLE enabled; FILTSEL DISABLE; OUTEN enabled; + CCL.LUT0CTRLA = 0x41; + + //CLKSRC CLKPER; EDGEDET DIS; ENABLE disabled; FILTSEL DISABLE; OUTEN disabled; + CCL.LUT1CTRLA = 0x0; + + //CLKSRC CLKPER; EDGEDET DIS; ENABLE disabled; FILTSEL DISABLE; OUTEN disabled; + CCL.LUT2CTRLA = 0x0; + + //CLKSRC CLKPER; EDGEDET DIS; ENABLE disabled; FILTSEL DISABLE; OUTEN disabled; + CCL.LUT3CTRLA = 0x0; + + //CLKSRC CLKPER; EDGEDET DIS; ENABLE disabled; FILTSEL DISABLE; OUTEN disabled; + CCL.LUT4CTRLA = 0x0; + + //CLKSRC CLKPER; EDGEDET DIS; ENABLE disabled; FILTSEL DISABLE; OUTEN disabled; + CCL.LUT5CTRLA = 0x0; + + //ENABLE enabled; RUNSTDBY disabled; + CCL.CTRLA = 0x1; + + + return 0; +} + +ISR(CCL_CCL_vect) +{ + /* + * Insert your CCL interrupt handling code + * + * Interrupt flag can be cleared by writing 1 to its bit location + * in the INTFLAGS register + */ + +} diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/config/clock_config.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/config/clock_config.h deleted file mode 100644 index 018e0dc..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/config/clock_config.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef CLOCK_CONFIG_H -#define CLOCK_CONFIG_H - -#ifndef F_CPU -#define F_CPU 24000000 -#endif - -#endif // CLOCK_CONFIG_H diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/device_config.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/device_config.c deleted file mode 100644 index 0c6101d..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/device_config.c +++ /dev/null @@ -1,49 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#include - -/** - * \Configures Fuse bits - */ - -FUSES = -{ - .BODCFG = ACTIVE_DISABLE_gc | LVL_BODLEVEL0_gc | SAMPFREQ_128Hz_gc | SLEEP_DISABLE_gc, - .BOOTSIZE = 0, - .CODESIZE = 0, - .OSCCFG = CLKSEL_OSCHF_gc, - .SYSCFG0 = CRCSEL_CRC16_gc | CRCSRC_NOCRC_gc | RSTPINCFG_GPIO_gc, - .SYSCFG1 = SUT_0MS_gc, - .WDTCFG = PERIOD_OFF_gc | WINDOW_OFF_gc, -}; diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/evsys/evsys.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/evsys/evsys.h new file mode 100644 index 0000000..8919314 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/evsys/evsys.h @@ -0,0 +1,62 @@ +/** + * + * @file evsys.h + * + * @defgroup evsys_driver Event System + * + * @brief This file contains API prototypes for EVSYS driver. + * + * @version EVSYS Driver Version 1.1.0 + */ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef EVSYS_H_INCLUDED +#define EVSYS_H_INCLUDED + +#include "../system/utils/compiler.h" + +/** + * @ingroup evsys_driver + * @brief Initializes the EVSYS driver. + * @param none + * @return none + */ +int8_t EVSYS_Initialize(void); + +/** + * @ingroup evsys_driver + * @brief Updates the SWEVENTA register. + * @param channel - 8-bit integer representing event channel that generates a software event. For example to select CH0(CHANNEL0) set value as 0x1. + * @return none + */ +void EVSYS_SoftwareEventASet(uint8_t channel); + +/** + * @ingroup evsys_driver + * @brief Updates the SWEVENTB register. + * @param channel - 8-bit integer representing event channel that generates a software event. For example to select CH8(CHANNEL8) set value as 0x1. + * @return none + */ +void EVSYS_SoftwareEventBSet(uint8_t channel); + +#endif /* EVSYS_H_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/evsys/src/evsys.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/evsys/src/evsys.c new file mode 100644 index 0000000..b60c840 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/evsys/src/evsys.c @@ -0,0 +1,145 @@ +/** + * + * @file evsys.c + * + * @ingroup evsys_driver + * + * @brief This file contains the implementation for EVSYS driver + * + * @version EVSYS Driver Version 1.1.0 + */ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include "../evsys.h" + +int8_t EVSYS_Initialize() +{ + //CHANNEL0 SPI0_SCK; + EVSYS.CHANNEL0 = 0x68; + //CHANNEL1 OFF; + EVSYS.CHANNEL1 = 0x0; + //CHANNEL2 OFF; + EVSYS.CHANNEL2 = 0x0; + //CHANNEL3 OFF; + EVSYS.CHANNEL3 = 0x0; + //CHANNEL4 OFF; + EVSYS.CHANNEL4 = 0x0; + //CHANNEL5 OFF; + EVSYS.CHANNEL5 = 0x0; + //USER OFF; + EVSYS.USERADC0START = 0x0; + //USER OFF; + EVSYS.USERCCLLUT0A = 0x0; + //USER OFF; + EVSYS.USERCCLLUT0B = 0x0; + //USER OFF; + EVSYS.USERCCLLUT1A = 0x0; + //USER OFF; + EVSYS.USERCCLLUT1B = 0x0; + //USER OFF; + EVSYS.USERCCLLUT2A = 0x0; + //USER OFF; + EVSYS.USERCCLLUT2B = 0x0; + //USER OFF; + EVSYS.USERCCLLUT3A = 0x0; + //USER OFF; + EVSYS.USERCCLLUT3B = 0x0; + //USER OFF; + EVSYS.USEREVSYSEVOUTA = 0x0; + //USER OFF; + EVSYS.USEREVSYSEVOUTB = 0x0; + //USER OFF; + EVSYS.USERTCA0CNTA = 0x0; + //USER CHANNEL0; + EVSYS.USERTCA0CNTB = 0x1; + //USER OFF; + EVSYS.USERTCB0CAPT = 0x0; + //USER OFF; + EVSYS.USERTCB0COUNT = 0x0; + //USER OFF; + EVSYS.USERTCB1CAPT = 0x0; + //USER OFF; + EVSYS.USERTCB1COUNT = 0x0; + //USER OFF; + EVSYS.USERUSART0IRDA = 0x0; + //USER OFF; + EVSYS.USERUSART1IRDA = 0x0; + //USER OFF; + EVSYS.USEREVSYSEVOUTC = 0x0; + //CHANNEL6 OFF; + EVSYS.CHANNEL6 = 0x0; + //CHANNEL7 OFF; + EVSYS.CHANNEL7 = 0x0; + //USER OFF; + EVSYS.USEREVSYSEVOUTD = 0x0; + //USER OFF; + EVSYS.USEREVSYSEVOUTF = 0x0; + //USER OFF; + EVSYS.USERPTCSTART = 0x0; + //USER OFF; + EVSYS.USERTCB2CAPT = 0x0; + //USER OFF; + EVSYS.USERTCB2COUNT = 0x0; + //USER OFF; + EVSYS.USERTCD0INPUTA = 0x0; + //USER OFF; + EVSYS.USERTCD0INPUTB = 0x0; + //USER OFF; + EVSYS.USERUSART2IRDA = 0x0; + //CHANNEL8 OFF; + EVSYS.CHANNEL8 = 0x0; + //CHANNEL9 OFF; + EVSYS.CHANNEL9 = 0x0; + //USER OFF; + EVSYS.USERCCLLUT4A = 0x0; + //USER OFF; + EVSYS.USERCCLLUT4B = 0x0; + //USER OFF; + EVSYS.USERCCLLUT5A = 0x0; + //USER OFF; + EVSYS.USERCCLLUT5B = 0x0; + //USER OFF; + EVSYS.USEREVSYSEVOUTE = 0x0; + //USER OFF; + EVSYS.USERTCA1CNTA = 0x0; + //USER OFF; + EVSYS.USERTCA1CNTB = 0x0; + //USER OFF; + EVSYS.USERTCB3CAPT = 0x0; + //USER OFF; + EVSYS.USERTCB3COUNT = 0x0; + //USER OFF; + EVSYS.USERUSART3IRDA = 0x0; + //USER OFF; + EVSYS.USERUSART4IRDA = 0x0; + + return 0; +} + +void EVSYS_SoftwareEventASet(uint8_t channel){ + EVSYS.SWEVENTA = channel; +} + +void EVSYS_SoftwareEventBSet(uint8_t channel){ + EVSYS.SWEVENTB = channel; +} diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/ccl.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/ccl.h deleted file mode 100644 index 0b64ebf..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/ccl.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef CCL_H_INCLUDED -#define CCL_H_INCLUDED - -#include "../utils/compiler.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - @Summary - Initializes the CCL_Initialize. - - @Description - This routine initializes the CCL_Initialize. - This routine should only be called once during system initialization. - - @Preconditions - None - - @Param - None - - @Example - - CCL_Initialize(); - -*/ -int8_t CCL_Initialize(void); - -#ifdef __cplusplus -} -#endif - -#endif /* CCL_H_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/ccp.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/ccp.h deleted file mode 100644 index 9f416a0..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/ccp.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef CPU_CCP_H -#define CPU_CCP_H - -#include "../utils/compiler.h" -#include "../include/protected_io.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Write to a CCP-protected 8-bit I/O register - * - * \param addr Address of the I/O register - * \param value Value to be written - * - * \note Using IAR Embedded workbench, the choice of memory model has an impact - * on calling convention. The memory model is not visible to the - * preprocessor, so it must be defined in the Assembler preprocessor directives. - */ -static inline void ccp_write_io(void *addr, uint8_t value) -{ - protected_write_io(addr, CCP_IOREG_gc, value); -} - -/** @} */ - -/** - * \brief Write to CCP-protected 8-bit SPM register - * - * \param addr Address of the SPM register - * \param value Value to be written - * - * \note Using IAR Embedded workbench, the choice of memory model has an impact - * on calling convention. The memory model is not visible to the - * preprocessor, so it must be defined in the Assembler preprocessor directives. - */ -static inline void ccp_write_spm(void *addr, uint8_t value) -{ - protected_write_io(addr, CCP_SPM_gc, value); -} - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* CPU_CCP_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/cpuint.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/cpuint.h deleted file mode 100644 index 67c012c..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/cpuint.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef CPUINT_H_INCLUDED -#define CPUINT_H_INCLUDED - -#include "../utils/compiler.h" -#include "ccp.h" -#include "../utils/atomic.h" - -#ifdef __cplusplus -extern "C" { -#endif /** \ - * \brief Initialize cpuint interface \ - * \ - * \return Initialization status \ - */ -int8_t CPUINT_Initialize(); - -#ifdef __cplusplus -} -#endif - -#endif /* CPUINT_H_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/evsys.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/evsys.h deleted file mode 100644 index e34bb0c..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/evsys.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef EVSYS_H_INCLUDED -#define EVSYS_H_INCLUDED - -#include "../utils/compiler.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - @Summary - Initializes the EVSYS_Initialize. - - @Description - This routine initializes the EVSYS_Initialize. - This routine should only be called once during system initialization. - - @Preconditions - None - - @Param - None - - @Example - - EVSYS_Initialize(); - -*/ -int8_t EVSYS_Initialize(void); - -#ifdef __cplusplus -} -#endif - -#endif /* CCL_H_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/pin_manager.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/pin_manager.h deleted file mode 100644 index b3ac87e..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/pin_manager.h +++ /dev/null @@ -1,240 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - -#ifndef PINS_H_INCLUDED -#define PINS_H_INCLUDED - -#include -#include "port.h" - -//get/set PB3 aliases -#define PB3_SetHigh() do { PORTB_OUTSET = 0x8; } while(0) -#define PB3_SetLow() do { PORTB_OUTCLR = 0x8; } while(0) -#define PB3_Toggle() do { PORTB_OUTTGL = 0x8; } while(0) -#define PB3_GetValue() (VPORTB.IN & (0x1 << 3)) -#define PB3_SetDigitalInput() do { PORTB_DIRCLR = 0x8; } while(0) -#define PB3_SetDigitalOutput() do { PORTB_DIRSET = 0x8; } while(0) -#define PB3_SetPullUp() do { PORTB_PIN3CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PB3_ResetPullUp() do { PORTB_PIN3CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PB3_SetInverted() do { PORTB_PIN3CTRL |= PORT_INVEN_bm; } while(0) -#define PB3_ResetInverted() do { PORTB_PIN3CTRL &= ~PORT_INVEN_bm; } while(0) -#define PB3_DisableInterruptOnChange() do { PORTB.PIN3CTRL = (PORTB.PIN3CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PB3_EnableInterruptForBothEdges() do { PORTB.PIN3CTRL = (PORTB.PIN3CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PB3_EnableInterruptForRisingEdge() do { PORTB.PIN3CTRL = (PORTB.PIN3CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PB3_EnableInterruptForFallingEdge() do { PORTB.PIN3CTRL = (PORTB.PIN3CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PB3_DisableDigitalInputBuffer() do { PORTB.PIN3CTRL = (PORTB.PIN3CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PB3_EnableInterruptForLowLevelSensing() do { PORTB.PIN3CTRL = (PORTB.PIN3CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -//get/set PA2 aliases -#define PA2_SetHigh() do { PORTA_OUTSET = 0x4; } while(0) -#define PA2_SetLow() do { PORTA_OUTCLR = 0x4; } while(0) -#define PA2_Toggle() do { PORTA_OUTTGL = 0x4; } while(0) -#define PA2_GetValue() (VPORTA.IN & (0x1 << 2)) -#define PA2_SetDigitalInput() do { PORTA_DIRCLR = 0x4; } while(0) -#define PA2_SetDigitalOutput() do { PORTA_DIRSET = 0x4; } while(0) -#define PA2_SetPullUp() do { PORTA_PIN2CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PA2_ResetPullUp() do { PORTA_PIN2CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PA2_SetInverted() do { PORTA_PIN2CTRL |= PORT_INVEN_bm; } while(0) -#define PA2_ResetInverted() do { PORTA_PIN2CTRL &= ~PORT_INVEN_bm; } while(0) -#define PA2_DisableInterruptOnChange() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PA2_EnableInterruptForBothEdges() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PA2_EnableInterruptForRisingEdge() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PA2_EnableInterruptForFallingEdge() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PA2_DisableDigitalInputBuffer() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PA2_EnableInterruptForLowLevelSensing() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -//get/set PC3 aliases -#define PC3_SetHigh() do { PORTC_OUTSET = 0x8; } while(0) -#define PC3_SetLow() do { PORTC_OUTCLR = 0x8; } while(0) -#define PC3_Toggle() do { PORTC_OUTTGL = 0x8; } while(0) -#define PC3_GetValue() (VPORTC.IN & (0x1 << 3)) -#define PC3_SetDigitalInput() do { PORTC_DIRCLR = 0x8; } while(0) -#define PC3_SetDigitalOutput() do { PORTC_DIRSET = 0x8; } while(0) -#define PC3_SetPullUp() do { PORTC_PIN3CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PC3_ResetPullUp() do { PORTC_PIN3CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PC3_SetInverted() do { PORTC_PIN3CTRL |= PORT_INVEN_bm; } while(0) -#define PC3_ResetInverted() do { PORTC_PIN3CTRL &= ~PORT_INVEN_bm; } while(0) -#define PC3_DisableInterruptOnChange() do { PORTC.PIN3CTRL = (PORTC.PIN3CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PC3_EnableInterruptForBothEdges() do { PORTC.PIN3CTRL = (PORTC.PIN3CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PC3_EnableInterruptForRisingEdge() do { PORTC.PIN3CTRL = (PORTC.PIN3CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PC3_EnableInterruptForFallingEdge() do { PORTC.PIN3CTRL = (PORTC.PIN3CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PC3_DisableDigitalInputBuffer() do { PORTC.PIN3CTRL = (PORTC.PIN3CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PC3_EnableInterruptForLowLevelSensing() do { PORTC.PIN3CTRL = (PORTC.PIN3CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -//get/set PA1 aliases -#define PA1_SetHigh() do { PORTA_OUTSET = 0x2; } while(0) -#define PA1_SetLow() do { PORTA_OUTCLR = 0x2; } while(0) -#define PA1_Toggle() do { PORTA_OUTTGL = 0x2; } while(0) -#define PA1_GetValue() (VPORTA.IN & (0x1 << 1)) -#define PA1_SetDigitalInput() do { PORTA_DIRCLR = 0x2; } while(0) -#define PA1_SetDigitalOutput() do { PORTA_DIRSET = 0x2; } while(0) -#define PA1_SetPullUp() do { PORTA_PIN1CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PA1_ResetPullUp() do { PORTA_PIN1CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PA1_SetInverted() do { PORTA_PIN1CTRL |= PORT_INVEN_bm; } while(0) -#define PA1_ResetInverted() do { PORTA_PIN1CTRL &= ~PORT_INVEN_bm; } while(0) -#define PA1_DisableInterruptOnChange() do { PORTA.PIN1CTRL = (PORTA.PIN1CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PA1_EnableInterruptForBothEdges() do { PORTA.PIN1CTRL = (PORTA.PIN1CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PA1_EnableInterruptForRisingEdge() do { PORTA.PIN1CTRL = (PORTA.PIN1CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PA1_EnableInterruptForFallingEdge() do { PORTA.PIN1CTRL = (PORTA.PIN1CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PA1_DisableDigitalInputBuffer() do { PORTA.PIN1CTRL = (PORTA.PIN1CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PA1_EnableInterruptForLowLevelSensing() do { PORTA.PIN1CTRL = (PORTA.PIN1CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -//get/set PA4 aliases -#define PA4_SetHigh() do { PORTA_OUTSET = 0x10; } while(0) -#define PA4_SetLow() do { PORTA_OUTCLR = 0x10; } while(0) -#define PA4_Toggle() do { PORTA_OUTTGL = 0x10; } while(0) -#define PA4_GetValue() (VPORTA.IN & (0x1 << 4)) -#define PA4_SetDigitalInput() do { PORTA_DIRCLR = 0x10; } while(0) -#define PA4_SetDigitalOutput() do { PORTA_DIRSET = 0x10; } while(0) -#define PA4_SetPullUp() do { PORTA_PIN4CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PA4_ResetPullUp() do { PORTA_PIN4CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PA4_SetInverted() do { PORTA_PIN4CTRL |= PORT_INVEN_bm; } while(0) -#define PA4_ResetInverted() do { PORTA_PIN4CTRL &= ~PORT_INVEN_bm; } while(0) -#define PA4_DisableInterruptOnChange() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PA4_EnableInterruptForBothEdges() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PA4_EnableInterruptForRisingEdge() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PA4_EnableInterruptForFallingEdge() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PA4_DisableDigitalInputBuffer() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PA4_EnableInterruptForLowLevelSensing() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -//get/set PA3 aliases -#define PA3_SetHigh() do { PORTA_OUTSET = 0x8; } while(0) -#define PA3_SetLow() do { PORTA_OUTCLR = 0x8; } while(0) -#define PA3_Toggle() do { PORTA_OUTTGL = 0x8; } while(0) -#define PA3_GetValue() (VPORTA.IN & (0x1 << 3)) -#define PA3_SetDigitalInput() do { PORTA_DIRCLR = 0x8; } while(0) -#define PA3_SetDigitalOutput() do { PORTA_DIRSET = 0x8; } while(0) -#define PA3_SetPullUp() do { PORTA_PIN3CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PA3_ResetPullUp() do { PORTA_PIN3CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PA3_SetInverted() do { PORTA_PIN3CTRL |= PORT_INVEN_bm; } while(0) -#define PA3_ResetInverted() do { PORTA_PIN3CTRL &= ~PORT_INVEN_bm; } while(0) -#define PA3_DisableInterruptOnChange() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PA3_EnableInterruptForBothEdges() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PA3_EnableInterruptForRisingEdge() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PA3_EnableInterruptForFallingEdge() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PA3_DisableDigitalInputBuffer() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PA3_EnableInterruptForLowLevelSensing() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -//get/set PA6 aliases -#define PA6_SetHigh() do { PORTA_OUTSET = 0x40; } while(0) -#define PA6_SetLow() do { PORTA_OUTCLR = 0x40; } while(0) -#define PA6_Toggle() do { PORTA_OUTTGL = 0x40; } while(0) -#define PA6_GetValue() (VPORTA.IN & (0x1 << 6)) -#define PA6_SetDigitalInput() do { PORTA_DIRCLR = 0x40; } while(0) -#define PA6_SetDigitalOutput() do { PORTA_DIRSET = 0x40; } while(0) -#define PA6_SetPullUp() do { PORTA_PIN6CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PA6_ResetPullUp() do { PORTA_PIN6CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PA6_SetInverted() do { PORTA_PIN6CTRL |= PORT_INVEN_bm; } while(0) -#define PA6_ResetInverted() do { PORTA_PIN6CTRL &= ~PORT_INVEN_bm; } while(0) -#define PA6_DisableInterruptOnChange() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PA6_EnableInterruptForBothEdges() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PA6_EnableInterruptForRisingEdge() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PA6_EnableInterruptForFallingEdge() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PA6_DisableDigitalInputBuffer() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PA6_EnableInterruptForLowLevelSensing() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -//get/set PA5 aliases -#define PA5_SetHigh() do { PORTA_OUTSET = 0x20; } while(0) -#define PA5_SetLow() do { PORTA_OUTCLR = 0x20; } while(0) -#define PA5_Toggle() do { PORTA_OUTTGL = 0x20; } while(0) -#define PA5_GetValue() (VPORTA.IN & (0x1 << 5)) -#define PA5_SetDigitalInput() do { PORTA_DIRCLR = 0x20; } while(0) -#define PA5_SetDigitalOutput() do { PORTA_DIRSET = 0x20; } while(0) -#define PA5_SetPullUp() do { PORTA_PIN5CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PA5_ResetPullUp() do { PORTA_PIN5CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PA5_SetInverted() do { PORTA_PIN5CTRL |= PORT_INVEN_bm; } while(0) -#define PA5_ResetInverted() do { PORTA_PIN5CTRL &= ~PORT_INVEN_bm; } while(0) -#define PA5_DisableInterruptOnChange() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PA5_EnableInterruptForBothEdges() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PA5_EnableInterruptForRisingEdge() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PA5_EnableInterruptForFallingEdge() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PA5_DisableDigitalInputBuffer() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PA5_EnableInterruptForLowLevelSensing() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -//get/set PD3 aliases -#define PD3_SetHigh() do { PORTD_OUTSET = 0x8; } while(0) -#define PD3_SetLow() do { PORTD_OUTCLR = 0x8; } while(0) -#define PD3_Toggle() do { PORTD_OUTTGL = 0x8; } while(0) -#define PD3_GetValue() (VPORTD.IN & (0x1 << 3)) -#define PD3_SetDigitalInput() do { PORTD_DIRCLR = 0x8; } while(0) -#define PD3_SetDigitalOutput() do { PORTD_DIRSET = 0x8; } while(0) -#define PD3_SetPullUp() do { PORTD_PIN3CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PD3_ResetPullUp() do { PORTD_PIN3CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PD3_SetInverted() do { PORTD_PIN3CTRL |= PORT_INVEN_bm; } while(0) -#define PD3_ResetInverted() do { PORTD_PIN3CTRL &= ~PORT_INVEN_bm; } while(0) -#define PD3_DisableInterruptOnChange() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PD3_EnableInterruptForBothEdges() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PD3_EnableInterruptForRisingEdge() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PD3_EnableInterruptForFallingEdge() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PD3_DisableDigitalInputBuffer() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PD3_EnableInterruptForLowLevelSensing() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -//get/set PA0 aliases -#define PA0_SetHigh() do { PORTA_OUTSET = 0x1; } while(0) -#define PA0_SetLow() do { PORTA_OUTCLR = 0x1; } while(0) -#define PA0_Toggle() do { PORTA_OUTTGL = 0x1; } while(0) -#define PA0_GetValue() (VPORTA.IN & (0x1 << 0)) -#define PA0_SetDigitalInput() do { PORTA_DIRCLR = 0x1; } while(0) -#define PA0_SetDigitalOutput() do { PORTA_DIRSET = 0x1; } while(0) -#define PA0_SetPullUp() do { PORTA_PIN0CTRL |= PORT_PULLUPEN_bm; } while(0) -#define PA0_ResetPullUp() do { PORTA_PIN0CTRL &= ~PORT_PULLUPEN_bm; } while(0) -#define PA0_SetInverted() do { PORTA_PIN0CTRL |= PORT_INVEN_bm; } while(0) -#define PA0_ResetInverted() do { PORTA_PIN0CTRL &= ~PORT_INVEN_bm; } while(0) -#define PA0_DisableInterruptOnChange() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) -#define PA0_EnableInterruptForBothEdges() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) -#define PA0_EnableInterruptForRisingEdge() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) -#define PA0_EnableInterruptForFallingEdge() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) -#define PA0_DisableDigitalInputBuffer() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) -#define PA0_EnableInterruptForLowLevelSensing() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) - -void PIN_MANAGER_Initialize(); -void PORTB_PB3_DefaultInterruptHandler(void); -void PORTB_PB3_SetInterruptHandler(void (* interruptHandler)(void)) ; -void PORTA_PA2_DefaultInterruptHandler(void); -void PORTA_PA2_SetInterruptHandler(void (* interruptHandler)(void)) ; -void PORTC_PC3_DefaultInterruptHandler(void); -void PORTC_PC3_SetInterruptHandler(void (* interruptHandler)(void)) ; -void PORTA_PA1_DefaultInterruptHandler(void); -void PORTA_PA1_SetInterruptHandler(void (* interruptHandler)(void)) ; -void PORTA_PA4_DefaultInterruptHandler(void); -void PORTA_PA4_SetInterruptHandler(void (* interruptHandler)(void)) ; -void PORTA_PA3_DefaultInterruptHandler(void); -void PORTA_PA3_SetInterruptHandler(void (* interruptHandler)(void)) ; -void PORTA_PA6_DefaultInterruptHandler(void); -void PORTA_PA6_SetInterruptHandler(void (* interruptHandler)(void)) ; -void PORTA_PA5_DefaultInterruptHandler(void); -void PORTA_PA5_SetInterruptHandler(void (* interruptHandler)(void)) ; -void PORTD_PD3_DefaultInterruptHandler(void); -void PORTD_PD3_SetInterruptHandler(void (* interruptHandler)(void)) ; -void PORTA_PA0_DefaultInterruptHandler(void); -void PORTA_PA0_SetInterruptHandler(void (* interruptHandler)(void)) ; -#endif /* PINS_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/port.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/port.h deleted file mode 100644 index 6a314fd..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/port.h +++ /dev/null @@ -1,1383 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef PORT_INCLUDED -#define PORT_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -#include "../utils/compiler.h" - -enum port_pull_mode { - PORT_PULL_OFF, - PORT_PULL_UP, -}; - -enum port_dir { - PORT_DIR_IN, - PORT_DIR_OUT, - PORT_DIR_OFF, -}; -/** - * \brief Set port pin pull mode - * - * Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used - * - * \param[in] pin The pin number within port - * \param[in] pull_mode Pin pull mode - */ -static inline void PORTE_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTE + 0x10 + pin); - - if (pull_mode == PORT_PULL_UP) { - *port_pin_ctrl |= PORT_PULLUPEN_bm; - } else if (pull_mode == PORT_PULL_OFF) { - *port_pin_ctrl &= ~PORT_PULLUPEN_bm; - } -} - -/** - * \brief Set port pin inverted mode - * - * Configure pin invert I/O or not - * - * \param[in] pin The pin number within port - * \param[in] inverted Pin inverted mode - */ -static inline void PORTE_pin_set_inverted(const uint8_t pin, const bool inverted) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTE + 0x10 + pin); - - if (inverted) { - *port_pin_ctrl |= PORT_INVEN_bm; - } else { - *port_pin_ctrl &= ~PORT_INVEN_bm; - } -} - -/** - * \brief Set port pin input/sense configuration - * - * Enable/disable digital input buffer and pin change interrupt, - * select pin interrupt edge/level sensing mode - * - * \param[in] pin pin number within port - * \param[in] isc PORT_ISC_INTDISABLE_gc = Interrupt disabled but input buffer enabled - * PORT_ISC_BOTHEDGES_gc = Sense Both Edges - * PORT_ISC_RISING_gc = Sense Rising Edge - * PORT_ISC_FALLING_gc = Sense Falling Edge - * PORT_ISC_INPUT_DISABLE_gc = Digital Input Buffer disabled - * PORT_ISC_LEVEL_gc = Sense low Level - * - */ -static inline void PORTE_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTE + 0x10 + pin); - - *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; -} - -/** - * \brief Set port data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] mask Bit mask where 1 means apply direction setting to the - * corresponding pin - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTE_set_port_dir(const uint8_t mask, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTE.DIR &= ~mask; - break; - case PORT_DIR_OUT: - VPORTE.DIR |= mask; - break; - case PORT_DIR_OFF: - /*/ should activate the pullup for power saving - but a bit costly to do it here */ - { - for (uint8_t i = 0; i < 8; i++) { - if (mask & 1 << i) { - *((uint8_t *)&PORTE + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - } - } - break; - default: - break; - } -} - -/** - * \brief Set port pin data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] pin The pin number within port - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTE_set_pin_dir(const uint8_t pin, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTE.DIR &= ~(1 << pin); - break; - case PORT_DIR_OUT: - VPORTE.DIR |= (1 << pin); - break; - case PORT_DIR_OFF: - *((uint8_t *)&PORTE + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; - break; - default: - break; - } -} - -/** - * \brief Set port level - * - * Sets output level on the pins defined by the bit mask - * - * \param[in] mask Bit mask where 1 means apply port level to the corresponding - * pin - * \param[in] level true = Pin levels set to "high" state - * false = Pin levels set to "low" state - */ -static inline void PORTE_set_port_level(const uint8_t mask, const bool level) -{ - if (level == true) { - VPORTE.OUT |= mask; - } else { - VPORTE.OUT &= ~mask; - } -} - -/** - * \brief Set port level - * - * Sets output level on a pin - * - * \param[in] pin The pin number within port - * \param[in] level true = Pin level set to "high" state - * false = Pin level set to "low" state - */ -static inline void PORTE_set_pin_level(const uint8_t pin, const bool level) -{ - if (level == true) { - VPORTE.OUT |= (1 << pin); - } else { - VPORTE.OUT &= ~(1 << pin); - } -} - -/** - * \brief Toggle out level on pins - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] mask Bit mask where 1 means toggle pin level to the corresponding - * pin - */ -static inline void PORTE_toggle_port_level(const uint8_t mask) -{ - PORTE.OUTTGL = mask; -} - -/** - * \brief Toggle output level on pin - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] pin The pin number within port - */ -static inline void PORTE_toggle_pin_level(const uint8_t pin) -{ - PORTE.OUTTGL = 1 << pin; -} - -/** - * \brief Get input level on pins - * - * Read the input level on pins connected to a port - * - */ -static inline uint8_t PORTE_get_port_level() -{ - return VPORTE.IN; -} - -/** - * \brief Get level on pin - * - * Reads the level on pins connected to a port - */ -static inline bool PORTE_get_pin_level(const uint8_t pin) -{ - return VPORTE.IN & (1 << pin); -} - -/** - * \brief Write value to Port - * - * Write directly to the port OUT register - * - * \param[in] value Value to write to the port register - */ -static inline void PORTE_write_port(const uint8_t value) -{ - VPORTE.OUT = value; -} -/** - * \brief Set port pin pull mode - * - * Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used - * - * \param[in] pin The pin number within port - * \param[in] pull_mode Pin pull mode - */ -static inline void PORTF_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTF + 0x10 + pin); - - if (pull_mode == PORT_PULL_UP) { - *port_pin_ctrl |= PORT_PULLUPEN_bm; - } else if (pull_mode == PORT_PULL_OFF) { - *port_pin_ctrl &= ~PORT_PULLUPEN_bm; - } -} - -/** - * \brief Set port pin inverted mode - * - * Configure pin invert I/O or not - * - * \param[in] pin The pin number within port - * \param[in] inverted Pin inverted mode - */ -static inline void PORTF_pin_set_inverted(const uint8_t pin, const bool inverted) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTF + 0x10 + pin); - - if (inverted) { - *port_pin_ctrl |= PORT_INVEN_bm; - } else { - *port_pin_ctrl &= ~PORT_INVEN_bm; - } -} - -/** - * \brief Set port pin input/sense configuration - * - * Enable/disable digital input buffer and pin change interrupt, - * select pin interrupt edge/level sensing mode - * - * \param[in] pin pin number within port - * \param[in] isc PORT_ISC_INTDISABLE_gc = Interrupt disabled but input buffer enabled - * PORT_ISC_BOTHEDGES_gc = Sense Both Edges - * PORT_ISC_RISING_gc = Sense Rising Edge - * PORT_ISC_FALLING_gc = Sense Falling Edge - * PORT_ISC_INPUT_DISABLE_gc = Digital Input Buffer disabled - * PORT_ISC_LEVEL_gc = Sense low Level - * - */ -static inline void PORTF_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTF + 0x10 + pin); - - *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; -} - -/** - * \brief Set port data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] mask Bit mask where 1 means apply direction setting to the - * corresponding pin - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTF_set_port_dir(const uint8_t mask, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTF.DIR &= ~mask; - break; - case PORT_DIR_OUT: - VPORTF.DIR |= mask; - break; - case PORT_DIR_OFF: - /*/ should activate the pullup for power saving - but a bit costly to do it here */ - { - for (uint8_t i = 0; i < 8; i++) { - if (mask & 1 << i) { - *((uint8_t *)&PORTF + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - } - } - break; - default: - break; - } -} - -/** - * \brief Set port pin data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] pin The pin number within port - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTF_set_pin_dir(const uint8_t pin, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTF.DIR &= ~(1 << pin); - break; - case PORT_DIR_OUT: - VPORTF.DIR |= (1 << pin); - break; - case PORT_DIR_OFF: - *((uint8_t *)&PORTF + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; - break; - default: - break; - } -} - -/** - * \brief Set port level - * - * Sets output level on the pins defined by the bit mask - * - * \param[in] mask Bit mask where 1 means apply port level to the corresponding - * pin - * \param[in] level true = Pin levels set to "high" state - * false = Pin levels set to "low" state - */ -static inline void PORTF_set_port_level(const uint8_t mask, const bool level) -{ - if (level == true) { - VPORTF.OUT |= mask; - } else { - VPORTF.OUT &= ~mask; - } -} - -/** - * \brief Set port level - * - * Sets output level on a pin - * - * \param[in] pin The pin number within port - * \param[in] level true = Pin level set to "high" state - * false = Pin level set to "low" state - */ -static inline void PORTF_set_pin_level(const uint8_t pin, const bool level) -{ - if (level == true) { - VPORTF.OUT |= (1 << pin); - } else { - VPORTF.OUT &= ~(1 << pin); - } -} - -/** - * \brief Toggle out level on pins - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] mask Bit mask where 1 means toggle pin level to the corresponding - * pin - */ -static inline void PORTF_toggle_port_level(const uint8_t mask) -{ - PORTF.OUTTGL = mask; -} - -/** - * \brief Toggle output level on pin - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] pin The pin number within port - */ -static inline void PORTF_toggle_pin_level(const uint8_t pin) -{ - PORTF.OUTTGL = 1 << pin; -} - -/** - * \brief Get input level on pins - * - * Read the input level on pins connected to a port - * - */ -static inline uint8_t PORTF_get_port_level() -{ - return VPORTF.IN; -} - -/** - * \brief Get level on pin - * - * Reads the level on pins connected to a port - */ -static inline bool PORTF_get_pin_level(const uint8_t pin) -{ - return VPORTF.IN & (1 << pin); -} - -/** - * \brief Write value to Port - * - * Write directly to the port OUT register - * - * \param[in] value Value to write to the port register - */ -static inline void PORTF_write_port(const uint8_t value) -{ - VPORTF.OUT = value; -} -/** - * \brief Set port pin pull mode - * - * Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used - * - * \param[in] pin The pin number within port - * \param[in] pull_mode Pin pull mode - */ -static inline void PORTA_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTA + 0x10 + pin); - - if (pull_mode == PORT_PULL_UP) { - *port_pin_ctrl |= PORT_PULLUPEN_bm; - } else if (pull_mode == PORT_PULL_OFF) { - *port_pin_ctrl &= ~PORT_PULLUPEN_bm; - } -} - -/** - * \brief Set port pin inverted mode - * - * Configure pin invert I/O or not - * - * \param[in] pin The pin number within port - * \param[in] inverted Pin inverted mode - */ -static inline void PORTA_pin_set_inverted(const uint8_t pin, const bool inverted) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTA + 0x10 + pin); - - if (inverted) { - *port_pin_ctrl |= PORT_INVEN_bm; - } else { - *port_pin_ctrl &= ~PORT_INVEN_bm; - } -} - -/** - * \brief Set port pin input/sense configuration - * - * Enable/disable digital input buffer and pin change interrupt, - * select pin interrupt edge/level sensing mode - * - * \param[in] pin pin number within port - * \param[in] isc PORT_ISC_INTDISABLE_gc = Interrupt disabled but input buffer enabled - * PORT_ISC_BOTHEDGES_gc = Sense Both Edges - * PORT_ISC_RISING_gc = Sense Rising Edge - * PORT_ISC_FALLING_gc = Sense Falling Edge - * PORT_ISC_INPUT_DISABLE_gc = Digital Input Buffer disabled - * PORT_ISC_LEVEL_gc = Sense low Level - * - */ -static inline void PORTA_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTA + 0x10 + pin); - - *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; -} - -/** - * \brief Set port data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] mask Bit mask where 1 means apply direction setting to the - * corresponding pin - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTA_set_port_dir(const uint8_t mask, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTA.DIR &= ~mask; - break; - case PORT_DIR_OUT: - VPORTA.DIR |= mask; - break; - case PORT_DIR_OFF: - /*/ should activate the pullup for power saving - but a bit costly to do it here */ - { - for (uint8_t i = 0; i < 8; i++) { - if (mask & 1 << i) { - *((uint8_t *)&PORTA + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - } - } - break; - default: - break; - } -} - -/** - * \brief Set port pin data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] pin The pin number within port - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTA_set_pin_dir(const uint8_t pin, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTA.DIR &= ~(1 << pin); - break; - case PORT_DIR_OUT: - VPORTA.DIR |= (1 << pin); - break; - case PORT_DIR_OFF: - *((uint8_t *)&PORTA + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; - break; - default: - break; - } -} - -/** - * \brief Set port level - * - * Sets output level on the pins defined by the bit mask - * - * \param[in] mask Bit mask where 1 means apply port level to the corresponding - * pin - * \param[in] level true = Pin levels set to "high" state - * false = Pin levels set to "low" state - */ -static inline void PORTA_set_port_level(const uint8_t mask, const bool level) -{ - if (level == true) { - VPORTA.OUT |= mask; - } else { - VPORTA.OUT &= ~mask; - } -} - -/** - * \brief Set port level - * - * Sets output level on a pin - * - * \param[in] pin The pin number within port - * \param[in] level true = Pin level set to "high" state - * false = Pin level set to "low" state - */ -static inline void PORTA_set_pin_level(const uint8_t pin, const bool level) -{ - if (level == true) { - VPORTA.OUT |= (1 << pin); - } else { - VPORTA.OUT &= ~(1 << pin); - } -} - -/** - * \brief Toggle out level on pins - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] mask Bit mask where 1 means toggle pin level to the corresponding - * pin - */ -static inline void PORTA_toggle_port_level(const uint8_t mask) -{ - PORTA.OUTTGL = mask; -} - -/** - * \brief Toggle output level on pin - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] pin The pin number within port - */ -static inline void PORTA_toggle_pin_level(const uint8_t pin) -{ - PORTA.OUTTGL = 1 << pin; -} - -/** - * \brief Get input level on pins - * - * Read the input level on pins connected to a port - * - */ -static inline uint8_t PORTA_get_port_level() -{ - return VPORTA.IN; -} - -/** - * \brief Get level on pin - * - * Reads the level on pins connected to a port - */ -static inline bool PORTA_get_pin_level(const uint8_t pin) -{ - return VPORTA.IN & (1 << pin); -} - -/** - * \brief Write value to Port - * - * Write directly to the port OUT register - * - * \param[in] value Value to write to the port register - */ -static inline void PORTA_write_port(const uint8_t value) -{ - VPORTA.OUT = value; -} -/** - * \brief Set port pin pull mode - * - * Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used - * - * \param[in] pin The pin number within port - * \param[in] pull_mode Pin pull mode - */ -static inline void PORTB_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTB + 0x10 + pin); - - if (pull_mode == PORT_PULL_UP) { - *port_pin_ctrl |= PORT_PULLUPEN_bm; - } else if (pull_mode == PORT_PULL_OFF) { - *port_pin_ctrl &= ~PORT_PULLUPEN_bm; - } -} - -/** - * \brief Set port pin inverted mode - * - * Configure pin invert I/O or not - * - * \param[in] pin The pin number within port - * \param[in] inverted Pin inverted mode - */ -static inline void PORTB_pin_set_inverted(const uint8_t pin, const bool inverted) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTB + 0x10 + pin); - - if (inverted) { - *port_pin_ctrl |= PORT_INVEN_bm; - } else { - *port_pin_ctrl &= ~PORT_INVEN_bm; - } -} - -/** - * \brief Set port pin input/sense configuration - * - * Enable/disable digital input buffer and pin change interrupt, - * select pin interrupt edge/level sensing mode - * - * \param[in] pin pin number within port - * \param[in] isc PORT_ISC_INTDISABLE_gc = Interrupt disabled but input buffer enabled - * PORT_ISC_BOTHEDGES_gc = Sense Both Edges - * PORT_ISC_RISING_gc = Sense Rising Edge - * PORT_ISC_FALLING_gc = Sense Falling Edge - * PORT_ISC_INPUT_DISABLE_gc = Digital Input Buffer disabled - * PORT_ISC_LEVEL_gc = Sense low Level - * - */ -static inline void PORTB_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTB + 0x10 + pin); - - *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; -} - -/** - * \brief Set port data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] mask Bit mask where 1 means apply direction setting to the - * corresponding pin - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTB_set_port_dir(const uint8_t mask, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTB.DIR &= ~mask; - break; - case PORT_DIR_OUT: - VPORTB.DIR |= mask; - break; - case PORT_DIR_OFF: - /*/ should activate the pullup for power saving - but a bit costly to do it here */ - { - for (uint8_t i = 0; i < 8; i++) { - if (mask & 1 << i) { - *((uint8_t *)&PORTB + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - } - } - break; - default: - break; - } -} - -/** - * \brief Set port pin data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] pin The pin number within port - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTB_set_pin_dir(const uint8_t pin, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTB.DIR &= ~(1 << pin); - break; - case PORT_DIR_OUT: - VPORTB.DIR |= (1 << pin); - break; - case PORT_DIR_OFF: - *((uint8_t *)&PORTB + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; - break; - default: - break; - } -} - -/** - * \brief Set port level - * - * Sets output level on the pins defined by the bit mask - * - * \param[in] mask Bit mask where 1 means apply port level to the corresponding - * pin - * \param[in] level true = Pin levels set to "high" state - * false = Pin levels set to "low" state - */ -static inline void PORTB_set_port_level(const uint8_t mask, const bool level) -{ - if (level == true) { - VPORTB.OUT |= mask; - } else { - VPORTB.OUT &= ~mask; - } -} - -/** - * \brief Set port level - * - * Sets output level on a pin - * - * \param[in] pin The pin number within port - * \param[in] level true = Pin level set to "high" state - * false = Pin level set to "low" state - */ -static inline void PORTB_set_pin_level(const uint8_t pin, const bool level) -{ - if (level == true) { - VPORTB.OUT |= (1 << pin); - } else { - VPORTB.OUT &= ~(1 << pin); - } -} - -/** - * \brief Toggle out level on pins - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] mask Bit mask where 1 means toggle pin level to the corresponding - * pin - */ -static inline void PORTB_toggle_port_level(const uint8_t mask) -{ - PORTB.OUTTGL = mask; -} - -/** - * \brief Toggle output level on pin - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] pin The pin number within port - */ -static inline void PORTB_toggle_pin_level(const uint8_t pin) -{ - PORTB.OUTTGL = 1 << pin; -} - -/** - * \brief Get input level on pins - * - * Read the input level on pins connected to a port - * - */ -static inline uint8_t PORTB_get_port_level() -{ - return VPORTB.IN; -} - -/** - * \brief Get level on pin - * - * Reads the level on pins connected to a port - */ -static inline bool PORTB_get_pin_level(const uint8_t pin) -{ - return VPORTB.IN & (1 << pin); -} - -/** - * \brief Write value to Port - * - * Write directly to the port OUT register - * - * \param[in] value Value to write to the port register - */ -static inline void PORTB_write_port(const uint8_t value) -{ - VPORTB.OUT = value; -} -/** - * \brief Set port pin pull mode - * - * Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used - * - * \param[in] pin The pin number within port - * \param[in] pull_mode Pin pull mode - */ -static inline void PORTC_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTC + 0x10 + pin); - - if (pull_mode == PORT_PULL_UP) { - *port_pin_ctrl |= PORT_PULLUPEN_bm; - } else if (pull_mode == PORT_PULL_OFF) { - *port_pin_ctrl &= ~PORT_PULLUPEN_bm; - } -} - -/** - * \brief Set port pin inverted mode - * - * Configure pin invert I/O or not - * - * \param[in] pin The pin number within port - * \param[in] inverted Pin inverted mode - */ -static inline void PORTC_pin_set_inverted(const uint8_t pin, const bool inverted) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTC + 0x10 + pin); - - if (inverted) { - *port_pin_ctrl |= PORT_INVEN_bm; - } else { - *port_pin_ctrl &= ~PORT_INVEN_bm; - } -} - -/** - * \brief Set port pin input/sense configuration - * - * Enable/disable digital input buffer and pin change interrupt, - * select pin interrupt edge/level sensing mode - * - * \param[in] pin pin number within port - * \param[in] isc PORT_ISC_INTDISABLE_gc = Interrupt disabled but input buffer enabled - * PORT_ISC_BOTHEDGES_gc = Sense Both Edges - * PORT_ISC_RISING_gc = Sense Rising Edge - * PORT_ISC_FALLING_gc = Sense Falling Edge - * PORT_ISC_INPUT_DISABLE_gc = Digital Input Buffer disabled - * PORT_ISC_LEVEL_gc = Sense low Level - * - */ -static inline void PORTC_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTC + 0x10 + pin); - - *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; -} - -/** - * \brief Set port data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] mask Bit mask where 1 means apply direction setting to the - * corresponding pin - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTC_set_port_dir(const uint8_t mask, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTC.DIR &= ~mask; - break; - case PORT_DIR_OUT: - VPORTC.DIR |= mask; - break; - case PORT_DIR_OFF: - /*/ should activate the pullup for power saving - but a bit costly to do it here */ - { - for (uint8_t i = 0; i < 8; i++) { - if (mask & 1 << i) { - *((uint8_t *)&PORTC + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - } - } - break; - default: - break; - } -} - -/** - * \brief Set port pin data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] pin The pin number within port - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTC_set_pin_dir(const uint8_t pin, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTC.DIR &= ~(1 << pin); - break; - case PORT_DIR_OUT: - VPORTC.DIR |= (1 << pin); - break; - case PORT_DIR_OFF: - *((uint8_t *)&PORTC + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; - break; - default: - break; - } -} - -/** - * \brief Set port level - * - * Sets output level on the pins defined by the bit mask - * - * \param[in] mask Bit mask where 1 means apply port level to the corresponding - * pin - * \param[in] level true = Pin levels set to "high" state - * false = Pin levels set to "low" state - */ -static inline void PORTC_set_port_level(const uint8_t mask, const bool level) -{ - if (level == true) { - VPORTC.OUT |= mask; - } else { - VPORTC.OUT &= ~mask; - } -} - -/** - * \brief Set port level - * - * Sets output level on a pin - * - * \param[in] pin The pin number within port - * \param[in] level true = Pin level set to "high" state - * false = Pin level set to "low" state - */ -static inline void PORTC_set_pin_level(const uint8_t pin, const bool level) -{ - if (level == true) { - VPORTC.OUT |= (1 << pin); - } else { - VPORTC.OUT &= ~(1 << pin); - } -} - -/** - * \brief Toggle out level on pins - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] mask Bit mask where 1 means toggle pin level to the corresponding - * pin - */ -static inline void PORTC_toggle_port_level(const uint8_t mask) -{ - PORTC.OUTTGL = mask; -} - -/** - * \brief Toggle output level on pin - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] pin The pin number within port - */ -static inline void PORTC_toggle_pin_level(const uint8_t pin) -{ - PORTC.OUTTGL = 1 << pin; -} - -/** - * \brief Get input level on pins - * - * Read the input level on pins connected to a port - * - */ -static inline uint8_t PORTC_get_port_level() -{ - return VPORTC.IN; -} - -/** - * \brief Get level on pin - * - * Reads the level on pins connected to a port - */ -static inline bool PORTC_get_pin_level(const uint8_t pin) -{ - return VPORTC.IN & (1 << pin); -} - -/** - * \brief Write value to Port - * - * Write directly to the port OUT register - * - * \param[in] value Value to write to the port register - */ -static inline void PORTC_write_port(const uint8_t value) -{ - VPORTC.OUT = value; -} -/** - * \brief Set port pin pull mode - * - * Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used - * - * \param[in] pin The pin number within port - * \param[in] pull_mode Pin pull mode - */ -static inline void PORTD_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTD + 0x10 + pin); - - if (pull_mode == PORT_PULL_UP) { - *port_pin_ctrl |= PORT_PULLUPEN_bm; - } else if (pull_mode == PORT_PULL_OFF) { - *port_pin_ctrl &= ~PORT_PULLUPEN_bm; - } -} - -/** - * \brief Set port pin inverted mode - * - * Configure pin invert I/O or not - * - * \param[in] pin The pin number within port - * \param[in] inverted Pin inverted mode - */ -static inline void PORTD_pin_set_inverted(const uint8_t pin, const bool inverted) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTD + 0x10 + pin); - - if (inverted) { - *port_pin_ctrl |= PORT_INVEN_bm; - } else { - *port_pin_ctrl &= ~PORT_INVEN_bm; - } -} - -/** - * \brief Set port pin input/sense configuration - * - * Enable/disable digital input buffer and pin change interrupt, - * select pin interrupt edge/level sensing mode - * - * \param[in] pin pin number within port - * \param[in] isc PORT_ISC_INTDISABLE_gc = Interrupt disabled but input buffer enabled - * PORT_ISC_BOTHEDGES_gc = Sense Both Edges - * PORT_ISC_RISING_gc = Sense Rising Edge - * PORT_ISC_FALLING_gc = Sense Falling Edge - * PORT_ISC_INPUT_DISABLE_gc = Digital Input Buffer disabled - * PORT_ISC_LEVEL_gc = Sense low Level - * - */ -static inline void PORTD_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) -{ - volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTD + 0x10 + pin); - - *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; -} - -/** - * \brief Set port data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] mask Bit mask where 1 means apply direction setting to the - * corresponding pin - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTD_set_port_dir(const uint8_t mask, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTD.DIR &= ~mask; - break; - case PORT_DIR_OUT: - VPORTD.DIR |= mask; - break; - case PORT_DIR_OFF: - /*/ should activate the pullup for power saving - but a bit costly to do it here */ - { - for (uint8_t i = 0; i < 8; i++) { - if (mask & 1 << i) { - *((uint8_t *)&PORTD + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - } - } - break; - default: - break; - } -} - -/** - * \brief Set port pin data direction - * - * Select if the pin data direction is input, output or disabled. - * If disabled state is not possible, this function throws an assert. - * - * \param[in] pin The pin number within port - * \param[in] dir PORT_DIR_IN = Data direction in - * PORT_DIR_OUT = Data direction out - * PORT_DIR_OFF = Disables the pin - * (low power state) - */ -static inline void PORTD_set_pin_dir(const uint8_t pin, const enum port_dir dir) -{ - switch (dir) { - case PORT_DIR_IN: - VPORTD.DIR &= ~(1 << pin); - break; - case PORT_DIR_OUT: - VPORTD.DIR |= (1 << pin); - break; - case PORT_DIR_OFF: - *((uint8_t *)&PORTD + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; - break; - default: - break; - } -} - -/** - * \brief Set port level - * - * Sets output level on the pins defined by the bit mask - * - * \param[in] mask Bit mask where 1 means apply port level to the corresponding - * pin - * \param[in] level true = Pin levels set to "high" state - * false = Pin levels set to "low" state - */ -static inline void PORTD_set_port_level(const uint8_t mask, const bool level) -{ - if (level == true) { - VPORTD.OUT |= mask; - } else { - VPORTD.OUT &= ~mask; - } -} - -/** - * \brief Set port level - * - * Sets output level on a pin - * - * \param[in] pin The pin number within port - * \param[in] level true = Pin level set to "high" state - * false = Pin level set to "low" state - */ -static inline void PORTD_set_pin_level(const uint8_t pin, const bool level) -{ - if (level == true) { - VPORTD.OUT |= (1 << pin); - } else { - VPORTD.OUT &= ~(1 << pin); - } -} - -/** - * \brief Toggle out level on pins - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] mask Bit mask where 1 means toggle pin level to the corresponding - * pin - */ -static inline void PORTD_toggle_port_level(const uint8_t mask) -{ - PORTD.OUTTGL = mask; -} - -/** - * \brief Toggle output level on pin - * - * Toggle the pin levels on pins defined by bit mask - * - * \param[in] pin The pin number within port - */ -static inline void PORTD_toggle_pin_level(const uint8_t pin) -{ - PORTD.OUTTGL = 1 << pin; -} - -/** - * \brief Get input level on pins - * - * Read the input level on pins connected to a port - * - */ -static inline uint8_t PORTD_get_port_level() -{ - return VPORTD.IN; -} - -/** - * \brief Get level on pin - * - * Reads the level on pins connected to a port - */ -static inline bool PORTD_get_pin_level(const uint8_t pin) -{ - return VPORTD.IN & (1 << pin); -} - -/** - * \brief Write value to Port - * - * Write directly to the port OUT register - * - * \param[in] value Value to write to the port register - */ -static inline void PORTD_write_port(const uint8_t value) -{ - VPORTD.OUT = value; -} -#ifdef __cplusplus -} -#endif - -#endif /* PORT_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/protected_io.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/protected_io.h deleted file mode 100644 index ec8fcc3..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/protected_io.h +++ /dev/null @@ -1,95 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -/** - * \defgroup doc_driver_system_protected_io Protected IO - * \ingroup doc_driver_system - * - * \section doc_driver_protected_io_rev Revision History - * - v0.0.0.1 Initial Commit - * - *@{ - */ - -#ifndef PROTECTED_IO_H -#define PROTECTED_IO_H - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__DOXYGEN__) -//! \name IAR Memory Model defines. -//@{ - -/** - * \def CONFIG_MEMORY_MODEL_TINY - * \brief Configuration symbol to enable 8 bit pointers. - * - */ -#define CONFIG_MEMORY_MODEL_TINY - -/** - * \def CONFIG_MEMORY_MODEL_SMALL - * \brief Configuration symbol to enable 16 bit pointers. - * \note If no memory model is defined, SMALL is default. - * - */ -#define CONFIG_MEMORY_MODEL_SMALL - -/** - * \def CONFIG_MEMORY_MODEL_LARGE - * \brief Configuration symbol to enable 24 bit pointers. - * - */ -#define CONFIG_MEMORY_MODEL_LARGE - -//@} -#endif - -/** - * \brief Write to am 8-bit I/O register protected by CCP or a protection bit - * - * \param addr Address of the I/O register - * \param magic CCP magic value or Mask for protection bit - * \param value Value to be written - * - * \note Using IAR Embedded workbench, the choice of memory model has an impact - * on calling convention. The memory model is not visible to the - * preprocessor, so it must be defined in the Assembler preprocessor directives. - */ -extern void protected_write_io(void *addr, uint8_t magic, uint8_t value); - -/** @} */ - -#endif /* PROTECTED_IO_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/rstctrl.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/rstctrl.h deleted file mode 100644 index 538084b..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/rstctrl.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef RSTCTRL_INCLUDED -#define RSTCTRL_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -#include "ccp.h" - -static inline void RSTCTRL_reset(void) -{ - /* SWRR is protected with CCP */ - ccp_write_io((void *)&RSTCTRL.SWRR, 0x0); - -} - -static inline uint8_t RSTCTRL_get_reset_cause(void) -{ - return RSTCTRL.RSTFR; -} - -static inline void RSTCTRL_clear_reset_cause(void) -{ - RSTCTRL.RSTFR - = RSTCTRL_UPDIRF_bm | RSTCTRL_SWRF_bm | RSTCTRL_WDRF_bm | RSTCTRL_EXTRF_bm | RSTCTRL_BORF_bm | RSTCTRL_PORF_bm; -} - -#ifdef __cplusplus -} -#endif - -#endif /* RSTCTRL_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/spi0.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/spi0.h deleted file mode 100644 index 02ad6d6..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/spi0.h +++ /dev/null @@ -1,237 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef SPI0_BASIC_H_INCLUDED -#define SPI0_BASIC_H_INCLUDED - -#include "../utils/compiler.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** Function pointer to callback function called by SPI IRQ. - NULL=default value: No callback function is to be used. -*/ -typedef void (*spi0_TRANSFER_DONE_CB)(void); - -typedef struct { - // hardware stuff that controls SPI mode - // hardware stuff that controls SPI baud rate - uint8_t CTRLAvalue; - uint8_t CTRLBvalue; -} spi0_configuration_t; - -/** Specify whether the SPI transfer is to be uni- or bidirectional. - A bidirectional transfer (=SPI_EXCHANGE) causes the received data - to overwrite the buffer with the data to transmit. -*/ -typedef enum spi0_transfer_type { - SPI0_EXCHANGE, ///< SPI transfer is bidirectional - SPI0_READ, ///< SPI transfer reads, writes only 0s - SPI0_WRITE ///< SPI transfer writes, discards read data -} spi0_transfer_type_t; - -/** Status of the SPI hardware and SPI bus.*/ -typedef enum spi0_transfer_status { - SPI0_FREE, ///< SPI hardware is not open, bus is free. - SPI0_IDLE, ///< SPI hardware has been opened, no transfer ongoing. - SPI0_BUSY, ///< SPI hardware has been opened, transfer ongoing. - SPI0_DONE ///< SPI hardware has been opened, transfer complete. -} spi0_transfer_status_t; - -/** Enumeration of the different configurations supported by the driver. - A configuration is specified as parameter to SPI0_open(), - and is used by the function to set SPI parameters as specified by the - configuration. A user may specify a configuration, e.g. SLAVE_A, used when - communication over SPI with SLAVE_A, and another configuration, SLAVE_B, - used when communication with SLAVE_B. The configurations may use different - SPI configuration such as polarity or SCK frequency. -*/ -typedef enum { - SPI0_DEFAULT -} SPI0_configuration_name_t; - -/** - * \brief Initialize SPI interface - * If module is configured to disabled state, the clock to the SPI is disabled - * if this is supported by the device's clock system. - * - * \return Initialization status. - * \retval 0 the SPI init was successful - * \retval 1 the SPI init was not successful - */ -uint8_t SPI0_Initialize(void); - -/** - * \brief Enable SPI0 - * 1. If supported by the clock system, enables the clock to the SPI - * 2. Enables the SPI module by setting the enable-bit in the SPI control register - * - * \return Nothing - */ -void SPI0_Enable(); - -/** - * \brief Disable SPI0 - * 1. Disables the SPI module by clearing the enable-bit in the SPI control register - * 2. If supported by the clock system, disables the clock to the SPI - * - * \return Nothing - */ -void SPI0_Disable(); - -/** - * \brief Open the SPI SPI0 for communication - * - * \param[in] spiUniqueconfiguration The configuration to use in the transfer - * - * \return Initialization status. - * \retval false The SPI open was successful - * \retval true The SPI open was successful - */ -bool SPI0_Open(spi0_configuration_t spiUniqueConfiguration); - -/** - * \brief Sets the index of Configuration to use in the transfer - * - * \param[in] spiUniqueconfiguration The configuration index - * - * \return Setting status. - */ - -bool SPI0_OpenConfiguration(uint8_t spiUniqueConfiguration); - - -/** - * \brief Close the SPI SPI0 for communication - * - * \return Nothing - */ -void SPI0_Close(void); - -/** - * \brief Exchange one byte over SPI SPI0. Blocks until done. - * - * \param[in] data The byte to transfer - * - * \return Received data byte. - */ -uint8_t SPI0_ExchangeByte(uint8_t data); - -/** - * \brief Exchange a buffer over SPI SPI0. Blocks if using polled driver. - * - * \param[inout] block The buffer to transfer. Received data is returned here. - * \param[in] size The size of buffer to transfer - * - * \return Nothing. - */ -void SPI0_ExchangeBlock(void *block, size_t size); - -/** - * \brief Write a buffer over SPI SPI0. Blocks if using polled driver. - * - * \param[in] block The buffer to transfer - * \param[in] size The size of buffer to transfer - * - * \return Nothing. - */ -void SPI0_WriteBlock(void *block, size_t size); - -/** - * \brief Read a buffer over SPI SPI0. Blocks if using polled driver. - * - * Zeros are transmitted out of the SPI. - * - * \param[out] block Received data is written here. - * \param[in] size The size of buffer to transfer - * - * \return Nothing. - */ -void SPI0_ReadBlock(void *block, size_t size); - -/** - * \brief Write a buffer over SPI SPI0. Blocks if using polled driver. - * - * \param[in] data The byte to transfer - * - * \return Nothing. - */ -void SPI0_WriteByte(uint8_t data); - -/** - * \brief Read a buffer over SPI SPI0. Blocks if using polled driver. - * - * \return The received data. - */ -uint8_t SPI0_ReadByte(); - -/** - * \brief Check if SPI slave is selected, i.e. its SS has been asserted. - * - * \return SPI SS status - * \retval true SPI is selected - * \retval false SPI is not selected - */ -bool SPI0_Selected(void); - -/** - * \brief Get received data byte from SPI - * - * \return Received data byte - */ -uint8_t SPI0_GetRxData(void); - -/** - * \brief Write data byte to SPI - * - * \param[in] data The data to transfer - * - * \return Nothing - */ -void SPI0_WriteTxData(uint8_t data); - -/** - * \brief Wait until SPI has recaived a data byte - * - * \return Nothing - */ -void SPI0_WaitDataready(void); - -#ifdef __cplusplus -} -#endif - -#endif /* SPI0_BASIC_H_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/tca0.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/tca0.h deleted file mode 100644 index 7991c35..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/include/tca0.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 2.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef TCA0_H_INCLUDED -#define TCA0_H_INCLUDED - -#include "../utils/compiler.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Initialize tca interface - * - * \return Initialization status. - */ - -typedef void (*TCA0_cb_t)(void); - -int8_t TCA0_Initialize(); -void TCA0_SetOVFIsrCallback(TCA0_cb_t cb); -void TCA0_SetCMP0IsrCallback(TCA0_cb_t cb); -void TCA0_SetCMP1IsrCallback(TCA0_cb_t cb); -void TCA0_SetCMP2IsrCallback(TCA0_cb_t cb); -void TCA0_EnableInterrupt(void); -void TCA0_DisableInterrupt(void); -uint16_t TCA0_ReadTimer(void); -void TCA0_WriteTimer(uint16_t timerVal); -void TCA0_ClearOverflowInterruptFlag(void); -bool TCA0_IsOverflowInterruptEnabled(void); -void TCA0_ClearCMP0InterruptFlag(void); -bool TCA0_IsCMP0InterruptEnabled(void); -void TCA0_ClearCMP1InterruptFlag(void); -bool TCA0_IsCMP1InterruptEnabled(void); -void TCA0_ClearCMP2InterruptFlag(void); -bool TCA0_IsCMP2InterruptEnabled(void); -#ifdef __cplusplus -} -#endif - -#endif /* TCA0_H_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/mcc.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/mcc.c deleted file mode 100644 index 854b9fb..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/mcc.c +++ /dev/null @@ -1,136 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#include "mcc.h" - -/** - * Initializes MCU, drivers and middleware in the project -**/ -void SYSTEM_Initialize(void) -{ - PIN_MANAGER_Initialize(); - BOD_Initialize(); - //CPU_Initialize(); - WDT_Initialize(); - SLPCTRL_Initialize(); - CLKCTRL_Initialize(); - SPI0_Initialize(); - EVSYS_Initialize(); - TCA0_Initialize(); - CCL_Initialize(); - CPUINT_Initialize(); -} - -/** - * \brief Initialize bod interface - */ -int8_t BOD_Initialize() -{ - //SLEEP DIS; - ccp_write_io((void*)&(BOD.CTRLA),0x00); - - //VLMCFG FALLING; VLMIE disabled; - BOD.INTCTRL = 0x00; - - //VLMLVL OFF; - BOD.VLMCTRLA = 0x00; - - return 0; -} - -ISR(BOD_VLM_vect) -{ - /* Insert your AC interrupt handling code here */ - - /* The interrupt flag has to be cleared manually */ - BOD.INTFLAGS = BOD_VLMIE_bm; -} - -/** - * \brief Initialize clkctrl interface - */ -int8_t CLKCTRL_Initialize() -{ - //RUNSTDBY disabled; - ccp_write_io((void*)&(CLKCTRL.OSC32KCTRLA),0x00); - - //RUNSTDBY disabled; CSUT 1K; SEL disabled; LPMODE disabled; ENABLE disabled; - ccp_write_io((void*)&(CLKCTRL.XOSC32KCTRLA),0x00); - - //PDIV 6X; PEN disabled; - ccp_write_io((void*)&(CLKCTRL.MCLKCTRLB),0x10); - - //CLKOUT disabled; CLKSEL OSCHF; - ccp_write_io((void*)&(CLKCTRL.MCLKCTRLA),0x00); - - //PLLS enabled; EXTS disabled; XOSC32KS disabled; OSC32KS disabled; OSCHFS disabled; SOSC disabled; - ccp_write_io((void*)&(CLKCTRL.MCLKSTATUS),0x20); - - //RUNSTDBY disabled; FREQSEL 24M; AUTOTUNE disabled; - ccp_write_io((void*)&(CLKCTRL.OSCHFCTRLA),0x24); - - //LOCKEN disabled; - ccp_write_io((void*)&(CLKCTRL.MCLKLOCK),0x00); - - return 0; -} - -/** - * \brief Initialize slpctrl interface - */ -int8_t SLPCTRL_Initialize() -{ - //SMODE IDLE; SEN disabled; - ccp_write_io((void*)&(SLPCTRL.CTRLA),0x00); - - return 0; -} - -/** - * \brief Initialize wdt interface - */ - -int8_t WDT_Initialize() -{ - //WINDOW OFF; PERIOD OFF; - ccp_write_io((void*)&(WDT.CTRLA),0x00); - - return 0; -} -/*TODO comment will remove once complier support will be available. -int8_t CPU_Initialize() -{ - return 0; - -} -*/ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/mcc.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/mcc.h deleted file mode 100644 index a8ff737..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/mcc.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef MCC_H -#define MCC_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "utils/compiler.h" -#include "include/pin_manager.h" -#include "include/ccl.h" -#include "include/spi0.h" -#include "include/cpuint.h" -#include "include/evsys.h" -#include "include/tca0.h" -#include "config/clock_config.h" - -/** - * Initializes MCU, drivers and middleware in the project -**/ -void SYSTEM_Initialize(void); -int8_t BOD_Initialize(); -int8_t CLKCTRL_Initialize(); -int8_t SLPCTRL_Initialize(); -int8_t WDT_Initialize(); - -#ifdef __cplusplus -} -#endif -#endif /* MCC_H */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/spi/spi0.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/spi/spi0.h new file mode 100644 index 0000000..4903573 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/spi/spi0.h @@ -0,0 +1,222 @@ +/** + * SPI0 Generated Driver API Header File + * + * @file spi0.h + * + * @defgroup spi0 SPI0 + * + * @brief Contains the API prototypes for the SPI0 driver. + * + * @version SPI0 Driver Version 2.0.1 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef SPI0_BASIC_H_INCLUDED +#define SPI0_BASIC_H_INCLUDED + +#include "../system/utils/compiler.h" +#include +#include "spi_interface.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern const struct SPI_INTERFACE SPI0_s; + +/** + * @ingroup spi0 + * @typedef void *spi0_TRANSFER_DONE_CB + * @brief Function pointer to the callback function called when there is an SPI interrupt. The default value is set to NULL which means that no callback function will be used. + */ +typedef void (*spi0_TRANSFER_DONE_CB)(void); + +/** + * @ingroup spi0 + * @typedef struct SPI0_configuration_t + * @brief Hardware configuration that controls SPI mode and baud rate + */ +typedef struct +{ + uint8_t CTRLAvalue; + uint8_t CTRLBvalue; +} SPI0_configuration_t; + +/** + * @ingroup spi0 + * @typedef enum spi0_transfer_type_t + * @brief Specifies whether the SPI transfer is to be uni- or bidirectional. A bidirectional transfer (=SPI_EXCHANGE) causes the received data to overwrite the buffer with the data to transmit. + */ +typedef enum spi0_transfer_type +{ + SPI0_EXCHANGE, ///< SPI transfer is bidirectional + SPI0_READ, ///< SPI transfer reads, writes only 0s + SPI0_WRITE ///< SPI transfer writes, discards read data +} spi0_transfer_type_t; + +/** + * @ingroup spi0 + * @typedef enum spi0_transfer_status_t + * @brief Status of the SPI hardware and SPI bus. + */ +typedef enum spi0_transfer_status +{ + SPI0_FREE, ///< SPI hardware is not open, bus is free. + SPI0_IDLE, ///< SPI hardware has been opened, no transfer ongoing. + SPI0_BUSY, ///< SPI hardware has been opened, transfer ongoing. + SPI0_DONE ///< SPI hardware has been opened, transfer complete. +} spi0_transfer_status_t; + +/** + * @ingroup spi0 + * @typedef enum SPI0_configuration_name_t + * @brief Enumeration of the different configurations supported by the driver for SPI interface. + * + * NOTE: A user may specify a configuration, e.g. CLIENT_A, used when communication over SPI with CLIENT_A, and another configuration, CLIENT_B, + * used when communication with CLIENT_B. The configurations may use different SPI configuration such as polarity or SCK frequency. + */ +typedef enum +{ + SPI0_DEFAULT +} SPI0_configuration_name_t; + + /** + * @ingroup spi0 + * @brief Initializes the SPI module. + * @param None. + * @return None. + */ +void SPI0_Initialize(void); + +/** + * @ingroup spi0 + * @brief Enables the SPI module. + * @param None. + * @return None. + */ +void SPI0_Enable(void); + +/** + * @ingroup spi0 + * @brief Disables the SPI module. + * @param None. + * @return None. + */ +void SPI0_Disable(void); + +/** + * @ingroup spi0 + * @brief Sets the index of Configuration to use in the transfer. + * @param uint8_t spiConfigIndex - Configuration index. See SPI0_configuration_name_t for configuration list. + * @retval True - SPI open was successful. + * @retval False - SPI open was not successful. + */ +bool SPI0_Open(uint8_t spiConfigIndex); + +/** + * @ingroup spi0 + * @brief Closes the SPI for communication. + * @param None. + * @return None. + */ +void SPI0_Close(void); + +/** + * @ingroup spi0 + * @brief Exchanges one byte over SPI. Blocks until done. + * @param uint8_t byteData - The byte to transfer. + * @return uint8_t - Received data byte. + */ +uint8_t SPI0_ByteExchange(uint8_t byteData); + +/** + * @ingroup spi0 + * @brief Exchanges a buffer over SPI. Blocks if using polled driver. + * @param[inout] void * bufferData The buffer to transfer. Received data is returned here. + * @param[in] size_t bufferSize The size of buffer to transfer. + * @return None. + */ +void SPI0_BufferExchange(void * bufferData, size_t bufferSize); + +/** + * @ingroup spi0 + * @brief Writes a buffer over SPI. Blocks if using polled driver. + * @param[in] void * bufferData The buffer to transfer. + * @param[in] size_t bufferSize The size of buffer to transfer. + * @return None. + */ +void SPI0_BufferWrite(void * bufferData, size_t bufferSize); + +/** + * @ingroup spi0 + * @brief Reads a buffer over SPI. Blocks if using polled driver. + * @param[out] void * bufferData Received data is written here. + * @param[in] size_t bufferSize The size of buffer to transfer. + * @return None. + */ +void SPI0_BufferRead(void * bufferData, size_t bufferSize); + +/** + * @ingroup spi0 + * @brief Writes a data byte to SPI. + * @param uint8_t byteData The byte to transfer. + * @return None. + */ +void SPI0_ByteWrite(uint8_t byteData); + +/** + * @ingroup spi0 + * @brief Gets the received data byte from SPI. + * @param None. + * @return uint8_t - The received data byte. + */ +uint8_t SPI0_ByteRead(void); + +/** + * @ingroup spi0 + * @brief Checks if SPI CLIENT is selected, i.e. its SS pin has been asserted. + * @param None. + * @retval True - SPI is selected. + * @retval False - SPI is not selected. + */ +bool SPI0_Selected(void); + +/** + * @ingroup spi0 + * @brief Waits until SPI has received a data byte. + * @param None. + * @return None. + */ +void SPI0_WaitDataready(void); + +uint8_t __attribute__((deprecated)) SPI0_ExchangeByte(uint8_t data); +void __attribute__((deprecated)) SPI0_ExchangeBlock(void *block, size_t blockSize); +void __attribute__((deprecated)) SPI0_WriteBlock(void *block, size_t blockSize); +void __attribute__((deprecated)) SPI0_ReadBlock(void *block, size_t blockSize); +void __attribute__((deprecated)) SPI0_WriteByte(uint8_t byte); +uint8_t __attribute__((deprecated)) SPI0_ReadByte(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SPI0_BASIC_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/spi/spi_interface.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/spi/spi_interface.h new file mode 100644 index 0000000..ff64abe --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/spi/spi_interface.h @@ -0,0 +1,86 @@ +/** + SPI Generated Driver API interface File + + @Company + Microchip Technology Inc. + + @File Name + spi_interface.h + + @Summary + This is the generated driver interface file for the SPI driver. + + @Description + This interface file provides APIs for driver for SPI. + The generated drivers are tested against the following: + Compiler : XC8 v2.20 + MPLAB : MPLABX v5.40 +*/ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef SPI_INTERFACE_H +#define SPI_INTERFACE_H + +/** + Section: Included Files +*/ +#include +#include +#include + +#ifdef __cplusplus + + extern "C" { + +#endif + +/** + Section: Data Type Definitions +*/ + +/** + SPI Driver function structure. + + @Summary + Structure containing the function pointers of SPI driver. + */ +struct SPI_INTERFACE +{ + void (*Initialize)(void); + void (*Close)(void); + bool (*Open)(uint8_t spiConfigIndex); + void (*BufferExchange)(void *bufferData, size_t bufferSize); + void (*BufferRead)(void *bufferData, size_t bufferSize); + void (*BufferWrite)(void *bufferData, size_t bufferSize); + uint8_t (*ByteExchange)(uint8_t byteData); + uint8_t (*ByteRead)(void); + void (*ByteWrite)(uint8_t byteData); +}; + +#ifdef __cplusplus + + } + +#endif + +#endif //SPI_INTERFACE_H diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/spi/src/spi0.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/spi/src/spi0.c new file mode 100644 index 0000000..80429c0 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/spi/src/spi0.c @@ -0,0 +1,207 @@ +/** + * SPI0 Generated Driver File + * + * @file spi0.c + * + * @ingroup spi0 + * + * @brief Contains the API Implementations for SPI0 module. + * + * @version SPI0 Driver Version 2.0.1 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include "../spi0.h" + +typedef struct spi0_descriptor_s +{ + spi0_transfer_status_t status; +} spi0_descriptor_t; + +/** + SPI0_DRIVER_FUNCTION object + + @brief Defines an object for SPI_DRIVER_FUNCTIONS. + */ +const struct SPI_INTERFACE SPI0_s = +{ + .Initialize = SPI0_Initialize, + .Close = SPI0_Close, + .Open = SPI0_Open, + .BufferExchange = SPI0_BufferExchange, + .BufferRead = SPI0_BufferRead, + .BufferWrite = SPI0_BufferWrite, + .ByteExchange = SPI0_ByteExchange, + .ByteRead = SPI0_ByteRead, + .ByteWrite = SPI0_ByteWrite, +}; + +SPI0_configuration_t spi0_configurations[] = +{ + { 0x35, 0x1 } +}; + +static spi0_descriptor_t spi0_desc; + +void SPI0_Initialize(void) +{ + //BUFEN disabled; BUFWR disabled; MODE 1; SSD disabled; + SPI0.CTRLB = 0x1; + + //CLK2X enabled; DORD disabled; ENABLE enabled; MASTER enabled; PRESC DIV64; + SPI0.CTRLA = 0x35; + + //DREIE disabled; IE disabled; RXCIE disabled; SSIE disabled; TXCIE disabled; + SPI0.INTCTRL = 0x0; + + spi0_desc.status = SPI0_FREE; + + //BUFOVF disabled; DREIF disabled; RXCIF disabled; SSIF disabled; TXCIF disabled; IF disabled; WRCOL disabled; + SPI0.INTFLAGS = 0x0; +} + +void SPI0_Enable(void) +{ + SPI0.CTRLA |= SPI_ENABLE_bm; +} + +void SPI0_Disable(void) +{ + SPI0.CTRLA &= ~SPI_ENABLE_bm; +} + +bool SPI0_Open(uint8_t spiConfigIndex) +{ + if (spi0_desc.status == SPI0_FREE) { + spi0_desc.status = SPI0_IDLE; + SPI0.CTRLB = spi0_configurations[spiConfigIndex].CTRLBvalue; + SPI0.CTRLA = spi0_configurations[spiConfigIndex].CTRLAvalue; + return true; + } else { + return false; + } +} + +void SPI0_Close(void) +{ + spi0_desc.status = SPI0_FREE; +} + +uint8_t SPI0_ByteExchange(uint8_t data) +{ + SPI0.DATA = data; + while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)); + return SPI0.DATA; +} + +bool SPI0_Selected(void) +{ +/** + * @brief Returns true if SS pin is selected. + * TODO: Place your code here + */ +return true; +} + +void SPI0_WaitDataready(void) +{ + while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)) + ; +} + +void SPI0_BufferExchange(void *block, size_t size) +{ + uint8_t *b = (uint8_t *)block; + while (size--) { + SPI0.DATA = *b; + while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)) + ; + *b = SPI0.DATA; + b++; + } +} + +void SPI0_BufferWrite(void *block, size_t size) +{ + uint8_t *b = (uint8_t *)block; + uint8_t rdata; + while (size--) { + SPI0.DATA = *b; + while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)) + ; + rdata = SPI0.DATA; + (void)(rdata); // Silence compiler warning + b++; + } +} + +void SPI0_BufferRead(void *block, size_t size) +{ + uint8_t *b = (uint8_t *)block; + while (size--) { + SPI0.DATA = 0; + while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)) + ; + *b = SPI0.DATA; + b++; + } +} + +void SPI0_ByteWrite(uint8_t data) +{ + SPI0.DATA = data; +} + +uint8_t SPI0_ByteRead(void) +{ + return SPI0.DATA; +} + +uint8_t SPI0_ExchangeByte(uint8_t data) +{ + return SPI0_ByteExchange(data); +} + +void SPI0_ExchangeBlock(void *block, size_t blockSize) +{ + SPI0_BufferExchange(block, blockSize); +} + +void SPI0_WriteBlock(void *block, size_t blockSize) +{ + SPI0_BufferWrite(block, blockSize); +} + +void SPI0_ReadBlock(void *block, size_t blockSize) +{ + SPI0_BufferRead(block, blockSize); +} + +void SPI0_WriteByte(uint8_t byte) +{ + SPI0_ByteWrite(byte); +} + +uint8_t SPI0_ReadByte(void) +{ + return SPI0_ByteRead(); +} diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/ccl.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/ccl.c deleted file mode 100644 index 79a74b7..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/ccl.c +++ /dev/null @@ -1,141 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#include "../include/ccl.h" - -int8_t CCL_Initialize() -{ - //INTMODE3 INTDISABLE; INTMODE2 INTDISABLE; INTMODE1 INTDISABLE; INTMODE0 INTDISABLE; - CCL.INTCTRL0 = 0x00; - - //INTMODE5 INTDISABLE; INTMODE4 INTDISABLE; - CCL.INTCTRL1 = 0x00; - - //INT5 disabled; INT4 disabled; INT3 disabled; INT2 disabled; INT1 disabled; INT0 disabled; - CCL.INTFLAGS = 0x00; - - //INSEL1 SPI0; INSEL0 TCA0; - CCL.LUT0CTRLB = 0x9A; - - //INSEL2 TCA0; - CCL.LUT0CTRLC = 0x0A; - - //INSEL1 MASK; INSEL0 MASK; - CCL.LUT1CTRLB = 0x00; - - //INSEL2 MASK; - CCL.LUT1CTRLC = 0x00; - - //INSEL1 MASK; INSEL0 MASK; - CCL.LUT2CTRLB = 0x00; - - //INSEL2 MASK; - CCL.LUT2CTRLC = 0x00; - - //INSEL1 MASK; INSEL0 MASK; - CCL.LUT3CTRLB = 0x00; - - //INSEL2 MASK; - CCL.LUT3CTRLC = 0x00; - - //INSEL1 MASK; INSEL0 MASK; - CCL.LUT4CTRLB = 0x00; - - //INSEL2 MASK; - CCL.LUT4CTRLC = 0x00; - - //INSEL1 MASK; INSEL0 MASK; - CCL.LUT5CTRLB = 0x00; - - //INSEL2 MASK; - CCL.LUT5CTRLC = 0x00; - - //SEQSEL0 DISABLE; - CCL.SEQCTRL0 = 0x00; - - //SEQSEL1 DISABLE; - CCL.SEQCTRL1 = 0x00; - - //SEQSEL2 DISABLE; - CCL.SEQCTRL2 = 0x00; - - // - CCL.TRUTH0 = 0xE0; - - // - CCL.TRUTH1 = 0x00; - - // - CCL.TRUTH2 = 0x00; - - // - CCL.TRUTH3 = 0x00; - - // - CCL.TRUTH4 = 0x00; - - // - CCL.TRUTH5 = 0x00; - - //EDGEDET DIS; OUTEN enabled; FILTSEL DISABLE; CLKSRC CLKPER; ENABLE enabled; - CCL.LUT0CTRLA = 0x41; - - //EDGEDET DIS; OUTEN disabled; FILTSEL DISABLE; CLKSRC CLKPER; ENABLE disabled; - CCL.LUT1CTRLA = 0x00; - - //EDGEDET DIS; OUTEN disabled; FILTSEL DISABLE; CLKSRC CLKPER; ENABLE disabled; - CCL.LUT2CTRLA = 0x00; - - //EDGEDET DIS; OUTEN disabled; FILTSEL DISABLE; CLKSRC CLKPER; ENABLE disabled; - CCL.LUT3CTRLA = 0x00; - - //EDGEDET DIS; OUTEN disabled; FILTSEL DISABLE; CLKSRC CLKPER; ENABLE disabled; - CCL.LUT4CTRLA = 0x00; - - //EDGEDET DIS; OUTEN disabled; FILTSEL DISABLE; CLKSRC CLKPER; ENABLE disabled; - CCL.LUT5CTRLA = 0x00; - - //RUNSTDBY disabled; ENABLE enabled; - CCL.CTRLA = 0x01; - - return 0; -} -ISR(CCL_CCL_vect) -{ - /* - * Insert your CCL interrupt handling code - * - * Interrupt flag can be cleared by writing 1 to its bit location - * in the INTFLAGS register - */ -} \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/cpuint.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/cpuint.c deleted file mode 100644 index 618880d..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/cpuint.c +++ /dev/null @@ -1,54 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#include "../include/cpuint.h" - -/** - * \brief Initialize cpuint interface - */ -int8_t CPUINT_Initialize() -{ - /* IVSEL and CVT are Configuration Change Protected */ - - //IVSEL disabled; CVT disabled; LVL0RR disabled; - ccp_write_io((void*)&(CPUINT.CTRLA),0x00); - - //LVL0PRI 0; - CPUINT.LVL0PRI = 0x00; - - //LVL1VEC 0; - CPUINT.LVL1VEC = 0x00; - - - return 0; -} \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/evsys.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/evsys.c deleted file mode 100644 index d5cfe9e..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/evsys.c +++ /dev/null @@ -1,142 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#include "../include/evsys.h" - -int8_t EVSYS_Initialize() -{ - //CHANNEL0 SPI0_SCK; - EVSYS.CHANNEL0 = 0x68; - //CHANNEL1 OFF; - EVSYS.CHANNEL1 = 0x00; - //CHANNEL2 OFF; - EVSYS.CHANNEL2 = 0x00; - //CHANNEL3 OFF; - EVSYS.CHANNEL3 = 0x00; - //CHANNEL4 OFF; - EVSYS.CHANNEL4 = 0x00; - //CHANNEL5 OFF; - EVSYS.CHANNEL5 = 0x00; - //CHANNEL6 OFF; - EVSYS.CHANNEL6 = 0x00; - //CHANNEL7 OFF; - EVSYS.CHANNEL7 = 0x00; - //CHANNEL8 OFF; - EVSYS.CHANNEL8 = 0x00; - //CHANNEL9 OFF; - EVSYS.CHANNEL9 = 0x00; - //SWEVENTA CH0; - EVSYS.SWEVENTA = 0x01; - //SWEVENTB CH8; - EVSYS.SWEVENTB = 0x00; - //USER OFF; - EVSYS.USERADC0START = 0x00; - //USER OFF; - EVSYS.USERCCLLUT0A = 0x00; - //USER OFF; - EVSYS.USERCCLLUT0B = 0x00; - //USER OFF; - EVSYS.USERCCLLUT1A = 0x00; - //USER OFF; - EVSYS.USERCCLLUT1B = 0x00; - //USER OFF; - EVSYS.USERCCLLUT2A = 0x00; - //USER OFF; - EVSYS.USERCCLLUT2B = 0x00; - //USER OFF; - EVSYS.USERCCLLUT3A = 0x00; - //USER OFF; - EVSYS.USERCCLLUT3B = 0x00; - //USER OFF; - EVSYS.USERCCLLUT4A = 0x00; - //USER OFF; - EVSYS.USERCCLLUT4B = 0x00; - //USER OFF; - EVSYS.USERCCLLUT5A = 0x00; - //USER OFF; - EVSYS.USERCCLLUT5B = 0x00; - //USER OFF; - EVSYS.USEREVSYSEVOUTA = 0x00; - //USER OFF; - EVSYS.USEREVSYSEVOUTB = 0x00; - //USER OFF; - EVSYS.USEREVSYSEVOUTC = 0x00; - //USER OFF; - EVSYS.USEREVSYSEVOUTD = 0x00; - //USER OFF; - EVSYS.USEREVSYSEVOUTE = 0x00; - //USER OFF; - EVSYS.USEREVSYSEVOUTF = 0x00; - //USER OFF; - EVSYS.USERPTCSTART = 0x00; - //USER CHANNEL0; - EVSYS.USERTCA0CNTA = 0x01; - //USER CHANNEL0; - EVSYS.USERTCA0CNTB = 0x01; - //USER CHANNEL0; - EVSYS.USERTCA1CNTA = 0x01; - //USER CHANNEL0; - EVSYS.USERTCA1CNTB = 0x01; - //USER OFF; - EVSYS.USERTCB0CAPT = 0x00; - //USER OFF; - EVSYS.USERTCB0COUNT = 0x00; - //USER OFF; - EVSYS.USERTCB1CAPT = 0x00; - //USER OFF; - EVSYS.USERTCB1COUNT = 0x00; - //USER OFF; - EVSYS.USERTCB2CAPT = 0x00; - //USER OFF; - EVSYS.USERTCB2COUNT = 0x00; - //USER OFF; - EVSYS.USERTCB3CAPT = 0x00; - //USER OFF; - EVSYS.USERTCB3COUNT = 0x00; - //USER OFF; - EVSYS.USERTCD0INPUTA = 0x00; - //USER OFF; - EVSYS.USERTCD0INPUTB = 0x00; - //USER OFF; - EVSYS.USERUSART0IRDA = 0x00; - //USER OFF; - EVSYS.USERUSART1IRDA = 0x00; - //USER OFF; - EVSYS.USERUSART2IRDA = 0x00; - //USER OFF; - EVSYS.USERUSART3IRDA = 0x00; - //USER OFF; - EVSYS.USERUSART4IRDA = 0x00; - - return 0; -} diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/pin_manager.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/pin_manager.c deleted file mode 100644 index c043e96..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/pin_manager.c +++ /dev/null @@ -1,332 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#include "../include/pin_manager.h" -static void (*PORTA_PA2_InterruptHandler)(void); -static void (*PORTB_PB3_InterruptHandler)(void); -static void (*PORTA_PA1_InterruptHandler)(void); -static void (*PORTC_PC3_InterruptHandler)(void); -static void (*PORTA_PA4_InterruptHandler)(void); -static void (*PORTA_PA3_InterruptHandler)(void); -static void (*PORTA_PA6_InterruptHandler)(void); -static void (*PORTA_PA5_InterruptHandler)(void); -static void (*PORTA_PA0_InterruptHandler)(void); -static void (*PORTD_PD3_InterruptHandler)(void); - -void PORT_Initialize(void); - -void PIN_MANAGER_Initialize() -{ - PORT_Initialize(); - - /* DIR Registers Initialization */ - PORTA.DIR = 0x5F; - PORTB.DIR = 0x08; - PORTC.DIR = 0x08; - PORTD.DIR = 0x08; - PORTE.DIR = 0x00; - PORTF.DIR = 0x00; - - /* OUT Registers Initialization */ - PORTA.OUT = 0x00; - PORTB.OUT = 0x00; - PORTC.OUT = 0x00; - PORTD.OUT = 0x00; - PORTE.OUT = 0x00; - PORTF.OUT = 0x00; - - /* PINxCTRL registers Initialization */ - PORTA.PIN0CTRL = 0x00; - PORTA.PIN1CTRL = 0x00; - PORTA.PIN2CTRL = 0x00; - PORTA.PIN3CTRL = 0x00; - PORTA.PIN4CTRL = 0x00; - PORTA.PIN5CTRL = 0x00; - PORTA.PIN6CTRL = 0x00; - PORTA.PIN7CTRL = 0x00; - PORTB.PIN0CTRL = 0x00; - PORTB.PIN1CTRL = 0x00; - PORTB.PIN2CTRL = 0x00; - PORTB.PIN3CTRL = 0x00; - PORTB.PIN4CTRL = 0x00; - PORTB.PIN5CTRL = 0x00; - PORTB.PIN6CTRL = 0x00; - PORTB.PIN7CTRL = 0x00; - PORTC.PIN0CTRL = 0x00; - PORTC.PIN1CTRL = 0x00; - PORTC.PIN2CTRL = 0x00; - PORTC.PIN3CTRL = 0x00; - PORTC.PIN4CTRL = 0x00; - PORTC.PIN5CTRL = 0x00; - PORTC.PIN6CTRL = 0x00; - PORTC.PIN7CTRL = 0x00; - PORTD.PIN0CTRL = 0x00; - PORTD.PIN1CTRL = 0x00; - PORTD.PIN2CTRL = 0x00; - PORTD.PIN3CTRL = 0x00; - PORTD.PIN4CTRL = 0x00; - PORTD.PIN5CTRL = 0x00; - PORTD.PIN6CTRL = 0x00; - PORTD.PIN7CTRL = 0x00; - PORTE.PIN0CTRL = 0x00; - PORTE.PIN1CTRL = 0x00; - PORTE.PIN2CTRL = 0x00; - PORTE.PIN3CTRL = 0x00; - PORTE.PIN4CTRL = 0x00; - PORTE.PIN5CTRL = 0x00; - PORTE.PIN6CTRL = 0x00; - PORTE.PIN7CTRL = 0x00; - PORTF.PIN0CTRL = 0x00; - PORTF.PIN1CTRL = 0x00; - PORTF.PIN2CTRL = 0x00; - PORTF.PIN3CTRL = 0x00; - PORTF.PIN4CTRL = 0x00; - PORTF.PIN5CTRL = 0x00; - PORTF.PIN6CTRL = 0x00; - PORTF.PIN7CTRL = 0x00; - - /* Multi-pin Config registers Initialization */ - PORTA.PINCONFIG = 0x00; - PORTA.PINCTRLCLR = 0x00; - PORTA.PINCTRLSET = 0x00; - PORTA.PINCTRLUPD = 0x00; - PORTB.PINCONFIG = 0x00; - PORTB.PINCTRLCLR = 0x00; - PORTB.PINCTRLSET = 0x00; - PORTB.PINCTRLUPD = 0x00; - PORTC.PINCONFIG = 0x00; - PORTC.PINCTRLCLR = 0x00; - PORTC.PINCTRLSET = 0x00; - PORTC.PINCTRLUPD = 0x00; - PORTD.PINCONFIG = 0x00; - PORTD.PINCTRLCLR = 0x00; - PORTD.PINCTRLSET = 0x00; - PORTD.PINCTRLUPD = 0x00; - PORTE.PINCONFIG = 0x00; - PORTE.PINCTRLCLR = 0x00; - PORTE.PINCTRLSET = 0x00; - PORTE.PINCTRLUPD = 0x00; - PORTF.PINCONFIG = 0x00; - PORTF.PINCTRLCLR = 0x00; - PORTF.PINCTRLSET = 0x00; - PORTF.PINCTRLUPD = 0x00; - - /* PORTMUX Initialization */ - PORTMUX.ACROUTEA = 0x00; - PORTMUX.CCLROUTEA = 0x00; - PORTMUX.EVSYSROUTEA = 0x00; - PORTMUX.SPIROUTEA = 0x00; - PORTMUX.TCAROUTEA = 0x00; - PORTMUX.TCBROUTEA = 0x01; - PORTMUX.TCDROUTEA = 0x01; - PORTMUX.TWIROUTEA = 0x00; - PORTMUX.USARTROUTEA = 0x00; - PORTMUX.USARTROUTEB = 0x00; - PORTMUX.ZCDROUTEA = 0x00; - - // register default ISC callback functions at runtime; use these methods to register a custom function - PORTA_PA2_SetInterruptHandler(PORTA_PA2_DefaultInterruptHandler); - PORTB_PB3_SetInterruptHandler(PORTB_PB3_DefaultInterruptHandler); - PORTA_PA1_SetInterruptHandler(PORTA_PA1_DefaultInterruptHandler); - PORTC_PC3_SetInterruptHandler(PORTC_PC3_DefaultInterruptHandler); - PORTA_PA4_SetInterruptHandler(PORTA_PA4_DefaultInterruptHandler); - PORTA_PA3_SetInterruptHandler(PORTA_PA3_DefaultInterruptHandler); - PORTA_PA6_SetInterruptHandler(PORTA_PA6_DefaultInterruptHandler); - PORTA_PA5_SetInterruptHandler(PORTA_PA5_DefaultInterruptHandler); - PORTA_PA0_SetInterruptHandler(PORTA_PA0_DefaultInterruptHandler); - PORTD_PD3_SetInterruptHandler(PORTD_PD3_DefaultInterruptHandler); -} - -void PORT_Initialize(void) -{ - /* On AVR devices all peripherals are enable from power on reset, this - * disables all peripherals to save power. Driver shall enable - * peripheral if used */ - - /* Set all pins to low power mode */ - for (uint8_t i = 0; i < 8; i++) { - *((uint8_t *)&PORTE + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - - for (uint8_t i = 0; i < 8; i++) { - *((uint8_t *)&PORTF + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - - for (uint8_t i = 0; i < 8; i++) { - *((uint8_t *)&PORTA + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - - for (uint8_t i = 0; i < 8; i++) { - *((uint8_t *)&PORTB + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - - for (uint8_t i = 0; i < 8; i++) { - *((uint8_t *)&PORTC + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - - for (uint8_t i = 0; i < 8; i++) { - *((uint8_t *)&PORTD + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; - } - -} - -/** - Allows selecting an interrupt handler for PORTA_PA2 at application runtime -*/ -void PORTA_PA2_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTA_PA2_InterruptHandler = interruptHandler; -} - -void PORTA_PA2_DefaultInterruptHandler(void) -{ - // add your PORTA_PA2 interrupt custom code - // or set custom function using PORTA_PA2_SetInterruptHandler() -} -/** - Allows selecting an interrupt handler for PORTB_PB3 at application runtime -*/ -void PORTB_PB3_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTB_PB3_InterruptHandler = interruptHandler; -} - -void PORTB_PB3_DefaultInterruptHandler(void) -{ - // add your PORTB_PB3 interrupt custom code - // or set custom function using PORTB_PB3_SetInterruptHandler() -} -/** - Allows selecting an interrupt handler for PORTA_PA1 at application runtime -*/ -void PORTA_PA1_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTA_PA1_InterruptHandler = interruptHandler; -} - -void PORTA_PA1_DefaultInterruptHandler(void) -{ - // add your PORTA_PA1 interrupt custom code - // or set custom function using PORTA_PA1_SetInterruptHandler() -} -/** - Allows selecting an interrupt handler for PORTC_PC3 at application runtime -*/ -void PORTC_PC3_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTC_PC3_InterruptHandler = interruptHandler; -} - -void PORTC_PC3_DefaultInterruptHandler(void) -{ - // add your PORTC_PC3 interrupt custom code - // or set custom function using PORTC_PC3_SetInterruptHandler() -} -/** - Allows selecting an interrupt handler for PORTA_PA4 at application runtime -*/ -void PORTA_PA4_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTA_PA4_InterruptHandler = interruptHandler; -} - -void PORTA_PA4_DefaultInterruptHandler(void) -{ - // add your PORTA_PA4 interrupt custom code - // or set custom function using PORTA_PA4_SetInterruptHandler() -} -/** - Allows selecting an interrupt handler for PORTA_PA3 at application runtime -*/ -void PORTA_PA3_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTA_PA3_InterruptHandler = interruptHandler; -} - -void PORTA_PA3_DefaultInterruptHandler(void) -{ - // add your PORTA_PA3 interrupt custom code - // or set custom function using PORTA_PA3_SetInterruptHandler() -} -/** - Allows selecting an interrupt handler for PORTA_PA6 at application runtime -*/ -void PORTA_PA6_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTA_PA6_InterruptHandler = interruptHandler; -} - -void PORTA_PA6_DefaultInterruptHandler(void) -{ - // add your PORTA_PA6 interrupt custom code - // or set custom function using PORTA_PA6_SetInterruptHandler() -} -/** - Allows selecting an interrupt handler for PORTA_PA5 at application runtime -*/ -void PORTA_PA5_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTA_PA5_InterruptHandler = interruptHandler; -} - -void PORTA_PA5_DefaultInterruptHandler(void) -{ - // add your PORTA_PA5 interrupt custom code - // or set custom function using PORTA_PA5_SetInterruptHandler() -} -/** - Allows selecting an interrupt handler for PORTA_PA0 at application runtime -*/ -void PORTA_PA0_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTA_PA0_InterruptHandler = interruptHandler; -} - -void PORTA_PA0_DefaultInterruptHandler(void) -{ - // add your PORTA_PA0 interrupt custom code - // or set custom function using PORTA_PA0_SetInterruptHandler() -} -/** - Allows selecting an interrupt handler for PORTD_PD3 at application runtime -*/ -void PORTD_PD3_SetInterruptHandler(void (* interruptHandler)(void)) -{ - PORTD_PD3_InterruptHandler = interruptHandler; -} - -void PORTD_PD3_DefaultInterruptHandler(void) -{ - // add your PORTD_PD3 interrupt custom code - // or set custom function using PORTD_PD3_SetInterruptHandler() -} diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/spi0.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/spi0.c deleted file mode 100644 index 776e4a6..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/spi0.c +++ /dev/null @@ -1,176 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#include "../include/spi0.h" -#include "../include/pin_manager.h" - -typedef struct spi0_descriptor_s { - spi0_transfer_status_t status; -} spi0_descriptor_t; - -spi0_configuration_t spi0_configurations[] = { - { 0x35, 0x5 } -}; - -static spi0_descriptor_t spi0_desc; - -uint8_t SPI0_Initialize() -{ - //DORD disabled; MASTER enabled; CLK2X enabled; PRESC DIV64; ENABLE enabled; - SPI0.CTRLA = 0x35; - - //BUFEN disabled; BUFWR disabled; SSD enabled; MODE 1; - SPI0.CTRLB = 0x05; - - //RXCIE disabled; TXCIE disabled; DREIE disabled; SSIE disabled; IE disabled; - SPI0.INTCTRL = 0x00; - - spi0_desc.status = SPI0_FREE; - - //RXCIF disabled; IF disabled; TXCIF disabled; WRCOL disabled; DREIF disabled; SSIF disabled; BUFOVF disabled; - SPI0.INTFLAGS = 0x00; - - return 0; -} - -void SPI0_Enable() -{ - SPI0.CTRLA |= SPI_ENABLE_bm; -} - -void SPI0_Disable() -{ - SPI0.CTRLA &= ~SPI_ENABLE_bm; -} - -bool SPI0_OpenConfiguration(uint8_t spiUniqueConfiguration){ - return SPI0_Open(spi0_configurations[spiUniqueConfiguration]); -} - -bool SPI0_Open(spi0_configuration_t spiUniqueConfiguration) -{ - if (spi0_desc.status == SPI0_FREE) { - spi0_desc.status = SPI0_IDLE; - SPI0.CTRLA = spiUniqueConfiguration.CTRLAvalue; - SPI0.CTRLB = spiUniqueConfiguration.CTRLBvalue; - return true; - } else { - return false; - } -} - -void SPI0_Close(void) -{ - spi0_desc.status = SPI0_FREE; -} - -uint8_t SPI0_ExchangeByte(uint8_t data) -{ - SPI0.DATA = data; - while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)); - return SPI0.DATA; -} - -bool SPI0_Selected() -{ -/** - * \brief returns true if SS pin is selected - * TODO: Place your code - */ -return true; -} - -uint8_t SPI0_GetRxData() -{ - return SPI0.DATA; -} - -void SPI0_WriteTxData(uint8_t data) -{ - SPI0.DATA = data; -} - -void SPI0_WaitDataready() -{ - while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)) - ; -} - -void SPI0_ExchangeBlock(void *block, size_t size) -{ - uint8_t *b = (uint8_t *)block; - while (size--) { - SPI0.DATA = *b; - while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)) - ; - *b = SPI0.DATA; - b++; - } -} - -void SPI0_WriteBlock(void *block, size_t size) -{ - uint8_t *b = (uint8_t *)block; - uint8_t rdata; - while (size--) { - SPI0.DATA = *b; - while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)) - ; - rdata = SPI0.DATA; - (void)(rdata); // Silence compiler warning - b++; - } -} - -void SPI0_ReadBlock(void *block, size_t size) -{ - uint8_t *b = (uint8_t *)block; - while (size--) { - SPI0.DATA = 0; - while (!(SPI0.INTFLAGS & SPI_RXCIF_bm)) - ; - *b = SPI0.DATA; - b++; - } -} - -void SPI0_WriteByte(uint8_t data) -{ - - SPI0.DATA = data; -} - -uint8_t SPI0_ReadByte() -{ - return SPI0.DATA; -} \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/tca0.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/tca0.c deleted file mode 100644 index fdd5f2a..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/tca0.c +++ /dev/null @@ -1,245 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 2.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#include "../include/tca0.h" - -void TCA0_DefaultCMP0IsrCallback(void); -void (*TCA0_CMP0_isr_cb)(void) = &TCA0_DefaultCMP0IsrCallback; -void TCA0_DefaultCMP1IsrCallback(void); -void (*TCA0_CMP1_isr_cb)(void) = &TCA0_DefaultCMP1IsrCallback; -void TCA0_DefaultCMP2IsrCallback(void); -void (*TCA0_CMP2_isr_cb)(void) = &TCA0_DefaultCMP2IsrCallback; -void TCA0_DefaultOVFIsrCallback(void); -void (*TCA0_OVF_isr_cb)(void) = &TCA0_DefaultOVFIsrCallback; - -void TCA0_DefaultCMP0IsrCallback(void) -{ - //Add your ISR code here -} - -void TCA0_DefaultCMP1IsrCallback(void) -{ - //Add your ISR code here -} - -void TCA0_DefaultCMP2IsrCallback(void) -{ - //Add your ISR code here -} - -void TCA0_DefaultOVFIsrCallback(void) -{ - //Add your ISR code here -} - -void TCA0_SetOVFIsrCallback(TCA0_cb_t cb) -{ - TCA0_OVF_isr_cb = cb; -} - -void TCA0_SetCMP0IsrCallback(TCA0_cb_t cb) -{ - TCA0_CMP0_isr_cb = cb; -} - -void TCA0_SetCMP1IsrCallback(TCA0_cb_t cb) -{ - TCA0_CMP1_isr_cb = cb; -} - -void TCA0_SetCMP2IsrCallback(TCA0_cb_t cb) -{ - TCA0_CMP2_isr_cb = cb; -} - -ISR(TCA0_CMP0_vect) -{ - if (TCA0_CMP0_isr_cb != NULL) - (*TCA0_CMP0_isr_cb)(); - - TCA0.SINGLE.INTFLAGS = TCA_SINGLE_CMP0_bm; -} - -ISR(TCA0_CMP1_vect) -{ - if (TCA0_CMP1_isr_cb != NULL) - (*TCA0_CMP1_isr_cb)(); - - TCA0.SINGLE.INTFLAGS = TCA_SINGLE_CMP1_bm; -} - -ISR(TCA0_CMP2_vect) -{ - if (TCA0_CMP2_isr_cb != NULL) - (*TCA0_CMP2_isr_cb)(); - - TCA0.SINGLE.INTFLAGS = TCA_SINGLE_CMP2_bm; -} - -ISR(TCA0_OVF_vect) -{ - if (TCA0_OVF_isr_cb != NULL) - (*TCA0_OVF_isr_cb)(); - - TCA0.SINGLE.INTFLAGS = TCA_SINGLE_OVF_bm; -} - - -/** - * \brief Initialize TCA interface - */ -int8_t TCA0_Initialize() -{ - //Compare 0 - TCA0.SINGLE.CMP0 = 0x0A; - - //Compare 1 - TCA0.SINGLE.CMP1 = 0x00; - - //Compare 2 - TCA0.SINGLE.CMP2 = 0x12; - - //Count - TCA0.SINGLE.CNT = 0x00; - - //CMP2EN enabled; CMP1EN disabled; CMP0EN enabled; ALUPD disabled; WGMODE SINGLESLOPE; - TCA0.SINGLE.CTRLB = 0x53; - - //CMP2OV disabled; CMP1OV disabled; CMP0OV disabled; - TCA0.SINGLE.CTRLC = 0x00; - - //SPLITM disabled; - TCA0.SINGLE.CTRLD = 0x00; - - //CMD NONE; LUPD disabled; DIR disabled; - TCA0.SINGLE.CTRLECLR = 0x00; - - //CMD NONE; LUPD disabled; DIR UP; - TCA0.SINGLE.CTRLESET = 0x00; - - //CMP2BV disabled; CMP1BV disabled; CMP0BV disabled; PERBV disabled; - TCA0.SINGLE.CTRLFCLR = 0x00; - - //CMP2BV disabled; CMP1BV disabled; CMP0BV disabled; PERBV disabled; - TCA0.SINGLE.CTRLFSET = 0x00; - - //DBGRUN disabled; - TCA0.SINGLE.DBGCTRL = 0x00; - - //EVACTB RESTART_POSEDGE; CNTBEI enabled; EVACTA UPDOWN; CNTAEI disabled; - TCA0.SINGLE.EVCTRL = 0x96; - - //CMP2 disabled; CMP1 disabled; CMP0 disabled; OVF disabled; - TCA0.SINGLE.INTCTRL = 0x00; - - //CMP2 disabled; CMP1 disabled; CMP0 disabled; OVF disabled; - TCA0.SINGLE.INTFLAGS = 0x00; - - //Period - TCA0.SINGLE.PER = 0x95F; - - //Temporary data for 16-bit Access - TCA0.SINGLE.TEMP = 0x00; - - //RUNSTDBY disabled; CLKSEL DIV1; ENABLE disabled; - TCA0.SINGLE.CTRLA = 0x00; - - return 0; -} - -void TCA0_WriteTimer(uint16_t timerVal) -{ - TCA0.SINGLE.CNT=timerVal; -} - -uint16_t TCA0_ReadTimer(void) -{ - uint16_t readVal; - - readVal = TCA0.SINGLE.CNT; - - return readVal; -} - -void TCA0_EnableInterrupt(void) -{ - TCA0.SINGLE.INTCTRL = 1 << TCA_SINGLE_CMP0_bp /* Compare 0 Interrupt: enabled */ - | 1 << TCA_SINGLE_CMP1_bp /* Compare 1 Interrupt: enabled */ - | 1 << TCA_SINGLE_CMP2_bp /* Compare 2 Interrupt: enabled */ - | 1 << TCA_SINGLE_OVF_bp; /* Overflow Interrupt: enabled */ -} -void TCA0_DisableInterrupt(void) -{ - TCA0.SINGLE.INTCTRL = 0 << TCA_SINGLE_CMP0_bp /* Compare 0 Interrupt: disabled */ - | 0 << TCA_SINGLE_CMP1_bp /* Compare 1 Interrupt: disabled */ - | 0 << TCA_SINGLE_CMP2_bp /* Compare 2 Interrupt: disabled */ - | 0 << TCA_SINGLE_OVF_bp; /* Overflow Interrupt: disabled */ -} -void TCA0_ClearOverflowInterruptFlag(void) -{ - TCA0.SINGLE.INTFLAGS &= ~TCA_SINGLE_OVF_bm; /* Overflow Interrupt: disabled */ -} -bool TCA0_IsOverflowInterruptEnabled(void) -{ - return ((TCA0.SINGLE.INTFLAGS & TCA_SINGLE_OVF_bm) > 0); -} - -void TCA0_ClearCMP0InterruptFlag(void) -{ - TCA0.SINGLE.INTFLAGS &= ~TCA_SINGLE_CMP0_bm; /* Compare Channel-0 Interrupt: disabled */ -} - -bool TCA0_IsCMP0InterruptEnabled(void) -{ - return ((TCA0.SINGLE.INTFLAGS & TCA_SINGLE_CMP0_bm) > 0); -} - -void TCA0_ClearCMP1InterruptFlag(void) -{ - TCA0.SINGLE.INTFLAGS &= ~TCA_SINGLE_CMP1_bm; /* Compare Channel-1 Interrupt: disabled */ -} - -bool TCA0_IsCMP1InterruptEnabled(void) -{ - return ((TCA0.SINGLE.INTFLAGS & TCA_SINGLE_CMP1_bm) > 0); -} - -void TCA0_ClearCMP2InterruptFlag(void) -{ - TCA0.SINGLE.INTFLAGS &= ~TCA_SINGLE_CMP2_bm; /* Compare Channel-2 Interrupt: disabled */ -} - -bool TCA0_IsCMP2InterruptEnabled(void) -{ - return ((TCA0.SINGLE.INTFLAGS & TCA_SINGLE_CMP2_bm) > 0); -} diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/ccp.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/ccp.h new file mode 100644 index 0000000..9045036 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/ccp.h @@ -0,0 +1,72 @@ +/** + * CCP Header File + * + * @file ccp.h + * + * @ingroup config_bitsdriver + * + * @brief This file contains the Configuration Change Protection (CCP) header file for the Configuration bits driver. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef CPU_CCP_H +#define CPU_CCP_H + +#include "../system/utils/compiler.h" +#include "../system/protected_io.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Writes to a CCP-protected 8-bit I/O register. + * @param addr Address of the I/O register. + * @param value Value to be written. + * NOTE: Using IAR Embedded workbench, the choice of memory model has an impact on calling convention. + * Memory model must be defined in the Assembler preprocessor directives to be visible to the preprocessor. + */ +static inline void ccp_write_io(void *addr, uint8_t value) +{ + protected_write_io(addr, CCP_IOREG_gc, value); +} + +/** + * @brief Writes to a CCP-protected 8-bit SPM register. + * @param addr Address of the SPM register. + * @param value Value to be written. + * NOTE: Using IAR Embedded workbench, the choice of memory model has an impacton calling convention. + * Memory model must be defined in the Assembler preprocessor directives to be visible to the preprocessor. + */ +static inline void ccp_write_spm(void *addr, uint8_t value) +{ + protected_write_io(addr, CCP_SPM_gc, value); +} + +#ifdef __cplusplus +} +#endif + +#endif /* CPU_CCP_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/clock.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/clock.h new file mode 100644 index 0000000..9f9d264 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/clock.h @@ -0,0 +1,51 @@ +/** + * CLKCTRL Generated Driver API Header File + * + * @file clkctrl.h + * + * @defgroup clkctrl CLKCTRL + * + * @brief This file contains the API prototype for the CLKCTRL driver. + * + * @version CLKCTRL Driver Version 1.0.0 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef CLOCK_CONFIG_H +#define CLOCK_CONFIG_H + +#ifndef F_CPU +#define F_CPU 24000000 +#endif + +#include "ccp.h" +/** + * @ingroup clkctrl + * @brief Initializes the Clock controller. + * @param None. + * @return None. + * + */ +void CLOCK_Initialize(void); + +#endif // CLOCK_CONFIG_H \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/config_bits.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/config_bits.h new file mode 100644 index 0000000..cd14867 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/config_bits.h @@ -0,0 +1,42 @@ +/** + * CONFIGURATION BITS Generated Driver Header File + * + * @file config_bits.h + * + * @defgroup config_bitsdriver Configuration Bits Driver + * + * @brief This file contains the generated header file for the Configuration bits driver. + * + * @version Driver Version 1.0.4 +*/ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef CONFIG_BITS_H +#define CONFIG_BITS_H + +#include "../system/clock.h" + +#endif //CONFIG_BITS_H +/** + End of File +*/ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/interrupt.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/interrupt.h new file mode 100644 index 0000000..2dc2f85 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/interrupt.h @@ -0,0 +1,57 @@ +/** + * Interrupt Manager Generated Driver API Header File. + * + * @file interrupt.h + * + * @defgroup interrupt INTERRUPT + * + * @brief This file contains the API prototype for the Interrupt Manager. + * + * @version Interrupt Manager Driver Version 1.0.0 +*/ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef INTERRUPT_H +#define INTERRUPT_H + +#include "../system/utils/compiler.h" +#include "ccp.h" +#include "../system/utils/atomic.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @ingroup interrupt + * @brief Initializes the Interrupt module. + * @retval 0 - Initialization is successful. + */ +int8_t CPUINT_Initialize(); + +#ifdef __cplusplus +} +#endif + +#endif /* INTERRUPT_H */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/pins.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/pins.h new file mode 100644 index 0000000..075ac3a --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/pins.h @@ -0,0 +1,328 @@ +/** + * Generated Pins header File + * + * @file pins.h + * + * @defgroup pinsdriver Pins Driver + * + * @brief This is generated driver header for pins. + * This header file provides APIs for all pins selected in the GUI. + * + * @version Driver Version 1.1.0 +*/ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef PINS_H_INCLUDED +#define PINS_H_INCLUDED + +#include +#include "./port.h" + +//get/set TCA0_WO0 aliases +#define TCA0_WO0_SetHigh() do { PORTA_OUTSET = 0x1; } while(0) +#define TCA0_WO0_SetLow() do { PORTA_OUTCLR = 0x1; } while(0) +#define TCA0_WO0_Toggle() do { PORTA_OUTTGL = 0x1; } while(0) +#define TCA0_WO0_GetValue() (VPORTA.IN & (0x1 << 0)) +#define TCA0_WO0_SetDigitalInput() do { PORTA_DIRCLR = 0x1; } while(0) +#define TCA0_WO0_SetDigitalOutput() do { PORTA_DIRSET = 0x1; } while(0) +#define TCA0_WO0_SetPullUp() do { PORTA_PIN0CTRL |= PORT_PULLUPEN_bm; } while(0) +#define TCA0_WO0_ResetPullUp() do { PORTA_PIN0CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define TCA0_WO0_SetInverted() do { PORTA_PIN0CTRL |= PORT_INVEN_bm; } while(0) +#define TCA0_WO0_ResetInverted() do { PORTA_PIN0CTRL &= ~PORT_INVEN_bm; } while(0) +#define TCA0_WO0_DisableInterruptOnChange() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define TCA0_WO0_EnableInterruptForBothEdges() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define TCA0_WO0_EnableInterruptForRisingEdge() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define TCA0_WO0_EnableInterruptForFallingEdge() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define TCA0_WO0_DisableDigitalInputBuffer() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define TCA0_WO0_EnableInterruptForLowLevelSensing() do { PORTA.PIN0CTRL = (PORTA.PIN0CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA0_SetInterruptHandler TCA0_WO0_SetInterruptHandler + +//get/set TCA0_WO2 aliases +#define TCA0_WO2_SetHigh() do { PORTA_OUTSET = 0x4; } while(0) +#define TCA0_WO2_SetLow() do { PORTA_OUTCLR = 0x4; } while(0) +#define TCA0_WO2_Toggle() do { PORTA_OUTTGL = 0x4; } while(0) +#define TCA0_WO2_GetValue() (VPORTA.IN & (0x1 << 2)) +#define TCA0_WO2_SetDigitalInput() do { PORTA_DIRCLR = 0x4; } while(0) +#define TCA0_WO2_SetDigitalOutput() do { PORTA_DIRSET = 0x4; } while(0) +#define TCA0_WO2_SetPullUp() do { PORTA_PIN2CTRL |= PORT_PULLUPEN_bm; } while(0) +#define TCA0_WO2_ResetPullUp() do { PORTA_PIN2CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define TCA0_WO2_SetInverted() do { PORTA_PIN2CTRL |= PORT_INVEN_bm; } while(0) +#define TCA0_WO2_ResetInverted() do { PORTA_PIN2CTRL &= ~PORT_INVEN_bm; } while(0) +#define TCA0_WO2_DisableInterruptOnChange() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define TCA0_WO2_EnableInterruptForBothEdges() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define TCA0_WO2_EnableInterruptForRisingEdge() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define TCA0_WO2_EnableInterruptForFallingEdge() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define TCA0_WO2_DisableDigitalInputBuffer() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define TCA0_WO2_EnableInterruptForLowLevelSensing() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA2_SetInterruptHandler TCA0_WO2_SetInterruptHandler + +//get/set LUT0_OUT aliases +#define LUT0_OUT_SetHigh() do { PORTA_OUTSET = 0x8; } while(0) +#define LUT0_OUT_SetLow() do { PORTA_OUTCLR = 0x8; } while(0) +#define LUT0_OUT_Toggle() do { PORTA_OUTTGL = 0x8; } while(0) +#define LUT0_OUT_GetValue() (VPORTA.IN & (0x1 << 3)) +#define LUT0_OUT_SetDigitalInput() do { PORTA_DIRCLR = 0x8; } while(0) +#define LUT0_OUT_SetDigitalOutput() do { PORTA_DIRSET = 0x8; } while(0) +#define LUT0_OUT_SetPullUp() do { PORTA_PIN3CTRL |= PORT_PULLUPEN_bm; } while(0) +#define LUT0_OUT_ResetPullUp() do { PORTA_PIN3CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define LUT0_OUT_SetInverted() do { PORTA_PIN3CTRL |= PORT_INVEN_bm; } while(0) +#define LUT0_OUT_ResetInverted() do { PORTA_PIN3CTRL &= ~PORT_INVEN_bm; } while(0) +#define LUT0_OUT_DisableInterruptOnChange() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define LUT0_OUT_EnableInterruptForBothEdges() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define LUT0_OUT_EnableInterruptForRisingEdge() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define LUT0_OUT_EnableInterruptForFallingEdge() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define LUT0_OUT_DisableDigitalInputBuffer() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define LUT0_OUT_EnableInterruptForLowLevelSensing() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA3_SetInterruptHandler LUT0_OUT_SetInterruptHandler + +//get/set SPI0_MISO aliases +#define SPI0_MISO_SetHigh() do { PORTA_OUTSET = 0x20; } while(0) +#define SPI0_MISO_SetLow() do { PORTA_OUTCLR = 0x20; } while(0) +#define SPI0_MISO_Toggle() do { PORTA_OUTTGL = 0x20; } while(0) +#define SPI0_MISO_GetValue() (VPORTA.IN & (0x1 << 5)) +#define SPI0_MISO_SetDigitalInput() do { PORTA_DIRCLR = 0x20; } while(0) +#define SPI0_MISO_SetDigitalOutput() do { PORTA_DIRSET = 0x20; } while(0) +#define SPI0_MISO_SetPullUp() do { PORTA_PIN5CTRL |= PORT_PULLUPEN_bm; } while(0) +#define SPI0_MISO_ResetPullUp() do { PORTA_PIN5CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define SPI0_MISO_SetInverted() do { PORTA_PIN5CTRL |= PORT_INVEN_bm; } while(0) +#define SPI0_MISO_ResetInverted() do { PORTA_PIN5CTRL &= ~PORT_INVEN_bm; } while(0) +#define SPI0_MISO_DisableInterruptOnChange() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define SPI0_MISO_EnableInterruptForBothEdges() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define SPI0_MISO_EnableInterruptForRisingEdge() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define SPI0_MISO_EnableInterruptForFallingEdge() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define SPI0_MISO_DisableDigitalInputBuffer() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define SPI0_MISO_EnableInterruptForLowLevelSensing() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA5_SetInterruptHandler SPI0_MISO_SetInterruptHandler + +//get/set SPI0_MOSI aliases +#define SPI0_MOSI_SetHigh() do { PORTA_OUTSET = 0x10; } while(0) +#define SPI0_MOSI_SetLow() do { PORTA_OUTCLR = 0x10; } while(0) +#define SPI0_MOSI_Toggle() do { PORTA_OUTTGL = 0x10; } while(0) +#define SPI0_MOSI_GetValue() (VPORTA.IN & (0x1 << 4)) +#define SPI0_MOSI_SetDigitalInput() do { PORTA_DIRCLR = 0x10; } while(0) +#define SPI0_MOSI_SetDigitalOutput() do { PORTA_DIRSET = 0x10; } while(0) +#define SPI0_MOSI_SetPullUp() do { PORTA_PIN4CTRL |= PORT_PULLUPEN_bm; } while(0) +#define SPI0_MOSI_ResetPullUp() do { PORTA_PIN4CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define SPI0_MOSI_SetInverted() do { PORTA_PIN4CTRL |= PORT_INVEN_bm; } while(0) +#define SPI0_MOSI_ResetInverted() do { PORTA_PIN4CTRL &= ~PORT_INVEN_bm; } while(0) +#define SPI0_MOSI_DisableInterruptOnChange() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define SPI0_MOSI_EnableInterruptForBothEdges() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define SPI0_MOSI_EnableInterruptForRisingEdge() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define SPI0_MOSI_EnableInterruptForFallingEdge() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define SPI0_MOSI_DisableDigitalInputBuffer() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define SPI0_MOSI_EnableInterruptForLowLevelSensing() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA4_SetInterruptHandler SPI0_MOSI_SetInterruptHandler + +//get/set SPI0_SCK aliases +#define SPI0_SCK_SetHigh() do { PORTA_OUTSET = 0x40; } while(0) +#define SPI0_SCK_SetLow() do { PORTA_OUTCLR = 0x40; } while(0) +#define SPI0_SCK_Toggle() do { PORTA_OUTTGL = 0x40; } while(0) +#define SPI0_SCK_GetValue() (VPORTA.IN & (0x1 << 6)) +#define SPI0_SCK_SetDigitalInput() do { PORTA_DIRCLR = 0x40; } while(0) +#define SPI0_SCK_SetDigitalOutput() do { PORTA_DIRSET = 0x40; } while(0) +#define SPI0_SCK_SetPullUp() do { PORTA_PIN6CTRL |= PORT_PULLUPEN_bm; } while(0) +#define SPI0_SCK_ResetPullUp() do { PORTA_PIN6CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define SPI0_SCK_SetInverted() do { PORTA_PIN6CTRL |= PORT_INVEN_bm; } while(0) +#define SPI0_SCK_ResetInverted() do { PORTA_PIN6CTRL &= ~PORT_INVEN_bm; } while(0) +#define SPI0_SCK_DisableInterruptOnChange() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define SPI0_SCK_EnableInterruptForBothEdges() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define SPI0_SCK_EnableInterruptForRisingEdge() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define SPI0_SCK_EnableInterruptForFallingEdge() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define SPI0_SCK_DisableDigitalInputBuffer() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define SPI0_SCK_EnableInterruptForLowLevelSensing() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA6_SetInterruptHandler SPI0_SCK_SetInterruptHandler + +//get/set SPI0_SS aliases +#define SPI0_SS_SetHigh() do { PORTA_OUTSET = 0x80; } while(0) +#define SPI0_SS_SetLow() do { PORTA_OUTCLR = 0x80; } while(0) +#define SPI0_SS_Toggle() do { PORTA_OUTTGL = 0x80; } while(0) +#define SPI0_SS_GetValue() (VPORTA.IN & (0x1 << 7)) +#define SPI0_SS_SetDigitalInput() do { PORTA_DIRCLR = 0x80; } while(0) +#define SPI0_SS_SetDigitalOutput() do { PORTA_DIRSET = 0x80; } while(0) +#define SPI0_SS_SetPullUp() do { PORTA_PIN7CTRL |= PORT_PULLUPEN_bm; } while(0) +#define SPI0_SS_ResetPullUp() do { PORTA_PIN7CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define SPI0_SS_SetInverted() do { PORTA_PIN7CTRL |= PORT_INVEN_bm; } while(0) +#define SPI0_SS_ResetInverted() do { PORTA_PIN7CTRL &= ~PORT_INVEN_bm; } while(0) +#define SPI0_SS_DisableInterruptOnChange() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define SPI0_SS_EnableInterruptForBothEdges() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define SPI0_SS_EnableInterruptForRisingEdge() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define SPI0_SS_EnableInterruptForFallingEdge() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define SPI0_SS_DisableDigitalInputBuffer() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define SPI0_SS_EnableInterruptForLowLevelSensing() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA7_SetInterruptHandler SPI0_SS_SetInterruptHandler + +/** + * @ingroup pinsdriver + * @brief GPIO and peripheral I/O initialization + * @param none + * @return none + */ +void PIN_MANAGER_Initialize(); + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for TCA0_WO0 pin. + * This is a predefined interrupt handler to be used together with the TCA0_WO0_SetInterruptHandler() method. + * This handler is called every time the TCA0_WO0 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void TCA0_WO0_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for TCA0_WO0 pin input-sense-config functionality. + * Allows selecting an interrupt handler for TCA0_WO0 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void TCA0_WO0_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for TCA0_WO2 pin. + * This is a predefined interrupt handler to be used together with the TCA0_WO2_SetInterruptHandler() method. + * This handler is called every time the TCA0_WO2 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void TCA0_WO2_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for TCA0_WO2 pin input-sense-config functionality. + * Allows selecting an interrupt handler for TCA0_WO2 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void TCA0_WO2_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for LUT0_OUT pin. + * This is a predefined interrupt handler to be used together with the LUT0_OUT_SetInterruptHandler() method. + * This handler is called every time the LUT0_OUT ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void LUT0_OUT_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for LUT0_OUT pin input-sense-config functionality. + * Allows selecting an interrupt handler for LUT0_OUT at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void LUT0_OUT_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for SPI0_MISO pin. + * This is a predefined interrupt handler to be used together with the SPI0_MISO_SetInterruptHandler() method. + * This handler is called every time the SPI0_MISO ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void SPI0_MISO_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for SPI0_MISO pin input-sense-config functionality. + * Allows selecting an interrupt handler for SPI0_MISO at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void SPI0_MISO_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for SPI0_MOSI pin. + * This is a predefined interrupt handler to be used together with the SPI0_MOSI_SetInterruptHandler() method. + * This handler is called every time the SPI0_MOSI ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void SPI0_MOSI_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for SPI0_MOSI pin input-sense-config functionality. + * Allows selecting an interrupt handler for SPI0_MOSI at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void SPI0_MOSI_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for SPI0_SCK pin. + * This is a predefined interrupt handler to be used together with the SPI0_SCK_SetInterruptHandler() method. + * This handler is called every time the SPI0_SCK ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void SPI0_SCK_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for SPI0_SCK pin input-sense-config functionality. + * Allows selecting an interrupt handler for SPI0_SCK at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void SPI0_SCK_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for SPI0_SS pin. + * This is a predefined interrupt handler to be used together with the SPI0_SS_SetInterruptHandler() method. + * This handler is called every time the SPI0_SS ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void SPI0_SS_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for SPI0_SS pin input-sense-config functionality. + * Allows selecting an interrupt handler for SPI0_SS at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void SPI0_SS_SetInterruptHandler(void (* interruptHandler)(void)) ; +#endif /* PINS_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/port.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/port.h new file mode 100644 index 0000000..541c6b2 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/port.h @@ -0,0 +1,1320 @@ +/** + * Generated Ports header File + * + * @file port.h + * + * @ingroup pinsdriver + * + * @brief This Source file provides APIs. + * + * @version Driver Version 1.0.1 +*/ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef PORT_INCLUDED +#define PORT_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include "utils/compiler.h" + +/* @ingroup pinsdriver + * @enum port_pull_mode + * Defines the pullup modes. + */ +enum port_pull_mode { + PORT_PULL_OFF, + PORT_PULL_UP, +}; + +/* @ingroup pinsdriver + * @enum port_dir + * Defines the port directions. + */ +enum port_dir { + PORT_DIR_IN, + PORT_DIR_OUT, + PORT_DIR_OFF, +}; + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTA_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTA + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTA_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTA + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTA_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTA + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTA_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTA.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTA.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTA + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTA_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTA.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTA.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTA + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTA_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTA.OUT |= mask; + } else { + VPORTA.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTA_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTA.OUT |= (1 << pin); + } else { + VPORTA.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTA_toggle_port_level(const uint8_t mask) +{ + PORTA.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTA_toggle_pin_level(const uint8_t pin) +{ + PORTA.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTA_get_port_level() +{ + return VPORTA.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTA_get_pin_level(const uint8_t pin) +{ + return VPORTA.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTA_write_port(const uint8_t value) +{ + VPORTA.OUT = value; +} + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTB_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTB + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTB_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTB + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTB_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTB + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTB_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTB.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTB.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTB + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTB_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTB.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTB.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTB + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTB_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTB.OUT |= mask; + } else { + VPORTB.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTB_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTB.OUT |= (1 << pin); + } else { + VPORTB.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTB_toggle_port_level(const uint8_t mask) +{ + PORTB.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTB_toggle_pin_level(const uint8_t pin) +{ + PORTB.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTB_get_port_level() +{ + return VPORTB.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTB_get_pin_level(const uint8_t pin) +{ + return VPORTB.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTB_write_port(const uint8_t value) +{ + VPORTB.OUT = value; +} + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTC_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTC + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTC_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTC + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTC_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTC + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTC_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTC.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTC.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTC + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTC_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTC.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTC.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTC + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTC_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTC.OUT |= mask; + } else { + VPORTC.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTC_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTC.OUT |= (1 << pin); + } else { + VPORTC.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTC_toggle_port_level(const uint8_t mask) +{ + PORTC.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTC_toggle_pin_level(const uint8_t pin) +{ + PORTC.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTC_get_port_level() +{ + return VPORTC.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTC_get_pin_level(const uint8_t pin) +{ + return VPORTC.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTC_write_port(const uint8_t value) +{ + VPORTC.OUT = value; +} + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTD_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTD + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTD_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTD + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTD_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTD + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTD_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTD.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTD.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTD + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTD_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTD.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTD.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTD + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTD_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTD.OUT |= mask; + } else { + VPORTD.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTD_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTD.OUT |= (1 << pin); + } else { + VPORTD.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTD_toggle_port_level(const uint8_t mask) +{ + PORTD.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTD_toggle_pin_level(const uint8_t pin) +{ + PORTD.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTD_get_port_level() +{ + return VPORTD.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTD_get_pin_level(const uint8_t pin) +{ + return VPORTD.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTD_write_port(const uint8_t value) +{ + VPORTD.OUT = value; +} + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTE_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTE + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTE_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTE + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTE_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTE + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTE_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTE.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTE.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTE + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTE_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTE.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTE.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTE + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTE_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTE.OUT |= mask; + } else { + VPORTE.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTE_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTE.OUT |= (1 << pin); + } else { + VPORTE.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTE_toggle_port_level(const uint8_t mask) +{ + PORTE.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTE_toggle_pin_level(const uint8_t pin) +{ + PORTE.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTE_get_port_level() +{ + return VPORTE.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTE_get_pin_level(const uint8_t pin) +{ + return VPORTE.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTE_write_port(const uint8_t value) +{ + VPORTE.OUT = value; +} + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTF_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTF + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTF_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTF + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTF_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTF + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTF_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTF.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTF.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTF + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTF_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTF.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTF.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTF + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTF_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTF.OUT |= mask; + } else { + VPORTF.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTF_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTF.OUT |= (1 << pin); + } else { + VPORTF.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTF_toggle_port_level(const uint8_t mask) +{ + PORTF.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTF_toggle_pin_level(const uint8_t pin) +{ + PORTF.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTF_get_port_level() +{ + return VPORTF.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTF_get_pin_level(const uint8_t pin) +{ + return VPORTF.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTF_write_port(const uint8_t value) +{ + VPORTF.OUT = value; +} +#ifdef __cplusplus +} +#endif + +#endif /* PORT_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/protected_io.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/protected_io.h new file mode 100644 index 0000000..586576b --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/protected_io.h @@ -0,0 +1,80 @@ +/** + * protected_io Header File + * + * @file protected_io.h + * + * @defgroup doc_driver_system_protected_io Protected IO + * + * @brief This file contains the generated prtected_io header file for the CONFIGURATION BITS. + * + * @version Driver Version 1.0.0 + * + *@{ +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef PROTECTED_IO_H +#define PROTECTED_IO_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(__DOXYGEN__) +//! \name IAR Memory Model defines. +//@{ + +/** + * @def CONFIG_MEMORY_MODEL_TINY + * @brief Configuration symbol to enable 8 bit pointers. + */ +#define CONFIG_MEMORY_MODEL_TINY + +/** + * @def CONFIG_MEMORY_MODEL_SMALL + * @brief Configuration symbol to enable 16 bit pointers. + * NOTE: If no memory model is defined, SMALL is default. + */ +#define CONFIG_MEMORY_MODEL_SMALL + +/** + * @def CONFIG_MEMORY_MODEL_LARGE + * @brief Configuration symbol to enable 24 bit pointers. + */ +#define CONFIG_MEMORY_MODEL_LARGE + +//@} +#endif + +/** + * @brief Writes to an 8-bit I/O register protected by CCP or a protection bit. + * @param addr Address of the I/O register. + * @param magic CCP magic value or Mask for protection bit. + * @param value Value to be written. + * NOTE: Using IAR Embedded workbench, the choice of memory model has an impact on calling convention. + * Memory model must be defined in the Assembler preprocessor directives to be visible to the preprocessor. + */ +extern void protected_write_io(void *addr, uint8_t magic, uint8_t value); + +/** @} */ + +#endif /* PROTECTED_IO_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/clock.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/clock.c new file mode 100644 index 0000000..467e9f7 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/clock.c @@ -0,0 +1,69 @@ +/** + * CLKCTRL Generated Driver File + * + * @file clkctrl.c + * + * @ingroup clkctrl + * + * @brief This file contains the API implementation for the CLKCTRL driver. + * + * @version CLKCTRL Driver Version 1.0.1 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#include "../clock.h" + +void CLOCK_Initialize(void) +{ + //CLKOUT disabled; CLKSEL Internal high-frequency oscillator; + ccp_write_io((void*)&(CLKCTRL.MCLKCTRLA),0x0); + + //PDIV 2X; PEN disabled; + ccp_write_io((void*)&(CLKCTRL.MCLKCTRLB),0x0); + + //LOCKEN disabled; + ccp_write_io((void*)&(CLKCTRL.MCLKLOCK),0x0); + + //EXTS disabled; OSCHFS disabled; OSC32KS disabled; PLLS disabled; SOSC disabled; XOSC32KS disabled; + ccp_write_io((void*)&(CLKCTRL.MCLKSTATUS),0x0); + + //AUTOTUNE disabled; FRQSEL 24 MHz system clock; RUNSTDBY disabled; + ccp_write_io((void*)&(CLKCTRL.OSCHFCTRLA),0x24); + + //TUNE 0x0; + ccp_write_io((void*)&(CLKCTRL.OSCHFTUNE),0x0); + + //RUNSTDBY disabled; + ccp_write_io((void*)&(CLKCTRL.OSC32KCTRLA),0x0); + + //MULFAC PLL is disabled; RUNSTDBY disabled; SOURCE disabled; + ccp_write_io((void*)&(CLKCTRL.PLLCTRLA),0x0); + + //CSUT 1k cycles; ENABLE disabled; LPMODE disabled; RUNSTDBY disabled; SEL disabled; + ccp_write_io((void*)&(CLKCTRL.XOSC32KCTRLA),0x0); + +} + +/** + End of File +*/ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/config_bits.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/config_bits.c new file mode 100644 index 0000000..2ca21ba --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/config_bits.c @@ -0,0 +1,47 @@ +/** + * CONFIGURATION BITS Generated Driver Source File + * + * @file config_bits.c + * + * @ingroup config_bitsdriver + * + * @brief This file contains the generated Device Configuration Bits file. + * + * @version Driver Version 1.0.4 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include + +/** + * Configures the Fuse bits. + */ +FUSES = +{ + .BODCFG = ACTIVE_DISABLE_gc | LVL_BODLEVEL0_gc | SAMPFREQ_128Hz_gc | SLEEP_DISABLE_gc, + .BOOTSIZE = 0x0, + .CODESIZE = 0x0, + .OSCCFG = CLKSEL_OSCHF_gc, + .SYSCFG0 = CRCSEL_CRC16_gc | CRCSRC_NOCRC_gc | RSTPINCFG_GPIO_gc, + .SYSCFG1 = SUT_0MS_gc, + .WDTCFG = PERIOD_OFF_gc | WINDOW_OFF_gc, +}; diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/interrupt.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/interrupt.c new file mode 100644 index 0000000..44577f9 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/interrupt.c @@ -0,0 +1,52 @@ +/** + * Interrupt Manager Generated Driver File. + * + * @file interrupt.c + * + * @ingroup interrupt + * + * @brief This file contains the API implementation for the Interrupt Manager. + * + * @version Interrupt Manager Driver Version 1.0.0 +*/ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#include "../interrupt.h" + +int8_t CPUINT_Initialize() +{ + /* IVSEL and CVT are Configuration Change Protected */ + + //CVT disabled; IVSEL disabled; LVL0RR disabled; + ccp_write_io((void*)&(CPUINT.CTRLA),0x0); + + //LVL0PRI 0; + CPUINT.LVL0PRI = 0x0; + + //LVL1VEC 0; + CPUINT.LVL1VEC = 0x0; + + + return 0; +} \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/pins.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/pins.c new file mode 100644 index 0000000..ac12219 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/pins.c @@ -0,0 +1,294 @@ +/** + * Generated Driver File + * + * @file pins.c + * + * @ingroup pinsdriver + * + * @brief This is generated driver implementation for pins. + * This file provides implementations for pin APIs for all pins selected in the GUI. + * + * @version Driver Version 1.1.0 +*/ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include "../pins.h" + +static void (*TCA0_WO0_InterruptHandler)(void); +static void (*TCA0_WO2_InterruptHandler)(void); +static void (*LUT0_OUT_InterruptHandler)(void); +static void (*SPI0_MISO_InterruptHandler)(void); +static void (*SPI0_MOSI_InterruptHandler)(void); +static void (*SPI0_SCK_InterruptHandler)(void); +static void (*SPI0_SS_InterruptHandler)(void); + +void PIN_MANAGER_Initialize() +{ + /* DIR Registers Initialization */ + PORTA.DIR = 0xDD; + PORTB.DIR = 0x0; + PORTC.DIR = 0x0; + PORTD.DIR = 0x0; + PORTE.DIR = 0x0; + PORTF.DIR = 0x0; + + /* OUT Registers Initialization */ + PORTA.OUT = 0x0; + PORTB.OUT = 0x0; + PORTC.OUT = 0x0; + PORTD.OUT = 0x0; + PORTE.OUT = 0x0; + PORTF.OUT = 0x0; + + /* PINxCTRL registers Initialization */ + PORTA.PIN0CTRL = 0x0; + PORTA.PIN1CTRL = 0x0; + PORTA.PIN2CTRL = 0x0; + PORTA.PIN3CTRL = 0x0; + PORTA.PIN4CTRL = 0x0; + PORTA.PIN5CTRL = 0x0; + PORTA.PIN6CTRL = 0x0; + PORTA.PIN7CTRL = 0x0; + PORTB.PIN0CTRL = 0x0; + PORTB.PIN1CTRL = 0x0; + PORTB.PIN2CTRL = 0x0; + PORTB.PIN3CTRL = 0x0; + PORTB.PIN4CTRL = 0x0; + PORTB.PIN5CTRL = 0x0; + PORTB.PIN6CTRL = 0x0; + PORTB.PIN7CTRL = 0x0; + PORTC.PIN0CTRL = 0x0; + PORTC.PIN1CTRL = 0x0; + PORTC.PIN2CTRL = 0x0; + PORTC.PIN3CTRL = 0x0; + PORTC.PIN4CTRL = 0x0; + PORTC.PIN5CTRL = 0x0; + PORTC.PIN6CTRL = 0x0; + PORTC.PIN7CTRL = 0x0; + PORTD.PIN0CTRL = 0x0; + PORTD.PIN1CTRL = 0x0; + PORTD.PIN2CTRL = 0x0; + PORTD.PIN3CTRL = 0x0; + PORTD.PIN4CTRL = 0x0; + PORTD.PIN5CTRL = 0x0; + PORTD.PIN6CTRL = 0x0; + PORTD.PIN7CTRL = 0x0; + PORTE.PIN0CTRL = 0x0; + PORTE.PIN1CTRL = 0x0; + PORTE.PIN2CTRL = 0x0; + PORTE.PIN3CTRL = 0x0; + PORTE.PIN4CTRL = 0x0; + PORTE.PIN5CTRL = 0x0; + PORTE.PIN6CTRL = 0x0; + PORTE.PIN7CTRL = 0x0; + PORTF.PIN0CTRL = 0x0; + PORTF.PIN1CTRL = 0x0; + PORTF.PIN2CTRL = 0x0; + PORTF.PIN3CTRL = 0x0; + PORTF.PIN4CTRL = 0x0; + PORTF.PIN5CTRL = 0x0; + PORTF.PIN6CTRL = 0x0; + PORTF.PIN7CTRL = 0x0; + + /* PORTMUX Initialization */ + PORTMUX.ACROUTEA = 0x0; + PORTMUX.CCLROUTEA = 0x0; + PORTMUX.EVSYSROUTEA = 0x0; + PORTMUX.SPIROUTEA = 0x0; + PORTMUX.TCAROUTEA = 0x0; + PORTMUX.TCBROUTEA = 0x0; + PORTMUX.TCDROUTEA = 0x0; + PORTMUX.TWIROUTEA = 0x0; + PORTMUX.USARTROUTEA = 0x0; + PORTMUX.USARTROUTEB = 0x0; + PORTMUX.ZCDROUTEA = 0x0; + + // register default ISC callback functions at runtime; use these methods to register a custom function + TCA0_WO0_SetInterruptHandler(TCA0_WO0_DefaultInterruptHandler); + TCA0_WO2_SetInterruptHandler(TCA0_WO2_DefaultInterruptHandler); + LUT0_OUT_SetInterruptHandler(LUT0_OUT_DefaultInterruptHandler); + SPI0_MISO_SetInterruptHandler(SPI0_MISO_DefaultInterruptHandler); + SPI0_MOSI_SetInterruptHandler(SPI0_MOSI_DefaultInterruptHandler); + SPI0_SCK_SetInterruptHandler(SPI0_SCK_DefaultInterruptHandler); + SPI0_SS_SetInterruptHandler(SPI0_SS_DefaultInterruptHandler); +} + +/** + Allows selecting an interrupt handler for TCA0_WO0 at application runtime +*/ +void TCA0_WO0_SetInterruptHandler(void (* interruptHandler)(void)) +{ + TCA0_WO0_InterruptHandler = interruptHandler; +} + +void TCA0_WO0_DefaultInterruptHandler(void) +{ + // add your TCA0_WO0 interrupt custom code + // or set custom function using TCA0_WO0_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for TCA0_WO2 at application runtime +*/ +void TCA0_WO2_SetInterruptHandler(void (* interruptHandler)(void)) +{ + TCA0_WO2_InterruptHandler = interruptHandler; +} + +void TCA0_WO2_DefaultInterruptHandler(void) +{ + // add your TCA0_WO2 interrupt custom code + // or set custom function using TCA0_WO2_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for LUT0_OUT at application runtime +*/ +void LUT0_OUT_SetInterruptHandler(void (* interruptHandler)(void)) +{ + LUT0_OUT_InterruptHandler = interruptHandler; +} + +void LUT0_OUT_DefaultInterruptHandler(void) +{ + // add your LUT0_OUT interrupt custom code + // or set custom function using LUT0_OUT_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for SPI0_MISO at application runtime +*/ +void SPI0_MISO_SetInterruptHandler(void (* interruptHandler)(void)) +{ + SPI0_MISO_InterruptHandler = interruptHandler; +} + +void SPI0_MISO_DefaultInterruptHandler(void) +{ + // add your SPI0_MISO interrupt custom code + // or set custom function using SPI0_MISO_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for SPI0_MOSI at application runtime +*/ +void SPI0_MOSI_SetInterruptHandler(void (* interruptHandler)(void)) +{ + SPI0_MOSI_InterruptHandler = interruptHandler; +} + +void SPI0_MOSI_DefaultInterruptHandler(void) +{ + // add your SPI0_MOSI interrupt custom code + // or set custom function using SPI0_MOSI_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for SPI0_SCK at application runtime +*/ +void SPI0_SCK_SetInterruptHandler(void (* interruptHandler)(void)) +{ + SPI0_SCK_InterruptHandler = interruptHandler; +} + +void SPI0_SCK_DefaultInterruptHandler(void) +{ + // add your SPI0_SCK interrupt custom code + // or set custom function using SPI0_SCK_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for SPI0_SS at application runtime +*/ +void SPI0_SS_SetInterruptHandler(void (* interruptHandler)(void)) +{ + SPI0_SS_InterruptHandler = interruptHandler; +} + +void SPI0_SS_DefaultInterruptHandler(void) +{ + // add your SPI0_SS interrupt custom code + // or set custom function using SPI0_SS_SetInterruptHandler() +} +ISR(PORTA_PORT_vect) +{ + // Call the interrupt handler for the callback registered at runtime + if(VPORTA.INTFLAGS & PORT_INT0_bm) + { + TCA0_WO0_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT2_bm) + { + TCA0_WO2_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT3_bm) + { + LUT0_OUT_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT5_bm) + { + SPI0_MISO_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT4_bm) + { + SPI0_MOSI_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT6_bm) + { + SPI0_SCK_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT7_bm) + { + SPI0_SS_InterruptHandler(); + } + /* Clear interrupt flags */ + VPORTA.INTFLAGS = 0xff; +} + +ISR(PORTB_PORT_vect) +{ + /* Clear interrupt flags */ + VPORTB.INTFLAGS = 0xff; +} + +ISR(PORTC_PORT_vect) +{ + /* Clear interrupt flags */ + VPORTC.INTFLAGS = 0xff; +} + +ISR(PORTD_PORT_vect) +{ + /* Clear interrupt flags */ + VPORTD.INTFLAGS = 0xff; +} + +ISR(PORTE_PORT_vect) +{ + /* Clear interrupt flags */ + VPORTE.INTFLAGS = 0xff; +} + +ISR(PORTF_PORT_vect) +{ + /* Clear interrupt flags */ + VPORTF.INTFLAGS = 0xff; +} + +/** + End of File +*/ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/protected_io.S b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/protected_io.S similarity index 62% rename from avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/protected_io.S rename to avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/protected_io.S index b93dd68..fa51ec8 100644 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/src/protected_io.S +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/protected_io.S @@ -1,33 +1,33 @@ /** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 + * protected_io Source Code File + * + * @file protected_io.S + * + * @ingroup config_bitsdriver + * + * @brief This file contains the generated protected_io source code file for the CONFIGURATION BITS. + * + * @version Driver Version 1.0.0 */ /* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/system.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/system.c new file mode 100644 index 0000000..501caba --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/src/system.c @@ -0,0 +1,46 @@ +/** + * System Driver Source File + * + * @file system.c + * + * @ingroup systemdriver + * + * @brief This file contains the API implementation for the System driver. + * + * @version Driver Version 1.0.1 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include "../system.h" + + +void SYSTEM_Initialize(void) +{ + CLOCK_Initialize(); + PIN_MANAGER_Initialize(); + CCL_Initialize(); + EVSYS_Initialize(); + SPI0_Initialize(); + TCA0_Initialize(); + CPUINT_Initialize(); +} + diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/system.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/system.h new file mode 100644 index 0000000..3aa90dc --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/system.h @@ -0,0 +1,64 @@ +/** + * System Driver Header File + * + * @file system.h + * + * @defgroup systemdriver System Driver + * + * @brief This file contains the API prototypes for the System driver. + * + * @version Driver Version 1.0.1 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef MCC_H +#define MCC_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "../system/utils/compiler.h" +#include "config_bits.h" +#include "../system/clock.h" +#include "../system/pins.h" +#include "../ccl/ccl.h" +#include "../evsys/evsys.h" +#include "../spi/spi0.h" +#include "../timer/tca0.h" +#include "../system/interrupt.h" +/** + * @ingroup systemdriver + * @brief Initializes the system module. This routine must be called only once during the system initialization and before any other routine is called. + * @param None. + * @return None. +*/ +void SYSTEM_Initialize(void); + +#ifdef __cplusplus +} +#endif +#endif /* MCC_H */ +/** + End of File +*/ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/assembler.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/assembler.h new file mode 100644 index 0000000..2ce5066 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/assembler.h @@ -0,0 +1,49 @@ +/** + * Assembler Header File + * + * @file assembler.h + * + * @ingroup config_bitsdriver + * + * @brief This file contains the assembler header file for the configuration bits driver. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef ASSEMBLER_H_INCLUDED +#define ASSEMBLER_H_INCLUDED + +#if !defined(__ASSEMBLER__) && !defined(__IAR_SYSTEMS_ASM__) && !defined(__DOXYGEN__) +#error This file may only be included from assembly files +#endif + +#if defined(__ASSEMBLER__) +#include "assembler/gas.h" +#include +#elif defined(__IAR_SYSTEMS_ASM__) +#include "assembler/iar.h" +#include +#endif + +#endif /* ASSEMBLER_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/assembler/gas.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/assembler/gas.h similarity index 67% rename from avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/assembler/gas.h rename to avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/assembler/gas.h index a164306..fc78ad7 100644 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/assembler/gas.h +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/assembler/gas.h @@ -1,33 +1,33 @@ /** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 + * GAS Header File + * + * @file gas.h + * + * @ingroup config_bitsdriver + * + * @brief This file contains the generated GAS header file for the Configuration bits driver. + * + * @version Driver Version 1.0.0 */ /* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. */ @@ -50,7 +50,11 @@ .if \is_public .global \name .endif + #ifdef __XC8 + .section .text.\name, code + #else .section .text.\name, "ax", @progbits + #endif .type \name, @function \name : .endm diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/assembler/iar.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/assembler/iar.h similarity index 61% rename from avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/assembler/iar.h rename to avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/assembler/iar.h index 69650d6..d4ba634 100644 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/assembler/iar.h +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/assembler/iar.h @@ -1,33 +1,33 @@ /** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 + * IAR Header File + * + * @file iar.h + * + * @ingroup config_bitsdriver + * + * @brief This file contains the generated IAR header file for the Configuration bits driver. + * + * @version Driver Version 1.0.0 */ /* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/atomic.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/atomic.h new file mode 100644 index 0000000..c298b95 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/atomic.h @@ -0,0 +1,87 @@ +/** + * CONFIGURATION BITS Generated Atomic Header File + * + * @file atomic.h + * + * @defgroup doc_driver_utils_atomic Atomic memory access and critical sections + * + * @brief This file contains the atomic memory access and critical sections header file for the configuration bits driver. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef ATOMIC_H +#define ATOMIC_H + +/* clang-format off */ + +#if defined(__GNUC__) || defined (__DOXYGEN__) + +/** + * @brief Enters critical region. Saves the contents of the status register, including the Global Interrupt Enable bit, so that it can be restored upon leaving the critical region. + * Thereafter, clears the Global Interrupt Enable Bit.This macro takes a parameter P that is unused for the GCC compiler,but necessary for code compatibility with the IAR compiler. + * The IAR compiler declares a variable with the name of the parameter forholding the SREG value. + * Compilation will fail when the variable declared in the macro is not unique within the scope that the critical region is declared within. + * @param[in] UNUSED(GCC)/P(IAR) Name of variable storing SREG. + */ + +#define ENTER_CRITICAL(UNUSED) __asm__ __volatile__ ( \ + "in __tmp_reg__, __SREG__" "\n\t" \ + "cli" "\n\t" \ + "push __tmp_reg__" "\n\t" \ + ::: "memory" \ + ) + +/** + * @brief Exits a critical region. Restores the contents of the status register, including the Global Interrupt Enable bit, as it was when entering the critical region. + * This macro takes a parameter P that is unused for the GCC compiler, but necessary for code compatibility with the IAR compiler. + * The IAR compiler uses this parameter as the name of a variable that holds the SREG value. + * The parameter must be identical to the parameter used in the corresponding ENTER_CRITICAL(). + * @param[in] UNUSED(GCC)/P(IAR) Name of variable storing SREG + */ + +#define EXIT_CRITICAL(UNUSED) __asm__ __volatile__ ( \ + "pop __tmp_reg__" "\n\t" \ + "out __SREG__, __tmp_reg__" "\n\t" \ + ::: "memory" \ + ) + +#define DISABLE_INTERRUPTS() __asm__ __volatile__ ( "cli" ::: "memory") +#define ENABLE_INTERRUPTS() __asm__ __volatile__ ( "sei" ::: "memory") + +#elif defined(__ICCAVR__) + +#define ENTER_CRITICAL(P) unsigned char P = __save_interrupt();__disable_interrupt(); +#define EXIT_CRITICAL(P) __restore_interrupt(P); + +#define DISABLE_INTERRUPTS() __disable_interrupt(); +#define ENABLE_INTERRUPTS() __enable_interrupt(); + +#else +# error Unsupported compiler. +#endif + +/* clang-format on */ + +#endif /* ATOMIC_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/compiler.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/compiler.h new file mode 100644 index 0000000..fba02a0 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/compiler.h @@ -0,0 +1,72 @@ +/** + * Compiler Header File + * + * @file compiler.h + * + * @defgroup doc_driver_utils_compiler Compiler abstraction + * + * @brief This file contains the compiler abstraction layer and code utilities for 8-bit AVR. This module provides various abstraction layers and utilities to make code compatible between different compilers. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef UTILS_COMPILER_H +#define UTILS_COMPILER_H + +#if defined(__GNUC__) +#include +#include +#if defined(__XC8__) +#include +#endif +#elif defined(__ICCAVR__) +#define ENABLE_BIT_DEFINITIONS 1 +#include +#include + +#ifndef CCP_IOREG_gc +#define CCP_IOREG_gc 0xD8 /* CPU_CCP_IOREG_gc */ +#endif +#ifndef CCP_SPM_gc +#define CCP_SPM_gc 0x9D /* CPU_CCP_SPM_gc */ +#endif + +#else +#error Unsupported compiler. +#endif + +#include +#include +#include +#include + +#include "interrupt_avr8.h" + +/** + * @def UNUSED + * @brief Marking \a v as a unused parameter or value. + */ +#define UNUSED(v) (void)(v) + +#endif /* UTILS_COMPILER_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/interrupt_avr8.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/interrupt_avr8.h new file mode 100644 index 0000000..83b3c62 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/interrupt_avr8.h @@ -0,0 +1,88 @@ +/** + * interrupt_avr8 Header File + * + * @file interrupt_avr8.h + * + * @defgroup doc_driver_utils_interrupts ISR abstraction + * + * @brief Interrupt-related functionality. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef UTILS_INTERRUPT_AVR8_H +#define UTILS_INTERRUPT_AVR8_H + +/** + * \weakgroup interrupt_group + * + * @{ + */ + +#ifdef ISR_CUSTOM_H +#include ISR_CUSTOM_H +#else + +/** + * @def ISR + * @brief Define service routine for specified interrupt vector. + * @code + ISR(FOO_vect) + { + ... + } + * @endcode + * + * @param vect Interrupt vector name as found in the device header files. + */ +#if defined(__DOXYGEN__) +#define ISR(vect) +#elif defined(__GNUC__) +#include +#elif defined(__ICCAVR__) +#define __ISR(x) _Pragma(#x) +#define ISR(vect) __ISR(vector = vect) __interrupt void handler_##vect(void) +#endif +#endif // ISR_CUSTOM_H + +#ifdef __GNUC__ +#define cpu_irq_enable() sei() +#define cpu_irq_disable() cli() +#else +#define cpu_irq_enable() __enable_interrupt() +#define cpu_irq_disable() __disable_interrupt() +#endif + +//! @} + +/** + * \weakgroup interrupt_deprecated_group + * @{ + */ +// Deprecated definitions. +#define Enable_global_interrupt() cpu_irq_enable() +#define Disable_global_interrupt() cpu_irq_disable() +#define Is_global_interrupt_enabled() cpu_irq_is_enabled() +//! @} + +#endif /* UTILS_INTERRUPT_AVR8_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/utils.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/utils.h new file mode 100644 index 0000000..eaf3b81 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/utils.h @@ -0,0 +1,52 @@ +/** + * utils Header File + * + * @file system.h + * + * @defgroup doc_driver_utils AVR Code utility functions + * + * @brief This file contains the compiler abstraction layer and code utilities for AVR.This module provides various abstraction layers and utilities to make code compatible between different compilers. + * + * @version Driver Version 1.0.1 + * \{ + * +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef UTILS_H_INCLUDED +#define UTILS_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Retrieve array size + */ +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif /* UTILS_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/utils_assert.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/utils_assert.h new file mode 100644 index 0000000..a278db5 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/system/utils/utils_assert.h @@ -0,0 +1,60 @@ +/** + * utils_assert Header File + * + * @file utils_assert.h + * + * @defgroup doc_driver_utils_assert Functionality for assert + * + * @brief This file contains the generated utils_assert header file for the configuration bits driver. + * + * @version Driver Version 1.0.1 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef _ASSERT_H_INCLUDED +#define _ASSERT_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** + * @brief Assert macro + * Macro used to throw asserts. It can be mapped to different function based on debug level. + * @param[in] condition A condition to be checked; assert is thrown if the given condition is false. + */ + +#ifdef DEBUG +#define ASSERT(condition) \ + if (!(condition)) \ + while (true) \ + ; +#else +#define ASSERT(condition) ((void)0) +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _ASSERT_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/timer/src/tca0.c b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/timer/src/tca0.c new file mode 100644 index 0000000..9ada959 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/timer/src/tca0.c @@ -0,0 +1,259 @@ +/** + * TCA0 Generated Driver File + * + * @file tca0.c + * + * @ingroup tca0_normal + * + * @brief This file contains the API implementations for TCA0 module driver in Normal (16-bit) mode. + * + * @version TCA0 Driver Version 2.1.1 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#include "../tca0.h" + +const struct TMR_INTERFACE TCA0_Interface = { + .Initialize = TCA0_Initialize, + .Start = TCA0_Start, + .Stop = TCA0_Stop, + .PeriodCountSet = TCA0_Write, + .TimeoutCallbackRegister = TCA0_OverflowCallbackRegister, + .Tasks = NULL +}; + +void TCA0_DefaultCompare0CallbackRegister(void); +void (*TCA0_CMP0_isr_cb)(void) = &TCA0_DefaultCompare0CallbackRegister; +void TCA0_DefaultCompare1CallbackRegister(void); +void (*TCA0_CMP1_isr_cb)(void) = &TCA0_DefaultCompare1CallbackRegister; +void TCA0_DefaultCompare2CallbackRegister(void); +void (*TCA0_CMP2_isr_cb)(void) = &TCA0_DefaultCompare2CallbackRegister; +void TCA0_DefaultOverflowCallbackRegister(void); +void (*TCA0_OVF_isr_cb)(void) = &TCA0_DefaultOverflowCallbackRegister; + +void TCA0_DefaultCompare0CallbackRegister(void) +{ + //Add your ISR code here +} + +void TCA0_DefaultCompare1CallbackRegister(void) +{ + //Add your ISR code here +} + +void TCA0_DefaultCompare2CallbackRegister(void) +{ + //Add your ISR code here +} + +void TCA0_DefaultOverflowCallbackRegister(void) +{ + //Add your ISR code here +} + +void TCA0_OverflowCallbackRegister(TCA0_cb_t cb) +{ + TCA0_OVF_isr_cb = cb; +} + +void TCA0_Compare0CallbackRegister(TCA0_cb_t cb) +{ + TCA0_CMP0_isr_cb = cb; +} + +void TCA0_Compare1CallbackRegister(TCA0_cb_t cb) +{ + TCA0_CMP1_isr_cb = cb; +} + +void TCA0_Compare2CallbackRegister(TCA0_cb_t cb) +{ + TCA0_CMP2_isr_cb = cb; +} + +ISR(TCA0_CMP0_vect) +{ + if (TCA0_CMP0_isr_cb != NULL) + (*TCA0_CMP0_isr_cb)(); + + TCA0.SINGLE.INTFLAGS = TCA_SINGLE_CMP0_bm; +} + +ISR(TCA0_CMP1_vect) +{ + if (TCA0_CMP1_isr_cb != NULL) + (*TCA0_CMP1_isr_cb)(); + + TCA0.SINGLE.INTFLAGS = TCA_SINGLE_CMP1_bm; +} + +ISR(TCA0_CMP2_vect) +{ + if (TCA0_CMP2_isr_cb != NULL) + (*TCA0_CMP2_isr_cb)(); + + TCA0.SINGLE.INTFLAGS = TCA_SINGLE_CMP2_bm; +} + +ISR(TCA0_OVF_vect) +{ + if (TCA0_OVF_isr_cb != NULL) + (*TCA0_OVF_isr_cb)(); + + TCA0.SINGLE.INTFLAGS = TCA_SINGLE_OVF_bm; +} + + +void TCA0_Initialize(void) { + // Compare 0 + TCA0.SINGLE.CMP0 = 0xA; + + // Compare 1 + TCA0.SINGLE.CMP1 = 0x0; + + // Compare 2 + TCA0.SINGLE.CMP2 = 0x11; + + // Count + TCA0.SINGLE.CNT = 0x0; + + // ALUPD disabled; CMP0EN enabled; CMP1EN disabled; CMP2EN enabled; WGMODE SINGLESLOPE; + TCA0.SINGLE.CTRLB = 0x53; + + // CMP0OV disabled; CMP1OV disabled; CMP2OV disabled; + TCA0.SINGLE.CTRLC = 0x0; + + // SPLITM disabled; + TCA0.SINGLE.CTRLD = 0x0; + + // CMD NONE; DIR disabled; LUPD disabled; + TCA0.SINGLE.CTRLECLR = 0x0; + + // CMD NONE; DIR UP; LUPD disabled; + TCA0.SINGLE.CTRLESET = 0x0; + + // CMP0BV disabled; CMP1BV disabled; CMP2BV disabled; PERBV disabled; + TCA0.SINGLE.CTRLFCLR = 0x0; + + // CMP0BV disabled; CMP1BV disabled; CMP2BV disabled; PERBV disabled; + TCA0.SINGLE.CTRLFSET = 0x0; + + // DBGRUN disabled; + TCA0.SINGLE.DBGCTRL = 0x0; + + // CNTAEI disabled; CNTBEI enabled; EVACTA CNT_POSEDGE; EVACTB RESTART_POSEDGE; + TCA0.SINGLE.EVCTRL = 0x90; + + // CMP0 disabled; CMP1 disabled; CMP2 disabled; OVF disabled; + TCA0.SINGLE.INTCTRL = 0x0; + + // CMP0 disabled; CMP1 disabled; CMP2 disabled; OVF disabled; + TCA0.SINGLE.INTFLAGS = 0x0; + + // Period + TCA0.SINGLE.PER = 0x95F; + + // Temporary data for 16-bit Access + TCA0.SINGLE.TEMP = 0x0; + + // CLKSEL DIV1; ENABLE enabled; RUNSTDBY disabled; + TCA0.SINGLE.CTRLA = 0x1; + +} + +void TCA0_Start(void) +{ + TCA0.SINGLE.CTRLA|= TCA_SINGLE_ENABLE_bm; +} + +void TCA0_Stop(void) +{ + TCA0.SINGLE.CTRLA&= ~TCA_SINGLE_ENABLE_bm; +} + +void TCA0_Write(uint16_t timerVal) +{ + TCA0.SINGLE.PER=timerVal; +} + +uint16_t TCA0_Read(void) +{ + uint16_t readVal; + + readVal = TCA0.SINGLE.CNT; + + return readVal; +} + +void TCA0_EnableInterrupt(void) +{ + TCA0.SINGLE.INTCTRL = 1 << TCA_SINGLE_CMP0_bp /* Compare 0 Interrupt: enabled */ + | 1 << TCA_SINGLE_CMP1_bp /* Compare 1 Interrupt: enabled */ + | 1 << TCA_SINGLE_CMP2_bp /* Compare 2 Interrupt: enabled */ + | 1 << TCA_SINGLE_OVF_bp; /* Overflow Interrupt: enabled */ +} +void TCA0_DisableInterrupt(void) +{ + TCA0.SINGLE.INTCTRL = 0 << TCA_SINGLE_CMP0_bp /* Compare 0 Interrupt: disabled */ + | 0 << TCA_SINGLE_CMP1_bp /* Compare 1 Interrupt: disabled */ + | 0 << TCA_SINGLE_CMP2_bp /* Compare 2 Interrupt: disabled */ + | 0 << TCA_SINGLE_OVF_bp; /* Overflow Interrupt: disabled */ +} +void TCA0_ClearOverflowInterruptFlag(void) +{ + TCA0.SINGLE.INTFLAGS = TCA_SINGLE_OVF_bm; /* Clear Overflow Interrupt Flag */ +} +bool TCA0_IsOverflowInterruptFlagSet(void) +{ + return ((TCA0.SINGLE.INTFLAGS & TCA_SINGLE_OVF_bm) > 0); +} + +void TCA0_ClearCMP0InterruptFlag(void) +{ + TCA0.SINGLE.INTFLAGS = TCA_SINGLE_CMP0_bm; /* Clear Compare Channel-0 Interrupt Flag */ +} + +bool TCA0_IsCMP0InterruptFlagSet(void) +{ + return ((TCA0.SINGLE.INTFLAGS & TCA_SINGLE_CMP0_bm) > 0); +} + +void TCA0_ClearCMP1InterruptFlag(void) +{ + TCA0.SINGLE.INTFLAGS = TCA_SINGLE_CMP1_bm; /* Clear Compare Channel-1 Interrupt Flag */ +} + +bool TCA0_IsCMP1InterruptFlagSet(void) +{ + return ((TCA0.SINGLE.INTFLAGS & TCA_SINGLE_CMP1_bm) > 0); +} + +void TCA0_ClearCMP2InterruptFlag(void) +{ + TCA0.SINGLE.INTFLAGS = TCA_SINGLE_CMP2_bm; /* Clear Compare Channel-2 Interrupt Flag */ +} + +bool TCA0_IsCMP2InterruptFlagSet(void) +{ + return ((TCA0.SINGLE.INTFLAGS & TCA_SINGLE_CMP2_bm) > 0); +} \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/timer/tca0.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/timer/tca0.h new file mode 100644 index 0000000..44c4c0e --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/timer/tca0.h @@ -0,0 +1,199 @@ +/** + * TCA0 Generated Driver API Header File + * + * @file tca0.h + * + * @defgroup tca0_normal TCA0 in Normal Mode + * + * @brief This file contains the API prototypes for the TCA0 driver in Normal (16-bit) mode. + * + * @version TCA0 Driver Version 2.1.1 +*/ +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef TCA0_H_INCLUDED +#define TCA0_H_INCLUDED + +#include +#include +#include "../system/system.h" +#include "timer_interface.h" +#include "../system/utils/compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @ingroup tca0_normal + * @typedef void TCA0_cb_t + * @brief Function pointer to the callback function called by TCA when operating in Normal mode. The default value is set to NULL which means that no callback function will be used. + */ +typedef void (*TCA0_cb_t)(void); + +extern const struct TMR_INTERFACE TCA0_Interface; + +/** + * @ingroup tca0_normal + * @brief Initializes the TCA. + * @param None. + * @return None. + */ +void TCA0_Initialize(void); +/** + * @ingroup tca0_normal + * @brief Starts the 16-bit timer/counter for the TCA. + * @param None. + * @return None. + */ +void TCA0_Start(void); +/** + * @ingroup tca0_normal + * @brief Stops the 16-bit timer/counter for the TCA. + * @param None. + * @return None. + */ +void TCA0_Stop(void); +/** + * @ingroup tca0_normal + * @brief Interrupt Service Routine (ISR) callback function register to be called if the Overflow Interrupt flag is set. + * @param TCA0_cb_t cb - Callback function for Overflow event. + * @return None. + */ +void TCA0_OverflowCallbackRegister(TCA0_cb_t cb); +/** + * @ingroup tca0_normal + * @brief ISR callback function to be called if the Compare 0 Match Interrupt flag is set. + * @param TCA0_cb_t cb - Callback function for Compare 0 match event. + * @return None. + */ +void TCA0_Compare0CallbackRegister(TCA0_cb_t cb); +/** + * @ingroup tca0_normal + * @brief ISR callback function to be called if the Compare 1 Match Interrupt flag is set. + * @param TCA0_cb_t cb - Callback function for Compare 1 match event. + * @return None. + */ +void TCA0_Compare1CallbackRegister(TCA0_cb_t cb); +/** + * @ingroup tca0_normal + * @brief ISR callback function to be called if the Compare 2 Match Interrupt flag is set. + * @param TCA0_cb_t cb - Callback function for Compare 2 match event. + * @return None. + */ +void TCA0_Compare2CallbackRegister(TCA0_cb_t cb); +/** + * @ingroup tca0_normal + * @brief Enables the 16-bit timer/counter interrupt for the TCA. + * @param None. + * @return None. + */ +void TCA0_EnableInterrupt(void); +/** + * @ingroup tca0_normal + * @brief Disables the 16-bit timer/counter interrupt for the TCA. + * @param None. + * @return None. + */ +void TCA0_DisableInterrupt(void); +/** + * @ingroup tca0_normal + * @brief Reads the 16-bit timer/counter value for the TCA. + * @param None. + * @return uint16_t - timer/counter value returns from the TCA0. + */ +uint16_t TCA0_Read(void); +/** + * @ingroup tca0_normal + * @brief Writes the timer value to load to the TCA. + * @param uint16_t timerVal - Loading the timer value for the TCA. + * @return None. + */ +void TCA0_Write(uint16_t timerVal); +/** + * @ingroup tca0_normal + * @brief Clears the Overflow Interrupt flag after the Overflow flag set. + * @param None. + * @return None. + */ +void TCA0_ClearOverflowInterruptFlag(void); +/** + * @ingroup tca0_normal + * @brief Checks the Overflow Interrupt flag status for the TCA. + * @param None. + * @retval True - Overflow Interrupt flag is set. + * @retval False - Overflow Interrupt flag is not set. + */ +bool TCA0_IsOverflowInterruptFlagSet(void); +/** + * @ingroup tca0_normal + * @brief Clears the Compare 0 Interrupt flag after the Compare 0 flag is set. + * @param None. + * @return None. + */ +void TCA0_ClearCMP0InterruptFlag(void); +/** + * @ingroup tca0_normal + * @brief Checks the Compare 0 Interrupt flag status for the TCA. + * @param None. + * @retval True - Compare 0 Interrupt flag is set. + * @retval False - Compare 0 Interrupt flag is not set. + */ +bool TCA0_IsCMP0InterruptFlagSet(void); +/** + * @ingroup tca0_normal + * @brief Clears the Compare 1 Interrupt flag after the Compare 1 flag is set. + * @param None. + * @return None. + */ +void TCA0_ClearCMP1InterruptFlag(void); +/** + * @ingroup tca0_normal + * @brief Checks the Compare 1 Interrupt flag status for the TCA. + * @param None. + * @retval True - Compare 1 Interrupt flag is set. + * @retval False - Compare 1 Interrupt flag is not set. + */ +bool TCA0_IsCMP1InterruptFlagSet(void); +/** + * @ingroup tca0_normal + * @brief Clears the Compare 2 Interrupt flag after the Compare 2 flag is set. + * @param None. + * @return None. + */ +void TCA0_ClearCMP2InterruptFlag(void); + +/** + * @ingroup tca0_normal + * @brief Checks the Compare 2 Interrupt flag status for the TCA. + * @param None. + * @retval True - Compare 2 Interrupt flag is set. + * @retval False - Compare 2 Interrupt flag is not set. + */ +bool TCA0_IsCMP2InterruptFlagSet(void); + +#ifdef __cplusplus +} +#endif + +#endif /* TCA0_H_INCLUDED */ \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/timer/timer_interface.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/timer/timer_interface.h new file mode 100644 index 0000000..a5fb6d3 --- /dev/null +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/timer/timer_interface.h @@ -0,0 +1,69 @@ +/** + @Company + Microchip Technology Inc. + + @File Name + TMR_interface.h + + @Summary + This is the generated header file for Timer module interfaces. + + @Description + This header file provides interfaces to Timer driver APIs. + Generation Information : + Driver Version : 1.00 + The generated drivers are tested against the following: + MPLAB : MPLAB X v5.40 +*/ + +/* +© [2023] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, + INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY + KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S + TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef TMR_INTERFACE_H +#define TMR_INTERFACE_H + +/** + * @brief This file contains API prototypes and other datatypes for Timer-0 module. + * @defgroup timer_interface Timer Interface + * @{ + */ + +#include + +/** + @ingroup timer_interface + @typedef struct TMR_INTERFACE + @brief This structure contains the interfaces to Timer module + */ + +struct TMR_INTERFACE +{ + void (*Initialize)(void); + void (*Start)(void); + void (*Stop)(void); + void (*PeriodCountSet)(size_t count); + void (*TimeoutCallbackRegister)(void (* CallbackHandler)(void)); + void (*Tasks)(void); +}; +/** + * @} + */ +#endif //TMR_INTERFACE_H \ No newline at end of file diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/assembler.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/assembler.h deleted file mode 100644 index 65829ed..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/assembler.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef ASSEMBLER_H_INCLUDED -#define ASSEMBLER_H_INCLUDED - -#if !defined(__ASSEMBLER__) && !defined(__IAR_SYSTEMS_ASM__) && !defined(__DOXYGEN__) -#error This file may only be included from assembly files -#endif - -#if defined(__ASSEMBLER__) -#include "assembler/gas.h" -#include -#elif defined(__IAR_SYSTEMS_ASM__) -#include "assembler/iar.h" -#include -#endif - -#endif /* ASSEMBLER_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/atomic.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/atomic.h deleted file mode 100644 index 7b99064..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/atomic.h +++ /dev/null @@ -1,113 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef ATOMIC_H -#define ATOMIC_H - -/** - * \defgroup doc_driver_utils_atomic Atomic memory access and critical sections - * \ingroup doc_driver_utils - * - * Atomic memory access and critical sections - * - * \{ - */ - -/* clang-format off */ - -#if defined(__GNUC__) || defined (__DOXYGEN__) - -/** - * \brief Enter a critical region - * - * Saves the contents of the status register, including the Global - * Interrupt Enable bit, so that it can be restored upon leaving the - * critical region. Thereafter, clears the Global Interrupt Enable Bit. - * This macro takes a parameter P that is unused for the GCC compiler, - * but necessary for code compatibility with the IAR compiler. The IAR - * compiler declares a variable with the name of the parameter for - * holding the SREG value. Since a variable is declared in the macro, - * this variable must have a name that is unique within the scope - * that the critical region is declared within, otherwise compilation - * will fail. - * - * \param[in] UNUSED(GCC)/P(IAR) Name of variable storing SREG - * - */ - -#define ENTER_CRITICAL(UNUSED) __asm__ __volatile__ ( \ - "in __tmp_reg__, __SREG__" "\n\t" \ - "cli" "\n\t" \ - "push __tmp_reg__" "\n\t" \ - ::: "memory" \ - ) - -/** - * \brief Exit a critical region - * - * Restores the contents of the status register, including the Global - * Interrupt Enable bit, as it was when entering the critical region. - * This macro takes a parameter P that is unused for the GCC compiler, - * but necessary for code compatibility with the IAR compiler. The IAR - * compiler uses this parameter as the name of a variable that holds - * the SREG value. The parameter must be identical to the parameter - * used in the corresponding ENTER_CRITICAL(). - * - * \param[in] UNUSED(GCC)/P(IAR) Name of variable storing SREG - * - */ - -#define EXIT_CRITICAL(UNUSED) __asm__ __volatile__ ( \ - "pop __tmp_reg__" "\n\t" \ - "out __SREG__, __tmp_reg__" "\n\t" \ - ::: "memory" \ - ) - -#define DISABLE_INTERRUPTS() __asm__ __volatile__ ( "cli" ::: "memory") -#define ENABLE_INTERRUPTS() __asm__ __volatile__ ( "sei" ::: "memory") - -#elif defined(__ICCAVR__) - -#define ENTER_CRITICAL(P) unsigned char P = __save_interrupt();__disable_interrupt(); -#define EXIT_CRITICAL(P) __restore_interrupt(P); - -#define DISABLE_INTERRUPTS() __disable_interrupt(); -#define ENABLE_INTERRUPTS() __enable_interrupt(); - -#else -# error Unsupported compiler. -#endif - -/* clang-format on */ - -#endif /* ATOMIC_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/compiler.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/compiler.h deleted file mode 100644 index fbd7a59..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/compiler.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -#ifndef UTILS_COMPILER_H -#define UTILS_COMPILER_H - -/** - * \defgroup doc_driver_utils_compiler Compiler abstraction - * \ingroup doc_driver_utils - * - * Compiler abstraction layer and code utilities for 8-bit AVR. - * This module provides various abstraction layers and utilities - * to make code compatible between different compilers. - * - * \{ - */ - -#if defined(__GNUC__) -#include -#include -#elif defined(__ICCAVR__) -#define ENABLE_BIT_DEFINITIONS 1 -#include -#include - -#ifndef CCP_IOREG_gc -#define CCP_IOREG_gc 0xD8 /* CPU_CCP_IOREG_gc */ -#endif -#ifndef CCP_SPM_gc -#define CCP_SPM_gc 0x9D /* CPU_CCP_SPM_gc */ -#endif - -#else -#error Unsupported compiler. -#endif - -#include -#include -#include -#include - -#include "interrupt_avr8.h" - -/** - * \def UNUSED - * \brief Marking \a v as a unused parameter or value. - */ -#define UNUSED(v) (void)(v) - -#endif /* UTILS_COMPILER_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/interrupt_avr8.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/interrupt_avr8.h deleted file mode 100644 index ad1efd7..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/interrupt_avr8.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -/** - * \defgroup doc_driver_utils_interrupts ISR abstraction - * \ingroup doc_driver_utils - * - * Interrupt-related functionality. - * - * \{ - */ - -#ifndef UTILS_INTERRUPT_AVR8_H -#define UTILS_INTERRUPT_AVR8_H - -/** - * \weakgroup interrupt_group - * - * @{ - */ - -#ifdef ISR_CUSTOM_H -#include ISR_CUSTOM_H -#else - -/** - * \def ISR - * \brief Define service routine for specified interrupt vector - * - * Usage: - * \code - ISR(FOO_vect) - { - ... - } -\endcode - * - * \param vect Interrupt vector name as found in the device header files. - */ -#if defined(__DOXYGEN__) -#define ISR(vect) -#elif defined(__GNUC__) -#include -#elif defined(__ICCAVR__) -#define __ISR(x) _Pragma(#x) -#define ISR(vect) __ISR(vector = vect) __interrupt void handler_##vect(void) -#endif -#endif // ISR_CUSTOM_H - -#ifdef __GNUC__ -#define cpu_irq_enable() sei() -#define cpu_irq_disable() cli() -#else -#define cpu_irq_enable() __enable_interrupt() -#define cpu_irq_disable() __disable_interrupt() -#endif - -//! @} - -/** - * \weakgroup interrupt_deprecated_group - * @{ - */ -// Deprecated definitions. -#define Enable_global_interrupt() cpu_irq_enable() -#define Disable_global_interrupt() cpu_irq_disable() -#define Is_global_interrupt_enabled() cpu_irq_is_enabled() -//! @} - -#endif /* UTILS_INTERRUPT_AVR8_H */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/utils.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/utils.h deleted file mode 100644 index b133c4d..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/utils.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -/** - * \defgroup doc_driver_utils AVR Code utility functions - * - * Compiler abstraction layer and code utilities for AVR. - * This module provides various abstraction layers and utilities - * to make code compatible between different compilers. - * - * \{ - */ - -#ifndef UTILS_H_INCLUDED -#define UTILS_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Retrieve array size - */ -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) - -/** @} */ - -#ifdef __cplusplus -} -#endif -#endif /* UTILS_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/utils_assert.h b/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/utils_assert.h deleted file mode 100644 index 25c322e..0000000 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/mcc_generated_files/utils/utils_assert.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - @Company - Microchip Technology Inc. - - @Description - This Source file provides APIs. - Generation Information : - Driver Version : 1.0.0 -*/ -/* - (c) 2018 Microchip Technology Inc. and its subsidiaries. - - Subject to your compliance with these terms, you may use Microchip software and any - derivatives exclusively with Microchip products. It is your responsibility to comply with third party - license terms applicable to your use of third party software (including open source software) that - may accompany Microchip software. - - THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER - EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY - IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS - FOR A PARTICULAR PURPOSE. - - IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, - INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND - WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP - HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO - THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL - CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT - OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS - SOFTWARE. -*/ - - -/** - * \defgroup doc_driver_utils_assert Functionality for assert. - * \ingroup doc_driver_utils - * - * \{ - */ - -#ifndef _ASSERT_H_INCLUDED -#define _ASSERT_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** - * \brief Assert macro - * - * This macro is used to throw asserts. It can be mapped to different function - * based on debug level. - * - * \param[in] condition A condition to be checked; - * assert is thrown if the given condition is false - */ - -#ifdef DEBUG -#define ASSERT(condition) \ - if (!(condition)) \ - while (true) \ - ; -#else -#define ASSERT(condition) ((void)0) -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _ASSERT_H_INCLUDED */ diff --git a/avr128da48-cnano-ws2812-mplab-mcc.X/nbproject/configurations.xml b/avr128da48-cnano-ws2812-mplab-mcc.X/nbproject/configurations.xml index 9d7c903..cb67e0f 100644 --- a/avr128da48-cnano-ws2812-mplab-mcc.X/nbproject/configurations.xml +++ b/avr128da48-cnano-ws2812-mplab-mcc.X/nbproject/configurations.xml @@ -7,34 +7,42 @@ - - mcc_generated_files/config/clock_config.h + + mcc_generated_files/ccl/ccl.h - - mcc_generated_files/include/ccp.h - mcc_generated_files/include/rstctrl.h - mcc_generated_files/include/cpuint.h - mcc_generated_files/include/spi0.h - mcc_generated_files/include/port.h - mcc_generated_files/include/protected_io.h - mcc_generated_files/include/pin_manager.h - mcc_generated_files/include/tca0.h - mcc_generated_files/include/evsys.h - mcc_generated_files/include/ccl.h + + mcc_generated_files/evsys/evsys.h - - - mcc_generated_files/utils/assembler/gas.h - mcc_generated_files/utils/assembler/iar.h + + mcc_generated_files/spi/spi0.h + mcc_generated_files/spi/spi_interface.h + + + + + mcc_generated_files/system/utils/assembler/iar.h + mcc_generated_files/system/utils/assembler/gas.h + + mcc_generated_files/system/utils/utils.h + mcc_generated_files/system/utils/atomic.h + mcc_generated_files/system/utils/interrupt_avr8.h + mcc_generated_files/system/utils/compiler.h + mcc_generated_files/system/utils/utils_assert.h + mcc_generated_files/system/utils/assembler.h - mcc_generated_files/utils/assembler.h - mcc_generated_files/utils/compiler.h - mcc_generated_files/utils/interrupt_avr8.h - mcc_generated_files/utils/atomic.h - mcc_generated_files/utils/utils.h - mcc_generated_files/utils/utils_assert.h + mcc_generated_files/system/protected_io.h + mcc_generated_files/system/port.h + mcc_generated_files/system/system.h + mcc_generated_files/system/ccp.h + mcc_generated_files/system/interrupt.h + mcc_generated_files/system/clock.h + mcc_generated_files/system/config_bits.h + mcc_generated_files/system/pins.h + + + mcc_generated_files/timer/timer_interface.h + mcc_generated_files/timer/tca0.h - mcc_generated_files/mcc.h - - mcc_generated_files/src/pin_manager.c - mcc_generated_files/src/cpuint.c - mcc_generated_files/src/spi0.c - mcc_generated_files/src/protected_io.S - mcc_generated_files/src/tca0.c - mcc_generated_files/src/evsys.c - mcc_generated_files/src/ccl.c + + + mcc_generated_files/ccl/src/ccl.c + + + + + mcc_generated_files/evsys/src/evsys.c + + + + + mcc_generated_files/spi/src/spi0.c + + + + + mcc_generated_files/system/src/system.c + mcc_generated_files/system/src/protected_io.S + mcc_generated_files/system/src/pins.c + mcc_generated_files/system/src/config_bits.c + mcc_generated_files/system/src/clock.c + mcc_generated_files/system/src/interrupt.c + + + + + mcc_generated_files/timer/src/tca0.c + - mcc_generated_files/device_config.c - mcc_generated_files/mcc.c main.c @@ -65,7 +92,7 @@ displayName="Important Files" projectFiles="false"> Makefile - MyConfig.mc3 + avr128da48-cnano-ws2812-mplab-mcc.mc3 Makefile @@ -78,11 +105,11 @@ noID XC8 - 2.31 + 2.41 3 - + @@ -103,6 +130,7 @@ false + false false @@ -134,9 +162,9 @@ - + @@ -187,37 +215,26 @@ - + - - - - - - - - - - - - - - - - - - + - + + + + + + + @@ -231,7 +248,78 @@ value="${memories.instruction.ram.ranges}"/> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + noID XC8 - 2.31 + 2.41 3 - + @@ -282,6 +370,7 @@ false + false false @@ -313,9 +402,9 @@ - + @@ -366,37 +455,26 @@ - + - - - - - - - - - - - - - - - - - - + + + + + + + @@ -410,7 +488,78 @@ value="${memories.instruction.ram.ranges}"/> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + avr128da48-cnano-ws2812-mplab-mcc - 6e4782f0-477d-4431-8a1e-a387b18a3fed + 49648111-33f3-4c9b-a598-f0722578e929 0 - c - - h - ISO-8859-1 diff --git a/images/Clean_and_Build.png b/images/Clean_and_Build.png deleted file mode 100644 index e415fb3..0000000 Binary files a/images/Clean_and_Build.png and /dev/null differ diff --git a/images/Demo.PNG b/images/Demo.PNG deleted file mode 100644 index e25a103..0000000 Binary files a/images/Demo.PNG and /dev/null differ diff --git a/images/Make_and_Program_Device.png b/images/Make_and_Program_Device.png deleted file mode 100644 index 87e3def..0000000 Binary files a/images/Make_and_Program_Device.png and /dev/null differ diff --git a/images/Selection_Tool.png b/images/Selection_Tool.png deleted file mode 100644 index d24de3c..0000000 Binary files a/images/Selection_Tool.png and /dev/null differ diff --git a/images/Set_as_Main_Project.png b/images/Set_as_Main_Project.png deleted file mode 100644 index 2d83b38..0000000 Binary files a/images/Set_as_Main_Project.png and /dev/null differ diff --git a/images/program_clean_and_build.png b/images/program_clean_and_build.png new file mode 100644 index 0000000..dcb6086 Binary files /dev/null and b/images/program_clean_and_build.png differ diff --git a/images/program_make_and_program_device.png b/images/program_make_and_program_device.png new file mode 100644 index 0000000..b271650 Binary files /dev/null and b/images/program_make_and_program_device.png differ diff --git a/images/program_set_as_main_project.png b/images/program_set_as_main_project.png new file mode 100644 index 0000000..067f324 Binary files /dev/null and b/images/program_set_as_main_project.png differ diff --git a/images/program_tool_selection.png b/images/program_tool_selection.png new file mode 100644 index 0000000..fa77134 Binary files /dev/null and b/images/program_tool_selection.png differ diff --git a/images/waveforms.png b/images/waveforms.png new file mode 100644 index 0000000..705028e Binary files /dev/null and b/images/waveforms.png differ