Skip to content

License project under GNU LGPL #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
525 changes: 504 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
AdvancedAnalogRedux
======================
`Arduino_AdvancedAnalog`
===========================
[![Compile Examples status](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/compile-examples.yml)
[![Spell Check status](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/spell-check-task.yml/badge.svg)](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/spell-check-task.yml)
[![Sync Labels status](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/sync-labels.yml/badge.svg)](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/sync-labels.yml)
[![Arduino Lint](https://github.com/bcmi-labs/AdvancedAnalogRedux/workflows/Arduino%20Lint/badge.svg)](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions?workflow=Arduino+Lint)


Advanced Analog Library
Advanced Analog Library for Arduino Giga.

## Known issues

* ADC is running at the slowest possible clock (PCLK), should probably set up a PLL and change the clock source.
19 changes: 19 additions & 0 deletions src/AdvancedADC.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "Arduino.h"
#include "HALConfig.h"
#include "AdvancedADC.h"
Expand Down
19 changes: 19 additions & 0 deletions src/AdvancedADC.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <array>
#include "DMABuffer.h"
#include "AdvancedAnalog.h"
Expand Down
20 changes: 20 additions & 0 deletions src/AdvancedAnalog.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef __ADVANCED_ANALOG_H__
#define __ADVANCED_ANALOG_H__

#include "Arduino.h"
#include "DMABuffer.h"
#include "pinDefinitions.h"
Expand Down
19 changes: 19 additions & 0 deletions src/AdvancedDAC.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "Arduino.h"
#include "HALConfig.h"
#include "AdvancedDAC.h"
Expand Down
19 changes: 19 additions & 0 deletions src/AdvancedDAC.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <vector>
#include "DMABuffer.h"
#include "AdvancedAnalog.h"
Expand Down
19 changes: 19 additions & 0 deletions src/Arduino_AdvancedAnalog.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef ADVANCEDANALOGREDUX_ARDUINO_ADVANCEDANALOG_H
#define ADVANCEDANALOGREDUX_ARDUINO_ADVANCEDANALOG_H

Expand Down
20 changes: 20 additions & 0 deletions src/DMABuffer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef __DMA_BUFFER_H__
#define __DMA_BUFFER_H__

#include "Arduino.h"
#include "Queue.h"

Expand Down
19 changes: 19 additions & 0 deletions src/HALConfig.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "HALConfig.h"

static uint32_t hal_tim_freq(TIM_HandleTypeDef *tim) {
Expand Down
22 changes: 22 additions & 0 deletions src/HALConfig.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef __HAL_CONFIG_H__
#define __HAL_CONFIG_H__

#include "Arduino.h"
#include "AdvancedAnalog.h"

int hal_tim_config(TIM_HandleTypeDef *tim, uint32_t t_freq);
int hal_dma_config(DMA_HandleTypeDef *dma, IRQn_Type irqn, uint32_t direction);
size_t hal_dma_get_ct(DMA_HandleTypeDef *dma);
void hal_dma_enable_dbm(DMA_HandleTypeDef *dma, void *m0 = nullptr, void *m1 = nullptr);
void hal_dma_update_memory(DMA_HandleTypeDef *dma, void *addr);
int hal_dac_config(DAC_HandleTypeDef *dac, uint32_t channel, uint32_t trigger);
int hal_adc_config(ADC_HandleTypeDef *adc, uint32_t resolution, uint32_t trigger, PinName *adc_pins, uint32_t n_channels);

#endif // __HAL_CONFIG_H__
20 changes: 20 additions & 0 deletions src/Queue.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
/*
This file is part of the Arduino_AdvancedAnalog library.
Copyright (c) 2023 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef __QUEUE_H__
#define __QUEUE_H__

#include "Arduino.h"

template <class T> class Queue {
Expand Down