init commit of examples
This commit is contained in:
1836
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_ac_e54.h
Normal file
1836
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_ac_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
3663
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_adc_e54.h
Normal file
3663
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_adc_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
1287
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_aes_e54.h
Normal file
1287
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_aes_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
16997
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_can_e54.h
Normal file
16997
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_can_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
776
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_ccl_e54.h
Normal file
776
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_ccl_e54.h
Normal file
@@ -0,0 +1,776 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM CCL
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_CCL_COMPONENT_
|
||||
#ifndef _HRI_CCL_E54_H_INCLUDED_
|
||||
#define _HRI_CCL_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_CCL_CRITICAL_SECTIONS)
|
||||
#define CCL_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define CCL_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define CCL_CRITICAL_SECTION_ENTER()
|
||||
#define CCL_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint32_t hri_ccl_lutctrl_reg_t;
|
||||
typedef uint8_t hri_ccl_ctrl_reg_t;
|
||||
typedef uint8_t hri_ccl_seqctrl_reg_t;
|
||||
|
||||
static inline void hri_ccl_set_CTRL_SWRST_bit(const void *const hw)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg |= CCL_CTRL_SWRST;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ccl_get_CTRL_SWRST_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ccl *)hw)->CTRL.reg;
|
||||
tmp = (tmp & CCL_CTRL_SWRST) >> CCL_CTRL_SWRST_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_CTRL_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg |= CCL_CTRL_ENABLE;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ccl_get_CTRL_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ccl *)hw)->CTRL.reg;
|
||||
tmp = (tmp & CCL_CTRL_ENABLE) >> CCL_CTRL_ENABLE_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_CTRL_ENABLE_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->CTRL.reg;
|
||||
tmp &= ~CCL_CTRL_ENABLE;
|
||||
tmp |= value << CCL_CTRL_ENABLE_Pos;
|
||||
((Ccl *)hw)->CTRL.reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_CTRL_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg &= ~CCL_CTRL_ENABLE;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_CTRL_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg ^= CCL_CTRL_ENABLE;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_CTRL_RUNSTDBY_bit(const void *const hw)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg |= CCL_CTRL_RUNSTDBY;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ccl_get_CTRL_RUNSTDBY_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ccl *)hw)->CTRL.reg;
|
||||
tmp = (tmp & CCL_CTRL_RUNSTDBY) >> CCL_CTRL_RUNSTDBY_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_CTRL_RUNSTDBY_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->CTRL.reg;
|
||||
tmp &= ~CCL_CTRL_RUNSTDBY;
|
||||
tmp |= value << CCL_CTRL_RUNSTDBY_Pos;
|
||||
((Ccl *)hw)->CTRL.reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_CTRL_RUNSTDBY_bit(const void *const hw)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg &= ~CCL_CTRL_RUNSTDBY;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_CTRL_RUNSTDBY_bit(const void *const hw)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg ^= CCL_CTRL_RUNSTDBY;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_CTRL_reg(const void *const hw, hri_ccl_ctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg |= mask;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_ctrl_reg_t hri_ccl_get_CTRL_reg(const void *const hw, hri_ccl_ctrl_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ccl *)hw)->CTRL.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_CTRL_reg(const void *const hw, hri_ccl_ctrl_reg_t data)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg = data;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_CTRL_reg(const void *const hw, hri_ccl_ctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg &= ~mask;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_CTRL_reg(const void *const hw, hri_ccl_ctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->CTRL.reg ^= mask;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_ctrl_reg_t hri_ccl_read_CTRL_reg(const void *const hw)
|
||||
{
|
||||
return ((Ccl *)hw)->CTRL.reg;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_SEQCTRL_SEQSEL_bf(const void *const hw, uint8_t index, hri_ccl_seqctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->SEQCTRL[index].reg |= CCL_SEQCTRL_SEQSEL(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_seqctrl_reg_t hri_ccl_get_SEQCTRL_SEQSEL_bf(const void *const hw, uint8_t index,
|
||||
hri_ccl_seqctrl_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ccl *)hw)->SEQCTRL[index].reg;
|
||||
tmp = (tmp & CCL_SEQCTRL_SEQSEL(mask)) >> CCL_SEQCTRL_SEQSEL_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_SEQCTRL_SEQSEL_bf(const void *const hw, uint8_t index, hri_ccl_seqctrl_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->SEQCTRL[index].reg;
|
||||
tmp &= ~CCL_SEQCTRL_SEQSEL_Msk;
|
||||
tmp |= CCL_SEQCTRL_SEQSEL(data);
|
||||
((Ccl *)hw)->SEQCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_SEQCTRL_SEQSEL_bf(const void *const hw, uint8_t index, hri_ccl_seqctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->SEQCTRL[index].reg &= ~CCL_SEQCTRL_SEQSEL(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_SEQCTRL_SEQSEL_bf(const void *const hw, uint8_t index, hri_ccl_seqctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->SEQCTRL[index].reg ^= CCL_SEQCTRL_SEQSEL(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_seqctrl_reg_t hri_ccl_read_SEQCTRL_SEQSEL_bf(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ccl *)hw)->SEQCTRL[index].reg;
|
||||
tmp = (tmp & CCL_SEQCTRL_SEQSEL_Msk) >> CCL_SEQCTRL_SEQSEL_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_SEQCTRL_reg(const void *const hw, uint8_t index, hri_ccl_seqctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->SEQCTRL[index].reg |= mask;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_seqctrl_reg_t hri_ccl_get_SEQCTRL_reg(const void *const hw, uint8_t index,
|
||||
hri_ccl_seqctrl_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ccl *)hw)->SEQCTRL[index].reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_SEQCTRL_reg(const void *const hw, uint8_t index, hri_ccl_seqctrl_reg_t data)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->SEQCTRL[index].reg = data;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_SEQCTRL_reg(const void *const hw, uint8_t index, hri_ccl_seqctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->SEQCTRL[index].reg &= ~mask;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_SEQCTRL_reg(const void *const hw, uint8_t index, hri_ccl_seqctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->SEQCTRL[index].reg ^= mask;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_seqctrl_reg_t hri_ccl_read_SEQCTRL_reg(const void *const hw, uint8_t index)
|
||||
{
|
||||
return ((Ccl *)hw)->SEQCTRL[index].reg;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_ENABLE_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_ENABLE;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ccl_get_LUTCTRL_ENABLE_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_ENABLE) >> CCL_LUTCTRL_ENABLE_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_ENABLE_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_ENABLE;
|
||||
tmp |= value << CCL_LUTCTRL_ENABLE_Pos;
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_ENABLE_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_ENABLE;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_ENABLE_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_ENABLE;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_EDGESEL_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_EDGESEL;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ccl_get_LUTCTRL_EDGESEL_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_EDGESEL) >> CCL_LUTCTRL_EDGESEL_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_EDGESEL_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_EDGESEL;
|
||||
tmp |= value << CCL_LUTCTRL_EDGESEL_Pos;
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_EDGESEL_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_EDGESEL;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_EDGESEL_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_EDGESEL;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_INVEI_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_INVEI;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ccl_get_LUTCTRL_INVEI_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_INVEI) >> CCL_LUTCTRL_INVEI_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_INVEI_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_INVEI;
|
||||
tmp |= value << CCL_LUTCTRL_INVEI_Pos;
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_INVEI_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_INVEI;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_INVEI_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_INVEI;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_LUTEI_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_LUTEI;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ccl_get_LUTCTRL_LUTEI_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_LUTEI) >> CCL_LUTCTRL_LUTEI_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_LUTEI_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_LUTEI;
|
||||
tmp |= value << CCL_LUTCTRL_LUTEI_Pos;
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_LUTEI_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_LUTEI;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_LUTEI_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_LUTEI;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_LUTEO_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_LUTEO;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ccl_get_LUTCTRL_LUTEO_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_LUTEO) >> CCL_LUTCTRL_LUTEO_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_LUTEO_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_LUTEO;
|
||||
tmp |= value << CCL_LUTCTRL_LUTEO_Pos;
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_LUTEO_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_LUTEO;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_LUTEO_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_LUTEO;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_FILTSEL_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_FILTSEL(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_get_LUTCTRL_FILTSEL_bf(const void *const hw, uint8_t index,
|
||||
hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_FILTSEL(mask)) >> CCL_LUTCTRL_FILTSEL_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_FILTSEL_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t data)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_FILTSEL_Msk;
|
||||
tmp |= CCL_LUTCTRL_FILTSEL(data);
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_FILTSEL_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_FILTSEL(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_FILTSEL_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_FILTSEL(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_read_LUTCTRL_FILTSEL_bf(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_FILTSEL_Msk) >> CCL_LUTCTRL_FILTSEL_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_INSEL0_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_INSEL0(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_get_LUTCTRL_INSEL0_bf(const void *const hw, uint8_t index,
|
||||
hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_INSEL0(mask)) >> CCL_LUTCTRL_INSEL0_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_INSEL0_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t data)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_INSEL0_Msk;
|
||||
tmp |= CCL_LUTCTRL_INSEL0(data);
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_INSEL0_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_INSEL0(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_INSEL0_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_INSEL0(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_read_LUTCTRL_INSEL0_bf(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_INSEL0_Msk) >> CCL_LUTCTRL_INSEL0_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_INSEL1_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_INSEL1(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_get_LUTCTRL_INSEL1_bf(const void *const hw, uint8_t index,
|
||||
hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_INSEL1(mask)) >> CCL_LUTCTRL_INSEL1_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_INSEL1_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t data)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_INSEL1_Msk;
|
||||
tmp |= CCL_LUTCTRL_INSEL1(data);
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_INSEL1_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_INSEL1(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_INSEL1_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_INSEL1(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_read_LUTCTRL_INSEL1_bf(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_INSEL1_Msk) >> CCL_LUTCTRL_INSEL1_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_INSEL2_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_INSEL2(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_get_LUTCTRL_INSEL2_bf(const void *const hw, uint8_t index,
|
||||
hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_INSEL2(mask)) >> CCL_LUTCTRL_INSEL2_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_INSEL2_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t data)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_INSEL2_Msk;
|
||||
tmp |= CCL_LUTCTRL_INSEL2(data);
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_INSEL2_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_INSEL2(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_INSEL2_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_INSEL2(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_read_LUTCTRL_INSEL2_bf(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_INSEL2_Msk) >> CCL_LUTCTRL_INSEL2_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_TRUTH_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= CCL_LUTCTRL_TRUTH(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_get_LUTCTRL_TRUTH_bf(const void *const hw, uint8_t index,
|
||||
hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_TRUTH(mask)) >> CCL_LUTCTRL_TRUTH_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_TRUTH_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t data)
|
||||
{
|
||||
uint32_t tmp;
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= ~CCL_LUTCTRL_TRUTH_Msk;
|
||||
tmp |= CCL_LUTCTRL_TRUTH(data);
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = tmp;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_TRUTH_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~CCL_LUTCTRL_TRUTH(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_TRUTH_bf(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= CCL_LUTCTRL_TRUTH(mask);
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_read_LUTCTRL_TRUTH_bf(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp = (tmp & CCL_LUTCTRL_TRUTH_Msk) >> CCL_LUTCTRL_TRUTH_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_set_LUTCTRL_reg(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg |= mask;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_get_LUTCTRL_reg(const void *const hw, uint8_t index,
|
||||
hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ccl_write_LUTCTRL_reg(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t data)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg = data;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_clear_LUTCTRL_reg(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg &= ~mask;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ccl_toggle_LUTCTRL_reg(const void *const hw, uint8_t index, hri_ccl_lutctrl_reg_t mask)
|
||||
{
|
||||
CCL_CRITICAL_SECTION_ENTER();
|
||||
((Ccl *)hw)->LUTCTRL[index].reg ^= mask;
|
||||
CCL_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ccl_lutctrl_reg_t hri_ccl_read_LUTCTRL_reg(const void *const hw, uint8_t index)
|
||||
{
|
||||
return ((Ccl *)hw)->LUTCTRL[index].reg;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_CCL_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_CCL_COMPONENT_ */
|
||||
361
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_cmcc_e54.h
Normal file
361
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_cmcc_e54.h
Normal file
@@ -0,0 +1,361 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM CMCC
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_CMCC_COMPONENT_
|
||||
#ifndef _HRI_CMCC_E54_H_INCLUDED_
|
||||
#define _HRI_CMCC_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_CMCC_CRITICAL_SECTIONS)
|
||||
#define CMCC_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define CMCC_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define CMCC_CRITICAL_SECTION_ENTER()
|
||||
#define CMCC_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint32_t hri_cmcc_cfg_reg_t;
|
||||
typedef uint32_t hri_cmcc_ctrl_reg_t;
|
||||
typedef uint32_t hri_cmcc_lckway_reg_t;
|
||||
typedef uint32_t hri_cmcc_maint0_reg_t;
|
||||
typedef uint32_t hri_cmcc_maint1_reg_t;
|
||||
typedef uint32_t hri_cmcc_mcfg_reg_t;
|
||||
typedef uint32_t hri_cmcc_mctrl_reg_t;
|
||||
typedef uint32_t hri_cmcc_men_reg_t;
|
||||
typedef uint32_t hri_cmcc_msr_reg_t;
|
||||
typedef uint32_t hri_cmcc_sr_reg_t;
|
||||
typedef uint32_t hri_cmcc_type_reg_t;
|
||||
|
||||
static inline bool hri_cmcc_get_TYPE_GCLK_bit(const void *const hw)
|
||||
{
|
||||
return (((Cmcc *)hw)->TYPE.reg & CMCC_TYPE_GCLK) >> CMCC_TYPE_GCLK_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_cmcc_get_TYPE_RRP_bit(const void *const hw)
|
||||
{
|
||||
return (((Cmcc *)hw)->TYPE.reg & CMCC_TYPE_RRP) >> CMCC_TYPE_RRP_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_cmcc_get_TYPE_LCKDOWN_bit(const void *const hw)
|
||||
{
|
||||
return (((Cmcc *)hw)->TYPE.reg & CMCC_TYPE_LCKDOWN) >> CMCC_TYPE_LCKDOWN_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_type_reg_t hri_cmcc_get_TYPE_WAYNUM_bf(const void *const hw, hri_cmcc_type_reg_t mask)
|
||||
{
|
||||
return (((Cmcc *)hw)->TYPE.reg & CMCC_TYPE_WAYNUM(mask)) >> CMCC_TYPE_WAYNUM_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_type_reg_t hri_cmcc_read_TYPE_WAYNUM_bf(const void *const hw)
|
||||
{
|
||||
return (((Cmcc *)hw)->TYPE.reg & CMCC_TYPE_WAYNUM_Msk) >> CMCC_TYPE_WAYNUM_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_type_reg_t hri_cmcc_get_TYPE_CSIZE_bf(const void *const hw, hri_cmcc_type_reg_t mask)
|
||||
{
|
||||
return (((Cmcc *)hw)->TYPE.reg & CMCC_TYPE_CSIZE(mask)) >> CMCC_TYPE_CSIZE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_type_reg_t hri_cmcc_read_TYPE_CSIZE_bf(const void *const hw)
|
||||
{
|
||||
return (((Cmcc *)hw)->TYPE.reg & CMCC_TYPE_CSIZE_Msk) >> CMCC_TYPE_CSIZE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_type_reg_t hri_cmcc_get_TYPE_CLSIZE_bf(const void *const hw, hri_cmcc_type_reg_t mask)
|
||||
{
|
||||
return (((Cmcc *)hw)->TYPE.reg & CMCC_TYPE_CLSIZE(mask)) >> CMCC_TYPE_CLSIZE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_type_reg_t hri_cmcc_read_TYPE_CLSIZE_bf(const void *const hw)
|
||||
{
|
||||
return (((Cmcc *)hw)->TYPE.reg & CMCC_TYPE_CLSIZE_Msk) >> CMCC_TYPE_CLSIZE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_type_reg_t hri_cmcc_get_TYPE_reg(const void *const hw, hri_cmcc_type_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Cmcc *)hw)->TYPE.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_type_reg_t hri_cmcc_read_TYPE_reg(const void *const hw)
|
||||
{
|
||||
return ((Cmcc *)hw)->TYPE.reg;
|
||||
}
|
||||
|
||||
static inline bool hri_cmcc_get_SR_CSTS_bit(const void *const hw)
|
||||
{
|
||||
return (((Cmcc *)hw)->SR.reg & CMCC_SR_CSTS) >> CMCC_SR_CSTS_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_sr_reg_t hri_cmcc_get_SR_reg(const void *const hw, hri_cmcc_sr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Cmcc *)hw)->SR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_sr_reg_t hri_cmcc_read_SR_reg(const void *const hw)
|
||||
{
|
||||
return ((Cmcc *)hw)->SR.reg;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_msr_reg_t hri_cmcc_get_MSR_EVENT_CNT_bf(const void *const hw, hri_cmcc_msr_reg_t mask)
|
||||
{
|
||||
return (((Cmcc *)hw)->MSR.reg & CMCC_MSR_EVENT_CNT(mask)) >> CMCC_MSR_EVENT_CNT_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_msr_reg_t hri_cmcc_read_MSR_EVENT_CNT_bf(const void *const hw)
|
||||
{
|
||||
return (((Cmcc *)hw)->MSR.reg & CMCC_MSR_EVENT_CNT_Msk) >> CMCC_MSR_EVENT_CNT_Pos;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_msr_reg_t hri_cmcc_get_MSR_reg(const void *const hw, hri_cmcc_msr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Cmcc *)hw)->MSR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_cmcc_msr_reg_t hri_cmcc_read_MSR_reg(const void *const hw)
|
||||
{
|
||||
return ((Cmcc *)hw)->MSR.reg;
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_set_CFG_reg(const void *const hw, hri_cmcc_cfg_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->CFG.reg |= mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_cmcc_cfg_reg_t hri_cmcc_get_CFG_reg(const void *const hw, hri_cmcc_cfg_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Cmcc *)hw)->CFG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_write_CFG_reg(const void *const hw, hri_cmcc_cfg_reg_t data)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->CFG.reg = data;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_clear_CFG_reg(const void *const hw, hri_cmcc_cfg_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->CFG.reg &= ~mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_toggle_CFG_reg(const void *const hw, hri_cmcc_cfg_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->CFG.reg ^= mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_cmcc_cfg_reg_t hri_cmcc_read_CFG_reg(const void *const hw)
|
||||
{
|
||||
return ((Cmcc *)hw)->CFG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_set_LCKWAY_reg(const void *const hw, hri_cmcc_lckway_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->LCKWAY.reg |= mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_cmcc_lckway_reg_t hri_cmcc_get_LCKWAY_reg(const void *const hw, hri_cmcc_lckway_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Cmcc *)hw)->LCKWAY.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_write_LCKWAY_reg(const void *const hw, hri_cmcc_lckway_reg_t data)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->LCKWAY.reg = data;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_clear_LCKWAY_reg(const void *const hw, hri_cmcc_lckway_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->LCKWAY.reg &= ~mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_toggle_LCKWAY_reg(const void *const hw, hri_cmcc_lckway_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->LCKWAY.reg ^= mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_cmcc_lckway_reg_t hri_cmcc_read_LCKWAY_reg(const void *const hw)
|
||||
{
|
||||
return ((Cmcc *)hw)->LCKWAY.reg;
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_set_MCFG_reg(const void *const hw, hri_cmcc_mcfg_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MCFG.reg |= mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_cmcc_mcfg_reg_t hri_cmcc_get_MCFG_reg(const void *const hw, hri_cmcc_mcfg_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Cmcc *)hw)->MCFG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_write_MCFG_reg(const void *const hw, hri_cmcc_mcfg_reg_t data)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MCFG.reg = data;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_clear_MCFG_reg(const void *const hw, hri_cmcc_mcfg_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MCFG.reg &= ~mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_toggle_MCFG_reg(const void *const hw, hri_cmcc_mcfg_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MCFG.reg ^= mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_cmcc_mcfg_reg_t hri_cmcc_read_MCFG_reg(const void *const hw)
|
||||
{
|
||||
return ((Cmcc *)hw)->MCFG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_set_MEN_reg(const void *const hw, hri_cmcc_men_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MEN.reg |= mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_cmcc_men_reg_t hri_cmcc_get_MEN_reg(const void *const hw, hri_cmcc_men_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Cmcc *)hw)->MEN.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_write_MEN_reg(const void *const hw, hri_cmcc_men_reg_t data)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MEN.reg = data;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_clear_MEN_reg(const void *const hw, hri_cmcc_men_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MEN.reg &= ~mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_toggle_MEN_reg(const void *const hw, hri_cmcc_men_reg_t mask)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MEN.reg ^= mask;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_cmcc_men_reg_t hri_cmcc_read_MEN_reg(const void *const hw)
|
||||
{
|
||||
return ((Cmcc *)hw)->MEN.reg;
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_write_CTRL_reg(const void *const hw, hri_cmcc_ctrl_reg_t data)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->CTRL.reg = data;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_write_MAINT0_reg(const void *const hw, hri_cmcc_maint0_reg_t data)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MAINT0.reg = data;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_write_MAINT1_reg(const void *const hw, hri_cmcc_maint1_reg_t data)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MAINT1.reg = data;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_cmcc_write_MCTRL_reg(const void *const hw, hri_cmcc_mctrl_reg_t data)
|
||||
{
|
||||
CMCC_CRITICAL_SECTION_ENTER();
|
||||
((Cmcc *)hw)->MCTRL.reg = data;
|
||||
CMCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_CMCC_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_CMCC_COMPONENT_ */
|
||||
1706
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_dac_e54.h
Normal file
1706
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_dac_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
6800
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_dmac_e54.h
Normal file
6800
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_dmac_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
1256
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_dsu_e54.h
Normal file
1256
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_dsu_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
76
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_e54.h
Normal file
76
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_e54.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM E54 HRI top-level header file
|
||||
*
|
||||
* Copyright (c) 2016-2019 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*/
|
||||
|
||||
#ifndef _HRI_E54_H_INCLUDED_
|
||||
#define _HRI_E54_H_INCLUDED_
|
||||
|
||||
#include <sam.h>
|
||||
#include <hri_ac_e54.h>
|
||||
#include <hri_adc_e54.h>
|
||||
#include <hri_aes_e54.h>
|
||||
#include <hri_can_e54.h>
|
||||
#include <hri_ccl_e54.h>
|
||||
#include <hri_cmcc_e54.h>
|
||||
#include <hri_dac_e54.h>
|
||||
#include <hri_dmac_e54.h>
|
||||
#include <hri_dsu_e54.h>
|
||||
#include <hri_eic_e54.h>
|
||||
#include <hri_evsys_e54.h>
|
||||
#include <hri_freqm_e54.h>
|
||||
#include <hri_gclk_e54.h>
|
||||
#include <hri_gmac_e54.h>
|
||||
#include <hri_hmatrixb_e54.h>
|
||||
#include <hri_i2s_e54.h>
|
||||
#include <hri_icm_e54.h>
|
||||
#include <hri_mclk_e54.h>
|
||||
#include <hri_nvmctrl_e54.h>
|
||||
#include <hri_osc32kctrl_e54.h>
|
||||
#include <hri_oscctrl_e54.h>
|
||||
#include <hri_pac_e54.h>
|
||||
#include <hri_pcc_e54.h>
|
||||
#include <hri_pdec_e54.h>
|
||||
#include <hri_pm_e54.h>
|
||||
#include <hri_port_e54.h>
|
||||
#include <hri_qspi_e54.h>
|
||||
#include <hri_ramecc_e54.h>
|
||||
#include <hri_rstc_e54.h>
|
||||
#include <hri_rtc_e54.h>
|
||||
#include <hri_sdhc_e54.h>
|
||||
#include <hri_sercom_e54.h>
|
||||
#include <hri_supc_e54.h>
|
||||
#include <hri_tc_e54.h>
|
||||
#include <hri_tcc_e54.h>
|
||||
#include <hri_trng_e54.h>
|
||||
#include <hri_usb_e54.h>
|
||||
#include <hri_wdt_e54.h>
|
||||
|
||||
#endif /* _HRI_E54_H_INCLUDED_ */
|
||||
1838
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_eic_e54.h
Normal file
1838
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_eic_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
1707
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_evsys_e54.h
Normal file
1707
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_evsys_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
464
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_freqm_e54.h
Normal file
464
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_freqm_e54.h
Normal file
@@ -0,0 +1,464 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM FREQM
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_FREQM_COMPONENT_
|
||||
#ifndef _HRI_FREQM_E54_H_INCLUDED_
|
||||
#define _HRI_FREQM_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_FREQM_CRITICAL_SECTIONS)
|
||||
#define FREQM_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define FREQM_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define FREQM_CRITICAL_SECTION_ENTER()
|
||||
#define FREQM_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint16_t hri_freqm_cfga_reg_t;
|
||||
typedef uint32_t hri_freqm_syncbusy_reg_t;
|
||||
typedef uint32_t hri_freqm_value_reg_t;
|
||||
typedef uint8_t hri_freqm_ctrla_reg_t;
|
||||
typedef uint8_t hri_freqm_ctrlb_reg_t;
|
||||
typedef uint8_t hri_freqm_intenset_reg_t;
|
||||
typedef uint8_t hri_freqm_intflag_reg_t;
|
||||
typedef uint8_t hri_freqm_status_reg_t;
|
||||
|
||||
static inline void hri_freqm_wait_for_sync(const void *const hw, hri_freqm_syncbusy_reg_t reg)
|
||||
{
|
||||
while (((Freqm *)hw)->SYNCBUSY.reg & reg) {
|
||||
};
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_is_syncing(const void *const hw, hri_freqm_syncbusy_reg_t reg)
|
||||
{
|
||||
return ((Freqm *)hw)->SYNCBUSY.reg & reg;
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_get_INTFLAG_DONE_bit(const void *const hw)
|
||||
{
|
||||
return (((Freqm *)hw)->INTFLAG.reg & FREQM_INTFLAG_DONE) >> FREQM_INTFLAG_DONE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_INTFLAG_DONE_bit(const void *const hw)
|
||||
{
|
||||
((Freqm *)hw)->INTFLAG.reg = FREQM_INTFLAG_DONE;
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_get_interrupt_DONE_bit(const void *const hw)
|
||||
{
|
||||
return (((Freqm *)hw)->INTFLAG.reg & FREQM_INTFLAG_DONE) >> FREQM_INTFLAG_DONE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_interrupt_DONE_bit(const void *const hw)
|
||||
{
|
||||
((Freqm *)hw)->INTFLAG.reg = FREQM_INTFLAG_DONE;
|
||||
}
|
||||
|
||||
static inline hri_freqm_intflag_reg_t hri_freqm_get_INTFLAG_reg(const void *const hw, hri_freqm_intflag_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Freqm *)hw)->INTFLAG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_freqm_intflag_reg_t hri_freqm_read_INTFLAG_reg(const void *const hw)
|
||||
{
|
||||
return ((Freqm *)hw)->INTFLAG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_INTFLAG_reg(const void *const hw, hri_freqm_intflag_reg_t mask)
|
||||
{
|
||||
((Freqm *)hw)->INTFLAG.reg = mask;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_set_INTEN_DONE_bit(const void *const hw)
|
||||
{
|
||||
((Freqm *)hw)->INTENSET.reg = FREQM_INTENSET_DONE;
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_get_INTEN_DONE_bit(const void *const hw)
|
||||
{
|
||||
return (((Freqm *)hw)->INTENSET.reg & FREQM_INTENSET_DONE) >> FREQM_INTENSET_DONE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_write_INTEN_DONE_bit(const void *const hw, bool value)
|
||||
{
|
||||
if (value == 0x0) {
|
||||
((Freqm *)hw)->INTENCLR.reg = FREQM_INTENSET_DONE;
|
||||
} else {
|
||||
((Freqm *)hw)->INTENSET.reg = FREQM_INTENSET_DONE;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_INTEN_DONE_bit(const void *const hw)
|
||||
{
|
||||
((Freqm *)hw)->INTENCLR.reg = FREQM_INTENSET_DONE;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_set_INTEN_reg(const void *const hw, hri_freqm_intenset_reg_t mask)
|
||||
{
|
||||
((Freqm *)hw)->INTENSET.reg = mask;
|
||||
}
|
||||
|
||||
static inline hri_freqm_intenset_reg_t hri_freqm_get_INTEN_reg(const void *const hw, hri_freqm_intenset_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Freqm *)hw)->INTENSET.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_freqm_intenset_reg_t hri_freqm_read_INTEN_reg(const void *const hw)
|
||||
{
|
||||
return ((Freqm *)hw)->INTENSET.reg;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_write_INTEN_reg(const void *const hw, hri_freqm_intenset_reg_t data)
|
||||
{
|
||||
((Freqm *)hw)->INTENSET.reg = data;
|
||||
((Freqm *)hw)->INTENCLR.reg = ~data;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_INTEN_reg(const void *const hw, hri_freqm_intenset_reg_t mask)
|
||||
{
|
||||
((Freqm *)hw)->INTENCLR.reg = mask;
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_get_SYNCBUSY_SWRST_bit(const void *const hw)
|
||||
{
|
||||
return (((Freqm *)hw)->SYNCBUSY.reg & FREQM_SYNCBUSY_SWRST) >> FREQM_SYNCBUSY_SWRST_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_get_SYNCBUSY_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
return (((Freqm *)hw)->SYNCBUSY.reg & FREQM_SYNCBUSY_ENABLE) >> FREQM_SYNCBUSY_ENABLE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_freqm_syncbusy_reg_t hri_freqm_get_SYNCBUSY_reg(const void *const hw, hri_freqm_syncbusy_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Freqm *)hw)->SYNCBUSY.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_freqm_syncbusy_reg_t hri_freqm_read_SYNCBUSY_reg(const void *const hw)
|
||||
{
|
||||
return ((Freqm *)hw)->SYNCBUSY.reg;
|
||||
}
|
||||
|
||||
static inline hri_freqm_value_reg_t hri_freqm_get_VALUE_VALUE_bf(const void *const hw, hri_freqm_value_reg_t mask)
|
||||
{
|
||||
return (((Freqm *)hw)->VALUE.reg & FREQM_VALUE_VALUE(mask)) >> FREQM_VALUE_VALUE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_freqm_value_reg_t hri_freqm_read_VALUE_VALUE_bf(const void *const hw)
|
||||
{
|
||||
return (((Freqm *)hw)->VALUE.reg & FREQM_VALUE_VALUE_Msk) >> FREQM_VALUE_VALUE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_freqm_value_reg_t hri_freqm_get_VALUE_reg(const void *const hw, hri_freqm_value_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Freqm *)hw)->VALUE.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_freqm_value_reg_t hri_freqm_read_VALUE_reg(const void *const hw)
|
||||
{
|
||||
return ((Freqm *)hw)->VALUE.reg;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_set_CTRLA_SWRST_bit(const void *const hw)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CTRLA.reg |= FREQM_CTRLA_SWRST;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_get_CTRLA_SWRST_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST);
|
||||
tmp = ((Freqm *)hw)->CTRLA.reg;
|
||||
tmp = (tmp & FREQM_CTRLA_SWRST) >> FREQM_CTRLA_SWRST_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_set_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CTRLA.reg |= FREQM_CTRLA_ENABLE;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_get_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
|
||||
tmp = ((Freqm *)hw)->CTRLA.reg;
|
||||
tmp = (tmp & FREQM_CTRLA_ENABLE) >> FREQM_CTRLA_ENABLE_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_write_CTRLA_ENABLE_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Freqm *)hw)->CTRLA.reg;
|
||||
tmp &= ~FREQM_CTRLA_ENABLE;
|
||||
tmp |= value << FREQM_CTRLA_ENABLE_Pos;
|
||||
((Freqm *)hw)->CTRLA.reg = tmp;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CTRLA.reg &= ~FREQM_CTRLA_ENABLE;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_freqm_toggle_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CTRLA.reg ^= FREQM_CTRLA_ENABLE;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_freqm_set_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CTRLA.reg |= mask;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_freqm_ctrla_reg_t hri_freqm_get_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
|
||||
tmp = ((Freqm *)hw)->CTRLA.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_write_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t data)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CTRLA.reg = data;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CTRLA.reg &= ~mask;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_freqm_toggle_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CTRLA.reg ^= mask;
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_freqm_ctrla_reg_t hri_freqm_read_CTRLA_reg(const void *const hw)
|
||||
{
|
||||
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
|
||||
return ((Freqm *)hw)->CTRLA.reg;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_set_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CFGA.reg |= FREQM_CFGA_REFNUM(mask);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_freqm_cfga_reg_t hri_freqm_get_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t mask)
|
||||
{
|
||||
uint16_t tmp;
|
||||
tmp = ((Freqm *)hw)->CFGA.reg;
|
||||
tmp = (tmp & FREQM_CFGA_REFNUM(mask)) >> FREQM_CFGA_REFNUM_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_write_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t data)
|
||||
{
|
||||
uint16_t tmp;
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Freqm *)hw)->CFGA.reg;
|
||||
tmp &= ~FREQM_CFGA_REFNUM_Msk;
|
||||
tmp |= FREQM_CFGA_REFNUM(data);
|
||||
((Freqm *)hw)->CFGA.reg = tmp;
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CFGA.reg &= ~FREQM_CFGA_REFNUM(mask);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_freqm_toggle_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CFGA.reg ^= FREQM_CFGA_REFNUM(mask);
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_freqm_cfga_reg_t hri_freqm_read_CFGA_REFNUM_bf(const void *const hw)
|
||||
{
|
||||
uint16_t tmp;
|
||||
tmp = ((Freqm *)hw)->CFGA.reg;
|
||||
tmp = (tmp & FREQM_CFGA_REFNUM_Msk) >> FREQM_CFGA_REFNUM_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_set_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CFGA.reg |= mask;
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_freqm_cfga_reg_t hri_freqm_get_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t mask)
|
||||
{
|
||||
uint16_t tmp;
|
||||
tmp = ((Freqm *)hw)->CFGA.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_write_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t data)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CFGA.reg = data;
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CFGA.reg &= ~mask;
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_freqm_toggle_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CFGA.reg ^= mask;
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_freqm_cfga_reg_t hri_freqm_read_CFGA_reg(const void *const hw)
|
||||
{
|
||||
return ((Freqm *)hw)->CFGA.reg;
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_get_STATUS_BUSY_bit(const void *const hw)
|
||||
{
|
||||
return (((Freqm *)hw)->STATUS.reg & FREQM_STATUS_BUSY) >> FREQM_STATUS_BUSY_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_STATUS_BUSY_bit(const void *const hw)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->STATUS.reg = FREQM_STATUS_BUSY;
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_freqm_get_STATUS_OVF_bit(const void *const hw)
|
||||
{
|
||||
return (((Freqm *)hw)->STATUS.reg & FREQM_STATUS_OVF) >> FREQM_STATUS_OVF_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_STATUS_OVF_bit(const void *const hw)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->STATUS.reg = FREQM_STATUS_OVF;
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_freqm_status_reg_t hri_freqm_get_STATUS_reg(const void *const hw, hri_freqm_status_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Freqm *)hw)->STATUS.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_clear_STATUS_reg(const void *const hw, hri_freqm_status_reg_t mask)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->STATUS.reg = mask;
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_freqm_status_reg_t hri_freqm_read_STATUS_reg(const void *const hw)
|
||||
{
|
||||
return ((Freqm *)hw)->STATUS.reg;
|
||||
}
|
||||
|
||||
static inline void hri_freqm_write_CTRLB_reg(const void *const hw, hri_freqm_ctrlb_reg_t data)
|
||||
{
|
||||
FREQM_CRITICAL_SECTION_ENTER();
|
||||
((Freqm *)hw)->CTRLB.reg = data;
|
||||
FREQM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_FREQM_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_FREQM_COMPONENT_ */
|
||||
805
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_gclk_e54.h
Normal file
805
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_gclk_e54.h
Normal file
@@ -0,0 +1,805 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM GCLK
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_GCLK_COMPONENT_
|
||||
#ifndef _HRI_GCLK_E54_H_INCLUDED_
|
||||
#define _HRI_GCLK_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_GCLK_CRITICAL_SECTIONS)
|
||||
#define GCLK_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define GCLK_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define GCLK_CRITICAL_SECTION_ENTER()
|
||||
#define GCLK_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint32_t hri_gclk_genctrl_reg_t;
|
||||
typedef uint32_t hri_gclk_pchctrl_reg_t;
|
||||
typedef uint32_t hri_gclk_syncbusy_reg_t;
|
||||
typedef uint8_t hri_gclk_ctrla_reg_t;
|
||||
|
||||
static inline void hri_gclk_wait_for_sync(const void *const hw, hri_gclk_syncbusy_reg_t reg)
|
||||
{
|
||||
while (((Gclk *)hw)->SYNCBUSY.reg & reg) {
|
||||
};
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_is_syncing(const void *const hw, hri_gclk_syncbusy_reg_t reg)
|
||||
{
|
||||
return ((Gclk *)hw)->SYNCBUSY.reg & reg;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_SWRST_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_SWRST) >> GCLK_SYNCBUSY_SWRST_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL0_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL0) >> GCLK_SYNCBUSY_GENCTRL0_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL1_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL1) >> GCLK_SYNCBUSY_GENCTRL1_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL2_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL2) >> GCLK_SYNCBUSY_GENCTRL2_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL3_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL3) >> GCLK_SYNCBUSY_GENCTRL3_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL4_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL4) >> GCLK_SYNCBUSY_GENCTRL4_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL5_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL5) >> GCLK_SYNCBUSY_GENCTRL5_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL6_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL6) >> GCLK_SYNCBUSY_GENCTRL6_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL7_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL7) >> GCLK_SYNCBUSY_GENCTRL7_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL8_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL8) >> GCLK_SYNCBUSY_GENCTRL8_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL9_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL9) >> GCLK_SYNCBUSY_GENCTRL9_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL10_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL10) >> GCLK_SYNCBUSY_GENCTRL10_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_SYNCBUSY_GENCTRL11_bit(const void *const hw)
|
||||
{
|
||||
return (((Gclk *)hw)->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL11) >> GCLK_SYNCBUSY_GENCTRL11_Pos;
|
||||
}
|
||||
|
||||
static inline hri_gclk_syncbusy_reg_t hri_gclk_get_SYNCBUSY_reg(const void *const hw, hri_gclk_syncbusy_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->SYNCBUSY.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_gclk_syncbusy_reg_t hri_gclk_read_SYNCBUSY_reg(const void *const hw)
|
||||
{
|
||||
return ((Gclk *)hw)->SYNCBUSY.reg;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_CTRLA_SWRST_bit(const void *const hw)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->CTRLA.reg |= GCLK_CTRLA_SWRST;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_CTRLA_SWRST_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
|
||||
tmp = ((Gclk *)hw)->CTRLA.reg;
|
||||
tmp = (tmp & GCLK_CTRLA_SWRST) >> GCLK_CTRLA_SWRST_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->CTRLA.reg |= mask;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_ctrla_reg_t hri_gclk_get_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
|
||||
tmp = ((Gclk *)hw)->CTRLA.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t data)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->CTRLA.reg = data;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->CTRLA.reg &= ~mask;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_CTRLA_reg(const void *const hw, hri_gclk_ctrla_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->CTRLA.reg ^= mask;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_ctrla_reg_t hri_gclk_read_CTRLA_reg(const void *const hw)
|
||||
{
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_SWRST);
|
||||
return ((Gclk *)hw)->CTRLA.reg;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_GENCTRL_GENEN_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_GENEN;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_GENCTRL_GENEN_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_GENEN) >> GCLK_GENCTRL_GENEN_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_GENCTRL_GENEN_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp &= ~GCLK_GENCTRL_GENEN;
|
||||
tmp |= value << GCLK_GENCTRL_GENEN_Pos;
|
||||
((Gclk *)hw)->GENCTRL[index].reg = tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_GENCTRL_GENEN_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_GENEN;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_GENCTRL_GENEN_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_GENEN;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_GENCTRL_IDC_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_IDC;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_GENCTRL_IDC_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_IDC) >> GCLK_GENCTRL_IDC_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_GENCTRL_IDC_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp &= ~GCLK_GENCTRL_IDC;
|
||||
tmp |= value << GCLK_GENCTRL_IDC_Pos;
|
||||
((Gclk *)hw)->GENCTRL[index].reg = tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_GENCTRL_IDC_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_IDC;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_GENCTRL_IDC_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_IDC;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_GENCTRL_OOV_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_OOV;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_GENCTRL_OOV_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_OOV) >> GCLK_GENCTRL_OOV_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_GENCTRL_OOV_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp &= ~GCLK_GENCTRL_OOV;
|
||||
tmp |= value << GCLK_GENCTRL_OOV_Pos;
|
||||
((Gclk *)hw)->GENCTRL[index].reg = tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_GENCTRL_OOV_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_OOV;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_GENCTRL_OOV_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_OOV;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_GENCTRL_OE_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_OE;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_GENCTRL_OE_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_OE) >> GCLK_GENCTRL_OE_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_GENCTRL_OE_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp &= ~GCLK_GENCTRL_OE;
|
||||
tmp |= value << GCLK_GENCTRL_OE_Pos;
|
||||
((Gclk *)hw)->GENCTRL[index].reg = tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_GENCTRL_OE_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_OE;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_GENCTRL_OE_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_OE;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_DIVSEL;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_DIVSEL) >> GCLK_GENCTRL_DIVSEL_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp &= ~GCLK_GENCTRL_DIVSEL;
|
||||
tmp |= value << GCLK_GENCTRL_DIVSEL_Pos;
|
||||
((Gclk *)hw)->GENCTRL[index].reg = tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_DIVSEL;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_GENCTRL_DIVSEL_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_DIVSEL;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_RUNSTDBY;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_RUNSTDBY) >> GCLK_GENCTRL_RUNSTDBY_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp &= ~GCLK_GENCTRL_RUNSTDBY;
|
||||
tmp |= value << GCLK_GENCTRL_RUNSTDBY_Pos;
|
||||
((Gclk *)hw)->GENCTRL[index].reg = tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_RUNSTDBY;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_GENCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_RUNSTDBY;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_GENCTRL_SRC_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_SRC(mask);
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_genctrl_reg_t hri_gclk_get_GENCTRL_SRC_bf(const void *const hw, uint8_t index,
|
||||
hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_SRC(mask)) >> GCLK_GENCTRL_SRC_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_GENCTRL_SRC_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t data)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp &= ~GCLK_GENCTRL_SRC_Msk;
|
||||
tmp |= GCLK_GENCTRL_SRC(data);
|
||||
((Gclk *)hw)->GENCTRL[index].reg = tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_GENCTRL_SRC_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_SRC(mask);
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_GENCTRL_SRC_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_SRC(mask);
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_genctrl_reg_t hri_gclk_read_GENCTRL_SRC_bf(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_SRC_Msk) >> GCLK_GENCTRL_SRC_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_GENCTRL_DIV_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg |= GCLK_GENCTRL_DIV(mask);
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_genctrl_reg_t hri_gclk_get_GENCTRL_DIV_bf(const void *const hw, uint8_t index,
|
||||
hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_DIV(mask)) >> GCLK_GENCTRL_DIV_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_GENCTRL_DIV_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t data)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp &= ~GCLK_GENCTRL_DIV_Msk;
|
||||
tmp |= GCLK_GENCTRL_DIV(data);
|
||||
((Gclk *)hw)->GENCTRL[index].reg = tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_GENCTRL_DIV_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg &= ~GCLK_GENCTRL_DIV(mask);
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_GENCTRL_DIV_bf(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg ^= GCLK_GENCTRL_DIV(mask);
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_genctrl_reg_t hri_gclk_read_GENCTRL_DIV_bf(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_GENCTRL_DIV_Msk) >> GCLK_GENCTRL_DIV_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_GENCTRL_reg(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg |= mask;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_genctrl_reg_t hri_gclk_get_GENCTRL_reg(const void *const hw, uint8_t index,
|
||||
hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
tmp = ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_GENCTRL_reg(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t data)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg = data;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_GENCTRL_reg(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg &= ~mask;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_GENCTRL_reg(const void *const hw, uint8_t index, hri_gclk_genctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->GENCTRL[index].reg ^= mask;
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_genctrl_reg_t hri_gclk_read_GENCTRL_reg(const void *const hw, uint8_t index)
|
||||
{
|
||||
hri_gclk_wait_for_sync(hw, GCLK_SYNCBUSY_MASK);
|
||||
return ((Gclk *)hw)->GENCTRL[index].reg;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg |= GCLK_PCHCTRL_CHEN;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_PCHCTRL_CHEN) >> GCLK_PCHCTRL_CHEN_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
|
||||
tmp &= ~GCLK_PCHCTRL_CHEN;
|
||||
tmp |= value << GCLK_PCHCTRL_CHEN_Pos;
|
||||
((Gclk *)hw)->PCHCTRL[index].reg = tmp;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg &= ~GCLK_PCHCTRL_CHEN;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_PCHCTRL_CHEN_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg ^= GCLK_PCHCTRL_CHEN;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg |= GCLK_PCHCTRL_WRTLOCK;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_gclk_get_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_PCHCTRL_WRTLOCK) >> GCLK_PCHCTRL_WRTLOCK_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index, bool value)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
|
||||
tmp &= ~GCLK_PCHCTRL_WRTLOCK;
|
||||
tmp |= value << GCLK_PCHCTRL_WRTLOCK_Pos;
|
||||
((Gclk *)hw)->PCHCTRL[index].reg = tmp;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg &= ~GCLK_PCHCTRL_WRTLOCK;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_PCHCTRL_WRTLOCK_bit(const void *const hw, uint8_t index)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg ^= GCLK_PCHCTRL_WRTLOCK;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_PCHCTRL_GEN_bf(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg |= GCLK_PCHCTRL_GEN(mask);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_pchctrl_reg_t hri_gclk_get_PCHCTRL_GEN_bf(const void *const hw, uint8_t index,
|
||||
hri_gclk_pchctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_PCHCTRL_GEN(mask)) >> GCLK_PCHCTRL_GEN_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_PCHCTRL_GEN_bf(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t data)
|
||||
{
|
||||
uint32_t tmp;
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
|
||||
tmp &= ~GCLK_PCHCTRL_GEN_Msk;
|
||||
tmp |= GCLK_PCHCTRL_GEN(data);
|
||||
((Gclk *)hw)->PCHCTRL[index].reg = tmp;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_PCHCTRL_GEN_bf(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg &= ~GCLK_PCHCTRL_GEN(mask);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_PCHCTRL_GEN_bf(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg ^= GCLK_PCHCTRL_GEN(mask);
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_pchctrl_reg_t hri_gclk_read_PCHCTRL_GEN_bf(const void *const hw, uint8_t index)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
|
||||
tmp = (tmp & GCLK_PCHCTRL_GEN_Msk) >> GCLK_PCHCTRL_GEN_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_set_PCHCTRL_reg(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg |= mask;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_pchctrl_reg_t hri_gclk_get_PCHCTRL_reg(const void *const hw, uint8_t index,
|
||||
hri_gclk_pchctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Gclk *)hw)->PCHCTRL[index].reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_gclk_write_PCHCTRL_reg(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t data)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg = data;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_clear_PCHCTRL_reg(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg &= ~mask;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_gclk_toggle_PCHCTRL_reg(const void *const hw, uint8_t index, hri_gclk_pchctrl_reg_t mask)
|
||||
{
|
||||
GCLK_CRITICAL_SECTION_ENTER();
|
||||
((Gclk *)hw)->PCHCTRL[index].reg ^= mask;
|
||||
GCLK_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_gclk_pchctrl_reg_t hri_gclk_read_PCHCTRL_reg(const void *const hw, uint8_t index)
|
||||
{
|
||||
return ((Gclk *)hw)->PCHCTRL[index].reg;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_GCLK_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_GCLK_COMPONENT_ */
|
||||
3766
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_gmac_e54.h
Normal file
3766
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_gmac_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
237
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_hmatrixb_e54.h
Normal file
237
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_hmatrixb_e54.h
Normal file
@@ -0,0 +1,237 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM HMATRIXB
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_HMATRIXB_COMPONENT_
|
||||
#ifndef _HRI_HMATRIXB_E54_H_INCLUDED_
|
||||
#define _HRI_HMATRIXB_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_HMATRIXB_CRITICAL_SECTIONS)
|
||||
#define HMATRIXB_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define HMATRIXB_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define HMATRIXB_CRITICAL_SECTION_ENTER()
|
||||
#define HMATRIXB_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint32_t hri_hmatrixb_pras_reg_t;
|
||||
typedef uint32_t hri_hmatrixb_prbs_reg_t;
|
||||
typedef uint32_t hri_hmatrixbprs_pras_reg_t;
|
||||
typedef uint32_t hri_hmatrixbprs_prbs_reg_t;
|
||||
|
||||
static inline void hri_hmatrixbprs_set_PRAS_reg(const void *const hw, hri_hmatrixb_pras_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((HmatrixbPrs *)hw)->PRAS.reg |= mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_hmatrixb_pras_reg_t hri_hmatrixbprs_get_PRAS_reg(const void *const hw, hri_hmatrixb_pras_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((HmatrixbPrs *)hw)->PRAS.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixbprs_write_PRAS_reg(const void *const hw, hri_hmatrixb_pras_reg_t data)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((HmatrixbPrs *)hw)->PRAS.reg = data;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixbprs_clear_PRAS_reg(const void *const hw, hri_hmatrixb_pras_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((HmatrixbPrs *)hw)->PRAS.reg &= ~mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixbprs_toggle_PRAS_reg(const void *const hw, hri_hmatrixb_pras_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((HmatrixbPrs *)hw)->PRAS.reg ^= mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_hmatrixb_pras_reg_t hri_hmatrixbprs_read_PRAS_reg(const void *const hw)
|
||||
{
|
||||
return ((HmatrixbPrs *)hw)->PRAS.reg;
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixbprs_set_PRBS_reg(const void *const hw, hri_hmatrixb_prbs_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((HmatrixbPrs *)hw)->PRBS.reg |= mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_hmatrixb_prbs_reg_t hri_hmatrixbprs_get_PRBS_reg(const void *const hw, hri_hmatrixb_prbs_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((HmatrixbPrs *)hw)->PRBS.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixbprs_write_PRBS_reg(const void *const hw, hri_hmatrixb_prbs_reg_t data)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((HmatrixbPrs *)hw)->PRBS.reg = data;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixbprs_clear_PRBS_reg(const void *const hw, hri_hmatrixb_prbs_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((HmatrixbPrs *)hw)->PRBS.reg &= ~mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixbprs_toggle_PRBS_reg(const void *const hw, hri_hmatrixb_prbs_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((HmatrixbPrs *)hw)->PRBS.reg ^= mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_hmatrixb_prbs_reg_t hri_hmatrixbprs_read_PRBS_reg(const void *const hw)
|
||||
{
|
||||
return ((HmatrixbPrs *)hw)->PRBS.reg;
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixb_set_PRAS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_pras_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((Hmatrixb *)hw)->Prs[submodule_index].PRAS.reg |= mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_hmatrixb_pras_reg_t hri_hmatrixb_get_PRAS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_pras_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Hmatrixb *)hw)->Prs[submodule_index].PRAS.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixb_write_PRAS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_pras_reg_t data)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((Hmatrixb *)hw)->Prs[submodule_index].PRAS.reg = data;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixb_clear_PRAS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_pras_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((Hmatrixb *)hw)->Prs[submodule_index].PRAS.reg &= ~mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixb_toggle_PRAS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_pras_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((Hmatrixb *)hw)->Prs[submodule_index].PRAS.reg ^= mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_hmatrixb_pras_reg_t hri_hmatrixb_read_PRAS_reg(const void *const hw, uint8_t submodule_index)
|
||||
{
|
||||
return ((Hmatrixb *)hw)->Prs[submodule_index].PRAS.reg;
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixb_set_PRBS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_prbs_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((Hmatrixb *)hw)->Prs[submodule_index].PRBS.reg |= mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_hmatrixb_prbs_reg_t hri_hmatrixb_get_PRBS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_prbs_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Hmatrixb *)hw)->Prs[submodule_index].PRBS.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixb_write_PRBS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_prbs_reg_t data)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((Hmatrixb *)hw)->Prs[submodule_index].PRBS.reg = data;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixb_clear_PRBS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_prbs_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((Hmatrixb *)hw)->Prs[submodule_index].PRBS.reg &= ~mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_hmatrixb_toggle_PRBS_reg(const void *const hw, uint8_t submodule_index,
|
||||
hri_hmatrixb_prbs_reg_t mask)
|
||||
{
|
||||
HMATRIXB_CRITICAL_SECTION_ENTER();
|
||||
((Hmatrixb *)hw)->Prs[submodule_index].PRBS.reg ^= mask;
|
||||
HMATRIXB_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_hmatrixb_prbs_reg_t hri_hmatrixb_read_PRBS_reg(const void *const hw, uint8_t submodule_index)
|
||||
{
|
||||
return ((Hmatrixb *)hw)->Prs[submodule_index].PRBS.reg;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_HMATRIXB_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_HMATRIXB_COMPONENT_ */
|
||||
3032
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_i2s_e54.h
Normal file
3032
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_i2s_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
761
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_icm_e54.h
Normal file
761
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_icm_e54.h
Normal file
@@ -0,0 +1,761 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM ICM
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_ICM_COMPONENT_
|
||||
#ifndef _HRI_ICM_E54_H_INCLUDED_
|
||||
#define _HRI_ICM_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_ICM_CRITICAL_SECTIONS)
|
||||
#define ICM_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define ICM_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define ICM_CRITICAL_SECTION_ENTER()
|
||||
#define ICM_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint32_t hri_icm_cfg_reg_t;
|
||||
typedef uint32_t hri_icm_ctrl_reg_t;
|
||||
typedef uint32_t hri_icm_dscr_reg_t;
|
||||
typedef uint32_t hri_icm_hash_reg_t;
|
||||
typedef uint32_t hri_icm_imr_reg_t;
|
||||
typedef uint32_t hri_icm_isr_reg_t;
|
||||
typedef uint32_t hri_icm_sr_reg_t;
|
||||
typedef uint32_t hri_icm_uasr_reg_t;
|
||||
typedef uint32_t hri_icm_uihval_reg_t;
|
||||
typedef uint32_t hri_icmdescriptor_raddr_reg_t;
|
||||
typedef uint32_t hri_icmdescriptor_rcfg_reg_t;
|
||||
typedef uint32_t hri_icmdescriptor_rctrl_reg_t;
|
||||
typedef uint32_t hri_icmdescriptor_rnext_reg_t;
|
||||
|
||||
static inline void hri_icmdescriptor_set_RADDR_reg(const void *const hw, hri_icmdescriptor_raddr_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RADDR.reg |= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icmdescriptor_raddr_reg_t hri_icmdescriptor_get_RADDR_reg(const void *const hw,
|
||||
hri_icmdescriptor_raddr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((IcmDescriptor *)hw)->RADDR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_write_RADDR_reg(const void *const hw, hri_icmdescriptor_raddr_reg_t data)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RADDR.reg = data;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_clear_RADDR_reg(const void *const hw, hri_icmdescriptor_raddr_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RADDR.reg &= ~mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_toggle_RADDR_reg(const void *const hw, hri_icmdescriptor_raddr_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RADDR.reg ^= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icmdescriptor_raddr_reg_t hri_icmdescriptor_read_RADDR_reg(const void *const hw)
|
||||
{
|
||||
return ((IcmDescriptor *)hw)->RADDR.reg;
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_set_RCFG_reg(const void *const hw, hri_icmdescriptor_rcfg_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RCFG.reg |= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icmdescriptor_rcfg_reg_t hri_icmdescriptor_get_RCFG_reg(const void *const hw,
|
||||
hri_icmdescriptor_rcfg_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((IcmDescriptor *)hw)->RCFG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_write_RCFG_reg(const void *const hw, hri_icmdescriptor_rcfg_reg_t data)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RCFG.reg = data;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_clear_RCFG_reg(const void *const hw, hri_icmdescriptor_rcfg_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RCFG.reg &= ~mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_toggle_RCFG_reg(const void *const hw, hri_icmdescriptor_rcfg_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RCFG.reg ^= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icmdescriptor_rcfg_reg_t hri_icmdescriptor_read_RCFG_reg(const void *const hw)
|
||||
{
|
||||
return ((IcmDescriptor *)hw)->RCFG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_set_RCTRL_reg(const void *const hw, hri_icmdescriptor_rctrl_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RCTRL.reg |= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icmdescriptor_rctrl_reg_t hri_icmdescriptor_get_RCTRL_reg(const void *const hw,
|
||||
hri_icmdescriptor_rctrl_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((IcmDescriptor *)hw)->RCTRL.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_write_RCTRL_reg(const void *const hw, hri_icmdescriptor_rctrl_reg_t data)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RCTRL.reg = data;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_clear_RCTRL_reg(const void *const hw, hri_icmdescriptor_rctrl_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RCTRL.reg &= ~mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_toggle_RCTRL_reg(const void *const hw, hri_icmdescriptor_rctrl_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RCTRL.reg ^= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icmdescriptor_rctrl_reg_t hri_icmdescriptor_read_RCTRL_reg(const void *const hw)
|
||||
{
|
||||
return ((IcmDescriptor *)hw)->RCTRL.reg;
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_set_RNEXT_reg(const void *const hw, hri_icmdescriptor_rnext_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RNEXT.reg |= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icmdescriptor_rnext_reg_t hri_icmdescriptor_get_RNEXT_reg(const void *const hw,
|
||||
hri_icmdescriptor_rnext_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((IcmDescriptor *)hw)->RNEXT.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_write_RNEXT_reg(const void *const hw, hri_icmdescriptor_rnext_reg_t data)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RNEXT.reg = data;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_clear_RNEXT_reg(const void *const hw, hri_icmdescriptor_rnext_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RNEXT.reg &= ~mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icmdescriptor_toggle_RNEXT_reg(const void *const hw, hri_icmdescriptor_rnext_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((IcmDescriptor *)hw)->RNEXT.reg ^= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icmdescriptor_rnext_reg_t hri_icmdescriptor_read_RNEXT_reg(const void *const hw)
|
||||
{
|
||||
return ((IcmDescriptor *)hw)->RNEXT.reg;
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_IMR_URAD_bit(const void *const hw)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_URAD;
|
||||
}
|
||||
|
||||
static inline bool hri_icm_get_IMR_URAD_bit(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->IMR.reg & ICM_IMR_URAD) >> ICM_IMR_URAD_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_IMR_URAD_bit(const void *const hw, bool value)
|
||||
{
|
||||
if (value == 0x0) {
|
||||
((Icm *)hw)->IDR.reg = ICM_IMR_URAD;
|
||||
} else {
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_URAD;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_IMR_URAD_bit(const void *const hw)
|
||||
{
|
||||
((Icm *)hw)->IDR.reg = ICM_IMR_URAD;
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_IMR_RHC_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RHC(mask);
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_get_IMR_RHC_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RHC(mask)) >> ICM_IMR_RHC_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_read_IMR_RHC_bf(const void *const hw)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RHC_Msk) >> ICM_IMR_RHC_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_IMR_RHC_bf(const void *const hw, hri_icm_imr_reg_t data)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RHC(data);
|
||||
((Icm *)hw)->IDR.reg = ~ICM_IMR_RHC(data);
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_IMR_RHC_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IDR.reg = ICM_IMR_RHC(mask);
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_IMR_RDM_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RDM(mask);
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_get_IMR_RDM_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RDM(mask)) >> ICM_IMR_RDM_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_read_IMR_RDM_bf(const void *const hw)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RDM_Msk) >> ICM_IMR_RDM_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_IMR_RDM_bf(const void *const hw, hri_icm_imr_reg_t data)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RDM(data);
|
||||
((Icm *)hw)->IDR.reg = ~ICM_IMR_RDM(data);
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_IMR_RDM_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IDR.reg = ICM_IMR_RDM(mask);
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_IMR_RBE_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RBE(mask);
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_get_IMR_RBE_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RBE(mask)) >> ICM_IMR_RBE_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_read_IMR_RBE_bf(const void *const hw)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RBE_Msk) >> ICM_IMR_RBE_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_IMR_RBE_bf(const void *const hw, hri_icm_imr_reg_t data)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RBE(data);
|
||||
((Icm *)hw)->IDR.reg = ~ICM_IMR_RBE(data);
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_IMR_RBE_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IDR.reg = ICM_IMR_RBE(mask);
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_IMR_RWC_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RWC(mask);
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_get_IMR_RWC_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RWC(mask)) >> ICM_IMR_RWC_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_read_IMR_RWC_bf(const void *const hw)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RWC_Msk) >> ICM_IMR_RWC_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_IMR_RWC_bf(const void *const hw, hri_icm_imr_reg_t data)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RWC(data);
|
||||
((Icm *)hw)->IDR.reg = ~ICM_IMR_RWC(data);
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_IMR_RWC_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IDR.reg = ICM_IMR_RWC(mask);
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_IMR_REC_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_REC(mask);
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_get_IMR_REC_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_REC(mask)) >> ICM_IMR_REC_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_read_IMR_REC_bf(const void *const hw)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_REC_Msk) >> ICM_IMR_REC_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_IMR_REC_bf(const void *const hw, hri_icm_imr_reg_t data)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_REC(data);
|
||||
((Icm *)hw)->IDR.reg = ~ICM_IMR_REC(data);
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_IMR_REC_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IDR.reg = ICM_IMR_REC(mask);
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_IMR_RSU_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RSU(mask);
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_get_IMR_RSU_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RSU(mask)) >> ICM_IMR_RSU_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_read_IMR_RSU_bf(const void *const hw)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp = (tmp & ICM_IMR_RSU_Msk) >> ICM_IMR_RSU_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_IMR_RSU_bf(const void *const hw, hri_icm_imr_reg_t data)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = ICM_IMR_RSU(data);
|
||||
((Icm *)hw)->IDR.reg = ~ICM_IMR_RSU(data);
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_IMR_RSU_bf(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IDR.reg = ICM_IMR_RSU(mask);
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_IMR_reg(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = mask;
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_get_IMR_reg(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->IMR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_imr_reg_t hri_icm_read_IMR_reg(const void *const hw)
|
||||
{
|
||||
return ((Icm *)hw)->IMR.reg;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_IMR_reg(const void *const hw, hri_icm_imr_reg_t data)
|
||||
{
|
||||
((Icm *)hw)->IER.reg = data;
|
||||
((Icm *)hw)->IDR.reg = ~data;
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_IMR_reg(const void *const hw, hri_icm_imr_reg_t mask)
|
||||
{
|
||||
((Icm *)hw)->IDR.reg = mask;
|
||||
}
|
||||
|
||||
static inline bool hri_icm_get_SR_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->SR.reg & ICM_SR_ENABLE) >> ICM_SR_ENABLE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_sr_reg_t hri_icm_get_SR_RAWRMDIS_bf(const void *const hw, hri_icm_sr_reg_t mask)
|
||||
{
|
||||
return (((Icm *)hw)->SR.reg & ICM_SR_RAWRMDIS(mask)) >> ICM_SR_RAWRMDIS_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_sr_reg_t hri_icm_read_SR_RAWRMDIS_bf(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->SR.reg & ICM_SR_RAWRMDIS_Msk) >> ICM_SR_RAWRMDIS_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_sr_reg_t hri_icm_get_SR_RMDIS_bf(const void *const hw, hri_icm_sr_reg_t mask)
|
||||
{
|
||||
return (((Icm *)hw)->SR.reg & ICM_SR_RMDIS(mask)) >> ICM_SR_RMDIS_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_sr_reg_t hri_icm_read_SR_RMDIS_bf(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->SR.reg & ICM_SR_RMDIS_Msk) >> ICM_SR_RMDIS_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_sr_reg_t hri_icm_get_SR_reg(const void *const hw, hri_icm_sr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->SR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_sr_reg_t hri_icm_read_SR_reg(const void *const hw)
|
||||
{
|
||||
return ((Icm *)hw)->SR.reg;
|
||||
}
|
||||
|
||||
static inline bool hri_icm_get_ISR_URAD_bit(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_URAD) >> ICM_ISR_URAD_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_get_ISR_RHC_bf(const void *const hw, hri_icm_isr_reg_t mask)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RHC(mask)) >> ICM_ISR_RHC_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_read_ISR_RHC_bf(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RHC_Msk) >> ICM_ISR_RHC_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_get_ISR_RDM_bf(const void *const hw, hri_icm_isr_reg_t mask)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RDM(mask)) >> ICM_ISR_RDM_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_read_ISR_RDM_bf(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RDM_Msk) >> ICM_ISR_RDM_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_get_ISR_RBE_bf(const void *const hw, hri_icm_isr_reg_t mask)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RBE(mask)) >> ICM_ISR_RBE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_read_ISR_RBE_bf(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RBE_Msk) >> ICM_ISR_RBE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_get_ISR_RWC_bf(const void *const hw, hri_icm_isr_reg_t mask)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RWC(mask)) >> ICM_ISR_RWC_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_read_ISR_RWC_bf(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RWC_Msk) >> ICM_ISR_RWC_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_get_ISR_REC_bf(const void *const hw, hri_icm_isr_reg_t mask)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_REC(mask)) >> ICM_ISR_REC_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_read_ISR_REC_bf(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_REC_Msk) >> ICM_ISR_REC_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_get_ISR_RSU_bf(const void *const hw, hri_icm_isr_reg_t mask)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RSU(mask)) >> ICM_ISR_RSU_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_read_ISR_RSU_bf(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->ISR.reg & ICM_ISR_RSU_Msk) >> ICM_ISR_RSU_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_get_ISR_reg(const void *const hw, hri_icm_isr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->ISR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_isr_reg_t hri_icm_read_ISR_reg(const void *const hw)
|
||||
{
|
||||
return ((Icm *)hw)->ISR.reg;
|
||||
}
|
||||
|
||||
static inline hri_icm_uasr_reg_t hri_icm_get_UASR_URAT_bf(const void *const hw, hri_icm_uasr_reg_t mask)
|
||||
{
|
||||
return (((Icm *)hw)->UASR.reg & ICM_UASR_URAT(mask)) >> ICM_UASR_URAT_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_uasr_reg_t hri_icm_read_UASR_URAT_bf(const void *const hw)
|
||||
{
|
||||
return (((Icm *)hw)->UASR.reg & ICM_UASR_URAT_Msk) >> ICM_UASR_URAT_Pos;
|
||||
}
|
||||
|
||||
static inline hri_icm_uasr_reg_t hri_icm_get_UASR_reg(const void *const hw, hri_icm_uasr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->UASR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_icm_uasr_reg_t hri_icm_read_UASR_reg(const void *const hw)
|
||||
{
|
||||
return ((Icm *)hw)->UASR.reg;
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_CFG_reg(const void *const hw, hri_icm_cfg_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->CFG.reg |= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icm_cfg_reg_t hri_icm_get_CFG_reg(const void *const hw, hri_icm_cfg_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->CFG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_CFG_reg(const void *const hw, hri_icm_cfg_reg_t data)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->CFG.reg = data;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_CFG_reg(const void *const hw, hri_icm_cfg_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->CFG.reg &= ~mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icm_toggle_CFG_reg(const void *const hw, hri_icm_cfg_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->CFG.reg ^= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icm_cfg_reg_t hri_icm_read_CFG_reg(const void *const hw)
|
||||
{
|
||||
return ((Icm *)hw)->CFG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_DSCR_reg(const void *const hw, hri_icm_dscr_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->DSCR.reg |= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icm_dscr_reg_t hri_icm_get_DSCR_reg(const void *const hw, hri_icm_dscr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->DSCR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_DSCR_reg(const void *const hw, hri_icm_dscr_reg_t data)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->DSCR.reg = data;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_DSCR_reg(const void *const hw, hri_icm_dscr_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->DSCR.reg &= ~mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icm_toggle_DSCR_reg(const void *const hw, hri_icm_dscr_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->DSCR.reg ^= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icm_dscr_reg_t hri_icm_read_DSCR_reg(const void *const hw)
|
||||
{
|
||||
return ((Icm *)hw)->DSCR.reg;
|
||||
}
|
||||
|
||||
static inline void hri_icm_set_HASH_reg(const void *const hw, hri_icm_hash_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->HASH.reg |= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icm_hash_reg_t hri_icm_get_HASH_reg(const void *const hw, hri_icm_hash_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Icm *)hw)->HASH.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_HASH_reg(const void *const hw, hri_icm_hash_reg_t data)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->HASH.reg = data;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icm_clear_HASH_reg(const void *const hw, hri_icm_hash_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->HASH.reg &= ~mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icm_toggle_HASH_reg(const void *const hw, hri_icm_hash_reg_t mask)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->HASH.reg ^= mask;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_icm_hash_reg_t hri_icm_read_HASH_reg(const void *const hw)
|
||||
{
|
||||
return ((Icm *)hw)->HASH.reg;
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_CTRL_reg(const void *const hw, hri_icm_ctrl_reg_t data)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->CTRL.reg = data;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_icm_write_UIHVAL_reg(const void *const hw, uint8_t index, hri_icm_uihval_reg_t data)
|
||||
{
|
||||
ICM_CRITICAL_SECTION_ENTER();
|
||||
((Icm *)hw)->UIHVAL[index].reg = data;
|
||||
ICM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_ICM_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_ICM_COMPONENT_ */
|
||||
3556
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_mclk_e54.h
Normal file
3556
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_mclk_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
1618
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_nvmctrl_e54.h
Normal file
1618
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_nvmctrl_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
1199
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_osc32kctrl_e54.h
Normal file
1199
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_osc32kctrl_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
4441
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_oscctrl_e54.h
Normal file
4441
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_oscctrl_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
1514
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_pac_e54.h
Normal file
1514
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_pac_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
298
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_pcc_e54.h
Normal file
298
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_pcc_e54.h
Normal file
@@ -0,0 +1,298 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM PCC
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_PCC_COMPONENT_
|
||||
#ifndef _HRI_PCC_E54_H_INCLUDED_
|
||||
#define _HRI_PCC_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_PCC_CRITICAL_SECTIONS)
|
||||
#define PCC_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define PCC_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define PCC_CRITICAL_SECTION_ENTER()
|
||||
#define PCC_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint32_t hri_pcc_imr_reg_t;
|
||||
typedef uint32_t hri_pcc_isr_reg_t;
|
||||
typedef uint32_t hri_pcc_mr_reg_t;
|
||||
typedef uint32_t hri_pcc_rhr_reg_t;
|
||||
typedef uint32_t hri_pcc_wpmr_reg_t;
|
||||
typedef uint32_t hri_pcc_wpsr_reg_t;
|
||||
|
||||
static inline void hri_pcc_set_IMR_DRDY_bit(const void *const hw)
|
||||
{
|
||||
((Pcc *)hw)->IER.reg = PCC_IMR_DRDY;
|
||||
}
|
||||
|
||||
static inline bool hri_pcc_get_IMR_DRDY_bit(const void *const hw)
|
||||
{
|
||||
return (((Pcc *)hw)->IMR.reg & PCC_IMR_DRDY) >> PCC_IMR_DRDY_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_write_IMR_DRDY_bit(const void *const hw, bool value)
|
||||
{
|
||||
if (value == 0x0) {
|
||||
((Pcc *)hw)->IDR.reg = PCC_IMR_DRDY;
|
||||
} else {
|
||||
((Pcc *)hw)->IER.reg = PCC_IMR_DRDY;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void hri_pcc_clear_IMR_DRDY_bit(const void *const hw)
|
||||
{
|
||||
((Pcc *)hw)->IDR.reg = PCC_IMR_DRDY;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_set_IMR_OVRE_bit(const void *const hw)
|
||||
{
|
||||
((Pcc *)hw)->IER.reg = PCC_IMR_OVRE;
|
||||
}
|
||||
|
||||
static inline bool hri_pcc_get_IMR_OVRE_bit(const void *const hw)
|
||||
{
|
||||
return (((Pcc *)hw)->IMR.reg & PCC_IMR_OVRE) >> PCC_IMR_OVRE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_write_IMR_OVRE_bit(const void *const hw, bool value)
|
||||
{
|
||||
if (value == 0x0) {
|
||||
((Pcc *)hw)->IDR.reg = PCC_IMR_OVRE;
|
||||
} else {
|
||||
((Pcc *)hw)->IER.reg = PCC_IMR_OVRE;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void hri_pcc_clear_IMR_OVRE_bit(const void *const hw)
|
||||
{
|
||||
((Pcc *)hw)->IDR.reg = PCC_IMR_OVRE;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_set_IMR_reg(const void *const hw, hri_pcc_imr_reg_t mask)
|
||||
{
|
||||
((Pcc *)hw)->IER.reg = mask;
|
||||
}
|
||||
|
||||
static inline hri_pcc_imr_reg_t hri_pcc_get_IMR_reg(const void *const hw, hri_pcc_imr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Pcc *)hw)->IMR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_pcc_imr_reg_t hri_pcc_read_IMR_reg(const void *const hw)
|
||||
{
|
||||
return ((Pcc *)hw)->IMR.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_write_IMR_reg(const void *const hw, hri_pcc_imr_reg_t data)
|
||||
{
|
||||
((Pcc *)hw)->IER.reg = data;
|
||||
((Pcc *)hw)->IDR.reg = ~data;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_clear_IMR_reg(const void *const hw, hri_pcc_imr_reg_t mask)
|
||||
{
|
||||
((Pcc *)hw)->IDR.reg = mask;
|
||||
}
|
||||
|
||||
static inline bool hri_pcc_get_ISR_DRDY_bit(const void *const hw)
|
||||
{
|
||||
return (((Pcc *)hw)->ISR.reg & PCC_ISR_DRDY) >> PCC_ISR_DRDY_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_pcc_get_ISR_OVRE_bit(const void *const hw)
|
||||
{
|
||||
return (((Pcc *)hw)->ISR.reg & PCC_ISR_OVRE) >> PCC_ISR_OVRE_Pos;
|
||||
}
|
||||
|
||||
static inline hri_pcc_isr_reg_t hri_pcc_get_ISR_reg(const void *const hw, hri_pcc_isr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Pcc *)hw)->ISR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_pcc_isr_reg_t hri_pcc_read_ISR_reg(const void *const hw)
|
||||
{
|
||||
return ((Pcc *)hw)->ISR.reg;
|
||||
}
|
||||
|
||||
static inline hri_pcc_rhr_reg_t hri_pcc_get_RHR_RDATA_bf(const void *const hw, hri_pcc_rhr_reg_t mask)
|
||||
{
|
||||
return (((Pcc *)hw)->RHR.reg & PCC_RHR_RDATA(mask)) >> PCC_RHR_RDATA_Pos;
|
||||
}
|
||||
|
||||
static inline hri_pcc_rhr_reg_t hri_pcc_read_RHR_RDATA_bf(const void *const hw)
|
||||
{
|
||||
return (((Pcc *)hw)->RHR.reg & PCC_RHR_RDATA_Msk) >> PCC_RHR_RDATA_Pos;
|
||||
}
|
||||
|
||||
static inline hri_pcc_rhr_reg_t hri_pcc_get_RHR_reg(const void *const hw, hri_pcc_rhr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Pcc *)hw)->RHR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_pcc_rhr_reg_t hri_pcc_read_RHR_reg(const void *const hw)
|
||||
{
|
||||
return ((Pcc *)hw)->RHR.reg;
|
||||
}
|
||||
|
||||
static inline bool hri_pcc_get_WPSR_WPVS_bit(const void *const hw)
|
||||
{
|
||||
return (((Pcc *)hw)->WPSR.reg & PCC_WPSR_WPVS) >> PCC_WPSR_WPVS_Pos;
|
||||
}
|
||||
|
||||
static inline hri_pcc_wpsr_reg_t hri_pcc_get_WPSR_WPVSRC_bf(const void *const hw, hri_pcc_wpsr_reg_t mask)
|
||||
{
|
||||
return (((Pcc *)hw)->WPSR.reg & PCC_WPSR_WPVSRC(mask)) >> PCC_WPSR_WPVSRC_Pos;
|
||||
}
|
||||
|
||||
static inline hri_pcc_wpsr_reg_t hri_pcc_read_WPSR_WPVSRC_bf(const void *const hw)
|
||||
{
|
||||
return (((Pcc *)hw)->WPSR.reg & PCC_WPSR_WPVSRC_Msk) >> PCC_WPSR_WPVSRC_Pos;
|
||||
}
|
||||
|
||||
static inline hri_pcc_wpsr_reg_t hri_pcc_get_WPSR_reg(const void *const hw, hri_pcc_wpsr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Pcc *)hw)->WPSR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_pcc_wpsr_reg_t hri_pcc_read_WPSR_reg(const void *const hw)
|
||||
{
|
||||
return ((Pcc *)hw)->WPSR.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_set_MR_reg(const void *const hw, hri_pcc_mr_reg_t mask)
|
||||
{
|
||||
PCC_CRITICAL_SECTION_ENTER();
|
||||
((Pcc *)hw)->MR.reg |= mask;
|
||||
PCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pcc_mr_reg_t hri_pcc_get_MR_reg(const void *const hw, hri_pcc_mr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Pcc *)hw)->MR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_write_MR_reg(const void *const hw, hri_pcc_mr_reg_t data)
|
||||
{
|
||||
PCC_CRITICAL_SECTION_ENTER();
|
||||
((Pcc *)hw)->MR.reg = data;
|
||||
PCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pcc_clear_MR_reg(const void *const hw, hri_pcc_mr_reg_t mask)
|
||||
{
|
||||
PCC_CRITICAL_SECTION_ENTER();
|
||||
((Pcc *)hw)->MR.reg &= ~mask;
|
||||
PCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pcc_toggle_MR_reg(const void *const hw, hri_pcc_mr_reg_t mask)
|
||||
{
|
||||
PCC_CRITICAL_SECTION_ENTER();
|
||||
((Pcc *)hw)->MR.reg ^= mask;
|
||||
PCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pcc_mr_reg_t hri_pcc_read_MR_reg(const void *const hw)
|
||||
{
|
||||
return ((Pcc *)hw)->MR.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_set_WPMR_reg(const void *const hw, hri_pcc_wpmr_reg_t mask)
|
||||
{
|
||||
PCC_CRITICAL_SECTION_ENTER();
|
||||
((Pcc *)hw)->WPMR.reg |= mask;
|
||||
PCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pcc_wpmr_reg_t hri_pcc_get_WPMR_reg(const void *const hw, hri_pcc_wpmr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Pcc *)hw)->WPMR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pcc_write_WPMR_reg(const void *const hw, hri_pcc_wpmr_reg_t data)
|
||||
{
|
||||
PCC_CRITICAL_SECTION_ENTER();
|
||||
((Pcc *)hw)->WPMR.reg = data;
|
||||
PCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pcc_clear_WPMR_reg(const void *const hw, hri_pcc_wpmr_reg_t mask)
|
||||
{
|
||||
PCC_CRITICAL_SECTION_ENTER();
|
||||
((Pcc *)hw)->WPMR.reg &= ~mask;
|
||||
PCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pcc_toggle_WPMR_reg(const void *const hw, hri_pcc_wpmr_reg_t mask)
|
||||
{
|
||||
PCC_CRITICAL_SECTION_ENTER();
|
||||
((Pcc *)hw)->WPMR.reg ^= mask;
|
||||
PCC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pcc_wpmr_reg_t hri_pcc_read_WPMR_reg(const void *const hw)
|
||||
{
|
||||
return ((Pcc *)hw)->WPMR.reg;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_PCC_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_PCC_COMPONENT_ */
|
||||
2684
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_pdec_e54.h
Normal file
2684
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_pdec_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
820
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_pm_e54.h
Normal file
820
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_pm_e54.h
Normal file
@@ -0,0 +1,820 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM PM
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_PM_COMPONENT_
|
||||
#ifndef _HRI_PM_E54_H_INCLUDED_
|
||||
#define _HRI_PM_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_PM_CRITICAL_SECTIONS)
|
||||
#define PM_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define PM_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define PM_CRITICAL_SECTION_ENTER()
|
||||
#define PM_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint8_t hri_pm_bkupcfg_reg_t;
|
||||
typedef uint8_t hri_pm_ctrla_reg_t;
|
||||
typedef uint8_t hri_pm_hibcfg_reg_t;
|
||||
typedef uint8_t hri_pm_intenset_reg_t;
|
||||
typedef uint8_t hri_pm_intflag_reg_t;
|
||||
typedef uint8_t hri_pm_pwsakdly_reg_t;
|
||||
typedef uint8_t hri_pm_sleepcfg_reg_t;
|
||||
typedef uint8_t hri_pm_stdbycfg_reg_t;
|
||||
|
||||
static inline bool hri_pm_get_INTFLAG_SLEEPRDY_bit(const void *const hw)
|
||||
{
|
||||
return (((Pm *)hw)->INTFLAG.reg & PM_INTFLAG_SLEEPRDY) >> PM_INTFLAG_SLEEPRDY_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_INTFLAG_SLEEPRDY_bit(const void *const hw)
|
||||
{
|
||||
((Pm *)hw)->INTFLAG.reg = PM_INTFLAG_SLEEPRDY;
|
||||
}
|
||||
|
||||
static inline bool hri_pm_get_interrupt_SLEEPRDY_bit(const void *const hw)
|
||||
{
|
||||
return (((Pm *)hw)->INTFLAG.reg & PM_INTFLAG_SLEEPRDY) >> PM_INTFLAG_SLEEPRDY_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_interrupt_SLEEPRDY_bit(const void *const hw)
|
||||
{
|
||||
((Pm *)hw)->INTFLAG.reg = PM_INTFLAG_SLEEPRDY;
|
||||
}
|
||||
|
||||
static inline hri_pm_intflag_reg_t hri_pm_get_INTFLAG_reg(const void *const hw, hri_pm_intflag_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->INTFLAG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_pm_intflag_reg_t hri_pm_read_INTFLAG_reg(const void *const hw)
|
||||
{
|
||||
return ((Pm *)hw)->INTFLAG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_INTFLAG_reg(const void *const hw, hri_pm_intflag_reg_t mask)
|
||||
{
|
||||
((Pm *)hw)->INTFLAG.reg = mask;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_INTEN_SLEEPRDY_bit(const void *const hw)
|
||||
{
|
||||
((Pm *)hw)->INTENSET.reg = PM_INTENSET_SLEEPRDY;
|
||||
}
|
||||
|
||||
static inline bool hri_pm_get_INTEN_SLEEPRDY_bit(const void *const hw)
|
||||
{
|
||||
return (((Pm *)hw)->INTENSET.reg & PM_INTENSET_SLEEPRDY) >> PM_INTENSET_SLEEPRDY_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_INTEN_SLEEPRDY_bit(const void *const hw, bool value)
|
||||
{
|
||||
if (value == 0x0) {
|
||||
((Pm *)hw)->INTENCLR.reg = PM_INTENSET_SLEEPRDY;
|
||||
} else {
|
||||
((Pm *)hw)->INTENSET.reg = PM_INTENSET_SLEEPRDY;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_INTEN_SLEEPRDY_bit(const void *const hw)
|
||||
{
|
||||
((Pm *)hw)->INTENCLR.reg = PM_INTENSET_SLEEPRDY;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_INTEN_reg(const void *const hw, hri_pm_intenset_reg_t mask)
|
||||
{
|
||||
((Pm *)hw)->INTENSET.reg = mask;
|
||||
}
|
||||
|
||||
static inline hri_pm_intenset_reg_t hri_pm_get_INTEN_reg(const void *const hw, hri_pm_intenset_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->INTENSET.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_pm_intenset_reg_t hri_pm_read_INTEN_reg(const void *const hw)
|
||||
{
|
||||
return ((Pm *)hw)->INTENSET.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_INTEN_reg(const void *const hw, hri_pm_intenset_reg_t data)
|
||||
{
|
||||
((Pm *)hw)->INTENSET.reg = data;
|
||||
((Pm *)hw)->INTENCLR.reg = ~data;
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_INTEN_reg(const void *const hw, hri_pm_intenset_reg_t mask)
|
||||
{
|
||||
((Pm *)hw)->INTENCLR.reg = mask;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_CTRLA_IORET_bit(const void *const hw)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->CTRLA.reg |= PM_CTRLA_IORET;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_pm_get_CTRLA_IORET_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->CTRLA.reg;
|
||||
tmp = (tmp & PM_CTRLA_IORET) >> PM_CTRLA_IORET_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_CTRLA_IORET_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Pm *)hw)->CTRLA.reg;
|
||||
tmp &= ~PM_CTRLA_IORET;
|
||||
tmp |= value << PM_CTRLA_IORET_Pos;
|
||||
((Pm *)hw)->CTRLA.reg = tmp;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_CTRLA_IORET_bit(const void *const hw)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->CTRLA.reg &= ~PM_CTRLA_IORET;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_CTRLA_IORET_bit(const void *const hw)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->CTRLA.reg ^= PM_CTRLA_IORET;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_CTRLA_reg(const void *const hw, hri_pm_ctrla_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->CTRLA.reg |= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_ctrla_reg_t hri_pm_get_CTRLA_reg(const void *const hw, hri_pm_ctrla_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->CTRLA.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_CTRLA_reg(const void *const hw, hri_pm_ctrla_reg_t data)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->CTRLA.reg = data;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_CTRLA_reg(const void *const hw, hri_pm_ctrla_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->CTRLA.reg &= ~mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_CTRLA_reg(const void *const hw, hri_pm_ctrla_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->CTRLA.reg ^= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_ctrla_reg_t hri_pm_read_CTRLA_reg(const void *const hw)
|
||||
{
|
||||
return ((Pm *)hw)->CTRLA.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_SLEEPCFG_SLEEPMODE_bf(const void *const hw, hri_pm_sleepcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->SLEEPCFG.reg |= PM_SLEEPCFG_SLEEPMODE(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_sleepcfg_reg_t hri_pm_get_SLEEPCFG_SLEEPMODE_bf(const void *const hw, hri_pm_sleepcfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->SLEEPCFG.reg;
|
||||
tmp = (tmp & PM_SLEEPCFG_SLEEPMODE(mask)) >> PM_SLEEPCFG_SLEEPMODE_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_SLEEPCFG_SLEEPMODE_bf(const void *const hw, hri_pm_sleepcfg_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Pm *)hw)->SLEEPCFG.reg;
|
||||
tmp &= ~PM_SLEEPCFG_SLEEPMODE_Msk;
|
||||
tmp |= PM_SLEEPCFG_SLEEPMODE(data);
|
||||
((Pm *)hw)->SLEEPCFG.reg = tmp;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_SLEEPCFG_SLEEPMODE_bf(const void *const hw, hri_pm_sleepcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->SLEEPCFG.reg &= ~PM_SLEEPCFG_SLEEPMODE(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_SLEEPCFG_SLEEPMODE_bf(const void *const hw, hri_pm_sleepcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->SLEEPCFG.reg ^= PM_SLEEPCFG_SLEEPMODE(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_sleepcfg_reg_t hri_pm_read_SLEEPCFG_SLEEPMODE_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->SLEEPCFG.reg;
|
||||
tmp = (tmp & PM_SLEEPCFG_SLEEPMODE_Msk) >> PM_SLEEPCFG_SLEEPMODE_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_SLEEPCFG_reg(const void *const hw, hri_pm_sleepcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->SLEEPCFG.reg |= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_sleepcfg_reg_t hri_pm_get_SLEEPCFG_reg(const void *const hw, hri_pm_sleepcfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->SLEEPCFG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_SLEEPCFG_reg(const void *const hw, hri_pm_sleepcfg_reg_t data)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->SLEEPCFG.reg = data;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_SLEEPCFG_reg(const void *const hw, hri_pm_sleepcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->SLEEPCFG.reg &= ~mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_SLEEPCFG_reg(const void *const hw, hri_pm_sleepcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->SLEEPCFG.reg ^= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_sleepcfg_reg_t hri_pm_read_SLEEPCFG_reg(const void *const hw)
|
||||
{
|
||||
return ((Pm *)hw)->SLEEPCFG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_STDBYCFG_RAMCFG_bf(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg |= PM_STDBYCFG_RAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_stdbycfg_reg_t hri_pm_get_STDBYCFG_RAMCFG_bf(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->STDBYCFG.reg;
|
||||
tmp = (tmp & PM_STDBYCFG_RAMCFG(mask)) >> PM_STDBYCFG_RAMCFG_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_STDBYCFG_RAMCFG_bf(const void *const hw, hri_pm_stdbycfg_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Pm *)hw)->STDBYCFG.reg;
|
||||
tmp &= ~PM_STDBYCFG_RAMCFG_Msk;
|
||||
tmp |= PM_STDBYCFG_RAMCFG(data);
|
||||
((Pm *)hw)->STDBYCFG.reg = tmp;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_STDBYCFG_RAMCFG_bf(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg &= ~PM_STDBYCFG_RAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_STDBYCFG_RAMCFG_bf(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg ^= PM_STDBYCFG_RAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_stdbycfg_reg_t hri_pm_read_STDBYCFG_RAMCFG_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->STDBYCFG.reg;
|
||||
tmp = (tmp & PM_STDBYCFG_RAMCFG_Msk) >> PM_STDBYCFG_RAMCFG_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_STDBYCFG_FASTWKUP_bf(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg |= PM_STDBYCFG_FASTWKUP(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_stdbycfg_reg_t hri_pm_get_STDBYCFG_FASTWKUP_bf(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->STDBYCFG.reg;
|
||||
tmp = (tmp & PM_STDBYCFG_FASTWKUP(mask)) >> PM_STDBYCFG_FASTWKUP_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_STDBYCFG_FASTWKUP_bf(const void *const hw, hri_pm_stdbycfg_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Pm *)hw)->STDBYCFG.reg;
|
||||
tmp &= ~PM_STDBYCFG_FASTWKUP_Msk;
|
||||
tmp |= PM_STDBYCFG_FASTWKUP(data);
|
||||
((Pm *)hw)->STDBYCFG.reg = tmp;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_STDBYCFG_FASTWKUP_bf(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg &= ~PM_STDBYCFG_FASTWKUP(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_STDBYCFG_FASTWKUP_bf(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg ^= PM_STDBYCFG_FASTWKUP(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_stdbycfg_reg_t hri_pm_read_STDBYCFG_FASTWKUP_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->STDBYCFG.reg;
|
||||
tmp = (tmp & PM_STDBYCFG_FASTWKUP_Msk) >> PM_STDBYCFG_FASTWKUP_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_STDBYCFG_reg(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg |= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_stdbycfg_reg_t hri_pm_get_STDBYCFG_reg(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->STDBYCFG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_STDBYCFG_reg(const void *const hw, hri_pm_stdbycfg_reg_t data)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg = data;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_STDBYCFG_reg(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg &= ~mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_STDBYCFG_reg(const void *const hw, hri_pm_stdbycfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->STDBYCFG.reg ^= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_stdbycfg_reg_t hri_pm_read_STDBYCFG_reg(const void *const hw)
|
||||
{
|
||||
return ((Pm *)hw)->STDBYCFG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_HIBCFG_RAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg |= PM_HIBCFG_RAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_hibcfg_reg_t hri_pm_get_HIBCFG_RAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->HIBCFG.reg;
|
||||
tmp = (tmp & PM_HIBCFG_RAMCFG(mask)) >> PM_HIBCFG_RAMCFG_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_HIBCFG_RAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Pm *)hw)->HIBCFG.reg;
|
||||
tmp &= ~PM_HIBCFG_RAMCFG_Msk;
|
||||
tmp |= PM_HIBCFG_RAMCFG(data);
|
||||
((Pm *)hw)->HIBCFG.reg = tmp;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_HIBCFG_RAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg &= ~PM_HIBCFG_RAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_HIBCFG_RAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg ^= PM_HIBCFG_RAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_hibcfg_reg_t hri_pm_read_HIBCFG_RAMCFG_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->HIBCFG.reg;
|
||||
tmp = (tmp & PM_HIBCFG_RAMCFG_Msk) >> PM_HIBCFG_RAMCFG_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_HIBCFG_BRAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg |= PM_HIBCFG_BRAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_hibcfg_reg_t hri_pm_get_HIBCFG_BRAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->HIBCFG.reg;
|
||||
tmp = (tmp & PM_HIBCFG_BRAMCFG(mask)) >> PM_HIBCFG_BRAMCFG_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_HIBCFG_BRAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Pm *)hw)->HIBCFG.reg;
|
||||
tmp &= ~PM_HIBCFG_BRAMCFG_Msk;
|
||||
tmp |= PM_HIBCFG_BRAMCFG(data);
|
||||
((Pm *)hw)->HIBCFG.reg = tmp;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_HIBCFG_BRAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg &= ~PM_HIBCFG_BRAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_HIBCFG_BRAMCFG_bf(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg ^= PM_HIBCFG_BRAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_hibcfg_reg_t hri_pm_read_HIBCFG_BRAMCFG_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->HIBCFG.reg;
|
||||
tmp = (tmp & PM_HIBCFG_BRAMCFG_Msk) >> PM_HIBCFG_BRAMCFG_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_HIBCFG_reg(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg |= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_hibcfg_reg_t hri_pm_get_HIBCFG_reg(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->HIBCFG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_HIBCFG_reg(const void *const hw, hri_pm_hibcfg_reg_t data)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg = data;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_HIBCFG_reg(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg &= ~mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_HIBCFG_reg(const void *const hw, hri_pm_hibcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->HIBCFG.reg ^= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_hibcfg_reg_t hri_pm_read_HIBCFG_reg(const void *const hw)
|
||||
{
|
||||
return ((Pm *)hw)->HIBCFG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_BKUPCFG_BRAMCFG_bf(const void *const hw, hri_pm_bkupcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->BKUPCFG.reg |= PM_BKUPCFG_BRAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_bkupcfg_reg_t hri_pm_get_BKUPCFG_BRAMCFG_bf(const void *const hw, hri_pm_bkupcfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->BKUPCFG.reg;
|
||||
tmp = (tmp & PM_BKUPCFG_BRAMCFG(mask)) >> PM_BKUPCFG_BRAMCFG_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_BKUPCFG_BRAMCFG_bf(const void *const hw, hri_pm_bkupcfg_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Pm *)hw)->BKUPCFG.reg;
|
||||
tmp &= ~PM_BKUPCFG_BRAMCFG_Msk;
|
||||
tmp |= PM_BKUPCFG_BRAMCFG(data);
|
||||
((Pm *)hw)->BKUPCFG.reg = tmp;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_BKUPCFG_BRAMCFG_bf(const void *const hw, hri_pm_bkupcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->BKUPCFG.reg &= ~PM_BKUPCFG_BRAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_BKUPCFG_BRAMCFG_bf(const void *const hw, hri_pm_bkupcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->BKUPCFG.reg ^= PM_BKUPCFG_BRAMCFG(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_bkupcfg_reg_t hri_pm_read_BKUPCFG_BRAMCFG_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->BKUPCFG.reg;
|
||||
tmp = (tmp & PM_BKUPCFG_BRAMCFG_Msk) >> PM_BKUPCFG_BRAMCFG_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_BKUPCFG_reg(const void *const hw, hri_pm_bkupcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->BKUPCFG.reg |= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_bkupcfg_reg_t hri_pm_get_BKUPCFG_reg(const void *const hw, hri_pm_bkupcfg_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->BKUPCFG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_BKUPCFG_reg(const void *const hw, hri_pm_bkupcfg_reg_t data)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->BKUPCFG.reg = data;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_BKUPCFG_reg(const void *const hw, hri_pm_bkupcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->BKUPCFG.reg &= ~mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_BKUPCFG_reg(const void *const hw, hri_pm_bkupcfg_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->BKUPCFG.reg ^= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_bkupcfg_reg_t hri_pm_read_BKUPCFG_reg(const void *const hw)
|
||||
{
|
||||
return ((Pm *)hw)->BKUPCFG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_PWSAKDLY_IGNACK_bit(const void *const hw)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg |= PM_PWSAKDLY_IGNACK;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_pm_get_PWSAKDLY_IGNACK_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->PWSAKDLY.reg;
|
||||
tmp = (tmp & PM_PWSAKDLY_IGNACK) >> PM_PWSAKDLY_IGNACK_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_PWSAKDLY_IGNACK_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Pm *)hw)->PWSAKDLY.reg;
|
||||
tmp &= ~PM_PWSAKDLY_IGNACK;
|
||||
tmp |= value << PM_PWSAKDLY_IGNACK_Pos;
|
||||
((Pm *)hw)->PWSAKDLY.reg = tmp;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_PWSAKDLY_IGNACK_bit(const void *const hw)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg &= ~PM_PWSAKDLY_IGNACK;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_PWSAKDLY_IGNACK_bit(const void *const hw)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg ^= PM_PWSAKDLY_IGNACK;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_PWSAKDLY_DLYVAL_bf(const void *const hw, hri_pm_pwsakdly_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg |= PM_PWSAKDLY_DLYVAL(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_pwsakdly_reg_t hri_pm_get_PWSAKDLY_DLYVAL_bf(const void *const hw, hri_pm_pwsakdly_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->PWSAKDLY.reg;
|
||||
tmp = (tmp & PM_PWSAKDLY_DLYVAL(mask)) >> PM_PWSAKDLY_DLYVAL_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_PWSAKDLY_DLYVAL_bf(const void *const hw, hri_pm_pwsakdly_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Pm *)hw)->PWSAKDLY.reg;
|
||||
tmp &= ~PM_PWSAKDLY_DLYVAL_Msk;
|
||||
tmp |= PM_PWSAKDLY_DLYVAL(data);
|
||||
((Pm *)hw)->PWSAKDLY.reg = tmp;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_PWSAKDLY_DLYVAL_bf(const void *const hw, hri_pm_pwsakdly_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg &= ~PM_PWSAKDLY_DLYVAL(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_PWSAKDLY_DLYVAL_bf(const void *const hw, hri_pm_pwsakdly_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg ^= PM_PWSAKDLY_DLYVAL(mask);
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_pwsakdly_reg_t hri_pm_read_PWSAKDLY_DLYVAL_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->PWSAKDLY.reg;
|
||||
tmp = (tmp & PM_PWSAKDLY_DLYVAL_Msk) >> PM_PWSAKDLY_DLYVAL_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_set_PWSAKDLY_reg(const void *const hw, hri_pm_pwsakdly_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg |= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_pwsakdly_reg_t hri_pm_get_PWSAKDLY_reg(const void *const hw, hri_pm_pwsakdly_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Pm *)hw)->PWSAKDLY.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_pm_write_PWSAKDLY_reg(const void *const hw, hri_pm_pwsakdly_reg_t data)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg = data;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_clear_PWSAKDLY_reg(const void *const hw, hri_pm_pwsakdly_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg &= ~mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_pm_toggle_PWSAKDLY_reg(const void *const hw, hri_pm_pwsakdly_reg_t mask)
|
||||
{
|
||||
PM_CRITICAL_SECTION_ENTER();
|
||||
((Pm *)hw)->PWSAKDLY.reg ^= mask;
|
||||
PM_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_pm_pwsakdly_reg_t hri_pm_read_PWSAKDLY_reg(const void *const hw)
|
||||
{
|
||||
return ((Pm *)hw)->PWSAKDLY.reg;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_PM_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_PM_COMPONENT_ */
|
||||
2528
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_port_e54.h
Normal file
2528
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_port_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
2058
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_qspi_e54.h
Normal file
2058
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_qspi_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
362
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_ramecc_e54.h
Normal file
362
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_ramecc_e54.h
Normal file
@@ -0,0 +1,362 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM RAMECC
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_RAMECC_COMPONENT_
|
||||
#ifndef _HRI_RAMECC_E54_H_INCLUDED_
|
||||
#define _HRI_RAMECC_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_RAMECC_CRITICAL_SECTIONS)
|
||||
#define RAMECC_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define RAMECC_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define RAMECC_CRITICAL_SECTION_ENTER()
|
||||
#define RAMECC_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint32_t hri_ramecc_erraddr_reg_t;
|
||||
typedef uint8_t hri_ramecc_dbgctrl_reg_t;
|
||||
typedef uint8_t hri_ramecc_intenset_reg_t;
|
||||
typedef uint8_t hri_ramecc_intflag_reg_t;
|
||||
typedef uint8_t hri_ramecc_status_reg_t;
|
||||
|
||||
static inline bool hri_ramecc_get_INTFLAG_SINGLEE_bit(const void *const hw)
|
||||
{
|
||||
return (((Ramecc *)hw)->INTFLAG.reg & RAMECC_INTFLAG_SINGLEE) >> RAMECC_INTFLAG_SINGLEE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_INTFLAG_SINGLEE_bit(const void *const hw)
|
||||
{
|
||||
((Ramecc *)hw)->INTFLAG.reg = RAMECC_INTFLAG_SINGLEE;
|
||||
}
|
||||
|
||||
static inline bool hri_ramecc_get_INTFLAG_DUALE_bit(const void *const hw)
|
||||
{
|
||||
return (((Ramecc *)hw)->INTFLAG.reg & RAMECC_INTFLAG_DUALE) >> RAMECC_INTFLAG_DUALE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_INTFLAG_DUALE_bit(const void *const hw)
|
||||
{
|
||||
((Ramecc *)hw)->INTFLAG.reg = RAMECC_INTFLAG_DUALE;
|
||||
}
|
||||
|
||||
static inline bool hri_ramecc_get_interrupt_SINGLEE_bit(const void *const hw)
|
||||
{
|
||||
return (((Ramecc *)hw)->INTFLAG.reg & RAMECC_INTFLAG_SINGLEE) >> RAMECC_INTFLAG_SINGLEE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_interrupt_SINGLEE_bit(const void *const hw)
|
||||
{
|
||||
((Ramecc *)hw)->INTFLAG.reg = RAMECC_INTFLAG_SINGLEE;
|
||||
}
|
||||
|
||||
static inline bool hri_ramecc_get_interrupt_DUALE_bit(const void *const hw)
|
||||
{
|
||||
return (((Ramecc *)hw)->INTFLAG.reg & RAMECC_INTFLAG_DUALE) >> RAMECC_INTFLAG_DUALE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_interrupt_DUALE_bit(const void *const hw)
|
||||
{
|
||||
((Ramecc *)hw)->INTFLAG.reg = RAMECC_INTFLAG_DUALE;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_intflag_reg_t hri_ramecc_get_INTFLAG_reg(const void *const hw, hri_ramecc_intflag_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ramecc *)hw)->INTFLAG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_intflag_reg_t hri_ramecc_read_INTFLAG_reg(const void *const hw)
|
||||
{
|
||||
return ((Ramecc *)hw)->INTFLAG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_INTFLAG_reg(const void *const hw, hri_ramecc_intflag_reg_t mask)
|
||||
{
|
||||
((Ramecc *)hw)->INTFLAG.reg = mask;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_set_INTEN_SINGLEE_bit(const void *const hw)
|
||||
{
|
||||
((Ramecc *)hw)->INTENSET.reg = RAMECC_INTENSET_SINGLEE;
|
||||
}
|
||||
|
||||
static inline bool hri_ramecc_get_INTEN_SINGLEE_bit(const void *const hw)
|
||||
{
|
||||
return (((Ramecc *)hw)->INTENSET.reg & RAMECC_INTENSET_SINGLEE) >> RAMECC_INTENSET_SINGLEE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_write_INTEN_SINGLEE_bit(const void *const hw, bool value)
|
||||
{
|
||||
if (value == 0x0) {
|
||||
((Ramecc *)hw)->INTENCLR.reg = RAMECC_INTENSET_SINGLEE;
|
||||
} else {
|
||||
((Ramecc *)hw)->INTENSET.reg = RAMECC_INTENSET_SINGLEE;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_INTEN_SINGLEE_bit(const void *const hw)
|
||||
{
|
||||
((Ramecc *)hw)->INTENCLR.reg = RAMECC_INTENSET_SINGLEE;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_set_INTEN_DUALE_bit(const void *const hw)
|
||||
{
|
||||
((Ramecc *)hw)->INTENSET.reg = RAMECC_INTENSET_DUALE;
|
||||
}
|
||||
|
||||
static inline bool hri_ramecc_get_INTEN_DUALE_bit(const void *const hw)
|
||||
{
|
||||
return (((Ramecc *)hw)->INTENSET.reg & RAMECC_INTENSET_DUALE) >> RAMECC_INTENSET_DUALE_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_write_INTEN_DUALE_bit(const void *const hw, bool value)
|
||||
{
|
||||
if (value == 0x0) {
|
||||
((Ramecc *)hw)->INTENCLR.reg = RAMECC_INTENSET_DUALE;
|
||||
} else {
|
||||
((Ramecc *)hw)->INTENSET.reg = RAMECC_INTENSET_DUALE;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_INTEN_DUALE_bit(const void *const hw)
|
||||
{
|
||||
((Ramecc *)hw)->INTENCLR.reg = RAMECC_INTENSET_DUALE;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_set_INTEN_reg(const void *const hw, hri_ramecc_intenset_reg_t mask)
|
||||
{
|
||||
((Ramecc *)hw)->INTENSET.reg = mask;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_intenset_reg_t hri_ramecc_get_INTEN_reg(const void *const hw, hri_ramecc_intenset_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ramecc *)hw)->INTENSET.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_intenset_reg_t hri_ramecc_read_INTEN_reg(const void *const hw)
|
||||
{
|
||||
return ((Ramecc *)hw)->INTENSET.reg;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_write_INTEN_reg(const void *const hw, hri_ramecc_intenset_reg_t data)
|
||||
{
|
||||
((Ramecc *)hw)->INTENSET.reg = data;
|
||||
((Ramecc *)hw)->INTENCLR.reg = ~data;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_INTEN_reg(const void *const hw, hri_ramecc_intenset_reg_t mask)
|
||||
{
|
||||
((Ramecc *)hw)->INTENCLR.reg = mask;
|
||||
}
|
||||
|
||||
static inline bool hri_ramecc_get_STATUS_ECCDIS_bit(const void *const hw)
|
||||
{
|
||||
return (((Ramecc *)hw)->STATUS.reg & RAMECC_STATUS_ECCDIS) >> RAMECC_STATUS_ECCDIS_Pos;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_status_reg_t hri_ramecc_get_STATUS_reg(const void *const hw, hri_ramecc_status_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ramecc *)hw)->STATUS.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_status_reg_t hri_ramecc_read_STATUS_reg(const void *const hw)
|
||||
{
|
||||
return ((Ramecc *)hw)->STATUS.reg;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_erraddr_reg_t hri_ramecc_get_ERRADDR_ERRADDR_bf(const void *const hw,
|
||||
hri_ramecc_erraddr_reg_t mask)
|
||||
{
|
||||
return (((Ramecc *)hw)->ERRADDR.reg & RAMECC_ERRADDR_ERRADDR(mask)) >> RAMECC_ERRADDR_ERRADDR_Pos;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_erraddr_reg_t hri_ramecc_read_ERRADDR_ERRADDR_bf(const void *const hw)
|
||||
{
|
||||
return (((Ramecc *)hw)->ERRADDR.reg & RAMECC_ERRADDR_ERRADDR_Msk) >> RAMECC_ERRADDR_ERRADDR_Pos;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_erraddr_reg_t hri_ramecc_get_ERRADDR_reg(const void *const hw, hri_ramecc_erraddr_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Ramecc *)hw)->ERRADDR.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_ramecc_erraddr_reg_t hri_ramecc_read_ERRADDR_reg(const void *const hw)
|
||||
{
|
||||
return ((Ramecc *)hw)->ERRADDR.reg;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_set_DBGCTRL_ECCDIS_bit(const void *const hw)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg |= RAMECC_DBGCTRL_ECCDIS;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ramecc_get_DBGCTRL_ECCDIS_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ramecc *)hw)->DBGCTRL.reg;
|
||||
tmp = (tmp & RAMECC_DBGCTRL_ECCDIS) >> RAMECC_DBGCTRL_ECCDIS_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_write_DBGCTRL_ECCDIS_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ramecc *)hw)->DBGCTRL.reg;
|
||||
tmp &= ~RAMECC_DBGCTRL_ECCDIS;
|
||||
tmp |= value << RAMECC_DBGCTRL_ECCDIS_Pos;
|
||||
((Ramecc *)hw)->DBGCTRL.reg = tmp;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_DBGCTRL_ECCDIS_bit(const void *const hw)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg &= ~RAMECC_DBGCTRL_ECCDIS;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_toggle_DBGCTRL_ECCDIS_bit(const void *const hw)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg ^= RAMECC_DBGCTRL_ECCDIS;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_set_DBGCTRL_ECCELOG_bit(const void *const hw)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg |= RAMECC_DBGCTRL_ECCELOG;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_ramecc_get_DBGCTRL_ECCELOG_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ramecc *)hw)->DBGCTRL.reg;
|
||||
tmp = (tmp & RAMECC_DBGCTRL_ECCELOG) >> RAMECC_DBGCTRL_ECCELOG_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_write_DBGCTRL_ECCELOG_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Ramecc *)hw)->DBGCTRL.reg;
|
||||
tmp &= ~RAMECC_DBGCTRL_ECCELOG;
|
||||
tmp |= value << RAMECC_DBGCTRL_ECCELOG_Pos;
|
||||
((Ramecc *)hw)->DBGCTRL.reg = tmp;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_DBGCTRL_ECCELOG_bit(const void *const hw)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg &= ~RAMECC_DBGCTRL_ECCELOG;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_toggle_DBGCTRL_ECCELOG_bit(const void *const hw)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg ^= RAMECC_DBGCTRL_ECCELOG;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_set_DBGCTRL_reg(const void *const hw, hri_ramecc_dbgctrl_reg_t mask)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg |= mask;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ramecc_dbgctrl_reg_t hri_ramecc_get_DBGCTRL_reg(const void *const hw, hri_ramecc_dbgctrl_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Ramecc *)hw)->DBGCTRL.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_write_DBGCTRL_reg(const void *const hw, hri_ramecc_dbgctrl_reg_t data)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg = data;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_clear_DBGCTRL_reg(const void *const hw, hri_ramecc_dbgctrl_reg_t mask)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg &= ~mask;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_ramecc_toggle_DBGCTRL_reg(const void *const hw, hri_ramecc_dbgctrl_reg_t mask)
|
||||
{
|
||||
RAMECC_CRITICAL_SECTION_ENTER();
|
||||
((Ramecc *)hw)->DBGCTRL.reg ^= mask;
|
||||
RAMECC_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_ramecc_dbgctrl_reg_t hri_ramecc_read_DBGCTRL_reg(const void *const hw)
|
||||
{
|
||||
return ((Ramecc *)hw)->DBGCTRL.reg;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_RAMECC_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_RAMECC_COMPONENT_ */
|
||||
142
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_rstc_e54.h
Normal file
142
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_rstc_e54.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM RSTC
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_RSTC_COMPONENT_
|
||||
#ifndef _HRI_RSTC_E54_H_INCLUDED_
|
||||
#define _HRI_RSTC_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_RSTC_CRITICAL_SECTIONS)
|
||||
#define RSTC_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define RSTC_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define RSTC_CRITICAL_SECTION_ENTER()
|
||||
#define RSTC_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint8_t hri_rstc_bkupexit_reg_t;
|
||||
typedef uint8_t hri_rstc_rcause_reg_t;
|
||||
|
||||
static inline bool hri_rstc_get_RCAUSE_POR_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->RCAUSE.reg & RSTC_RCAUSE_POR) >> RSTC_RCAUSE_POR_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_RCAUSE_BODCORE_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->RCAUSE.reg & RSTC_RCAUSE_BODCORE) >> RSTC_RCAUSE_BODCORE_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_RCAUSE_BODVDD_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->RCAUSE.reg & RSTC_RCAUSE_BODVDD) >> RSTC_RCAUSE_BODVDD_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_RCAUSE_NVM_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->RCAUSE.reg & RSTC_RCAUSE_NVM) >> RSTC_RCAUSE_NVM_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_RCAUSE_EXT_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->RCAUSE.reg & RSTC_RCAUSE_EXT) >> RSTC_RCAUSE_EXT_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_RCAUSE_WDT_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->RCAUSE.reg & RSTC_RCAUSE_WDT) >> RSTC_RCAUSE_WDT_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_RCAUSE_SYST_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->RCAUSE.reg & RSTC_RCAUSE_SYST) >> RSTC_RCAUSE_SYST_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_RCAUSE_BACKUP_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->RCAUSE.reg & RSTC_RCAUSE_BACKUP) >> RSTC_RCAUSE_BACKUP_Pos;
|
||||
}
|
||||
|
||||
static inline hri_rstc_rcause_reg_t hri_rstc_get_RCAUSE_reg(const void *const hw, hri_rstc_rcause_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Rstc *)hw)->RCAUSE.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_rstc_rcause_reg_t hri_rstc_read_RCAUSE_reg(const void *const hw)
|
||||
{
|
||||
return ((Rstc *)hw)->RCAUSE.reg;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_BKUPEXIT_RTC_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->BKUPEXIT.reg & RSTC_BKUPEXIT_RTC) >> RSTC_BKUPEXIT_RTC_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_BKUPEXIT_BBPS_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->BKUPEXIT.reg & RSTC_BKUPEXIT_BBPS) >> RSTC_BKUPEXIT_BBPS_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_rstc_get_BKUPEXIT_HIB_bit(const void *const hw)
|
||||
{
|
||||
return (((Rstc *)hw)->BKUPEXIT.reg & RSTC_BKUPEXIT_HIB) >> RSTC_BKUPEXIT_HIB_Pos;
|
||||
}
|
||||
|
||||
static inline hri_rstc_bkupexit_reg_t hri_rstc_get_BKUPEXIT_reg(const void *const hw, hri_rstc_bkupexit_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Rstc *)hw)->BKUPEXIT.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_rstc_bkupexit_reg_t hri_rstc_read_BKUPEXIT_reg(const void *const hw)
|
||||
{
|
||||
return ((Rstc *)hw)->BKUPEXIT.reg;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_RSTC_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_RSTC_COMPONENT_ */
|
||||
10139
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_rtc_e54.h
Normal file
10139
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_rtc_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
7477
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_sdhc_e54.h
Normal file
7477
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_sdhc_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
8892
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_sercom_e54.h
Normal file
8892
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_sercom_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
1769
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_supc_e54.h
Normal file
1769
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_supc_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
3003
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_tc_e54.h
Normal file
3003
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_tc_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
9992
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_tcc_e54.h
Normal file
9992
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_tcc_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
380
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_trng_e54.h
Normal file
380
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_trng_e54.h
Normal file
@@ -0,0 +1,380 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM TRNG
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_TRNG_COMPONENT_
|
||||
#ifndef _HRI_TRNG_E54_H_INCLUDED_
|
||||
#define _HRI_TRNG_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_TRNG_CRITICAL_SECTIONS)
|
||||
#define TRNG_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define TRNG_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define TRNG_CRITICAL_SECTION_ENTER()
|
||||
#define TRNG_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint32_t hri_trng_data_reg_t;
|
||||
typedef uint8_t hri_trng_ctrla_reg_t;
|
||||
typedef uint8_t hri_trng_evctrl_reg_t;
|
||||
typedef uint8_t hri_trng_intenset_reg_t;
|
||||
typedef uint8_t hri_trng_intflag_reg_t;
|
||||
|
||||
static inline bool hri_trng_get_INTFLAG_DATARDY_bit(const void *const hw)
|
||||
{
|
||||
return (((Trng *)hw)->INTFLAG.reg & TRNG_INTFLAG_DATARDY) >> TRNG_INTFLAG_DATARDY_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_INTFLAG_DATARDY_bit(const void *const hw)
|
||||
{
|
||||
((Trng *)hw)->INTFLAG.reg = TRNG_INTFLAG_DATARDY;
|
||||
}
|
||||
|
||||
static inline bool hri_trng_get_interrupt_DATARDY_bit(const void *const hw)
|
||||
{
|
||||
return (((Trng *)hw)->INTFLAG.reg & TRNG_INTFLAG_DATARDY) >> TRNG_INTFLAG_DATARDY_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_interrupt_DATARDY_bit(const void *const hw)
|
||||
{
|
||||
((Trng *)hw)->INTFLAG.reg = TRNG_INTFLAG_DATARDY;
|
||||
}
|
||||
|
||||
static inline hri_trng_intflag_reg_t hri_trng_get_INTFLAG_reg(const void *const hw, hri_trng_intflag_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Trng *)hw)->INTFLAG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_trng_intflag_reg_t hri_trng_read_INTFLAG_reg(const void *const hw)
|
||||
{
|
||||
return ((Trng *)hw)->INTFLAG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_INTFLAG_reg(const void *const hw, hri_trng_intflag_reg_t mask)
|
||||
{
|
||||
((Trng *)hw)->INTFLAG.reg = mask;
|
||||
}
|
||||
|
||||
static inline void hri_trng_set_INTEN_DATARDY_bit(const void *const hw)
|
||||
{
|
||||
((Trng *)hw)->INTENSET.reg = TRNG_INTENSET_DATARDY;
|
||||
}
|
||||
|
||||
static inline bool hri_trng_get_INTEN_DATARDY_bit(const void *const hw)
|
||||
{
|
||||
return (((Trng *)hw)->INTENSET.reg & TRNG_INTENSET_DATARDY) >> TRNG_INTENSET_DATARDY_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_trng_write_INTEN_DATARDY_bit(const void *const hw, bool value)
|
||||
{
|
||||
if (value == 0x0) {
|
||||
((Trng *)hw)->INTENCLR.reg = TRNG_INTENSET_DATARDY;
|
||||
} else {
|
||||
((Trng *)hw)->INTENSET.reg = TRNG_INTENSET_DATARDY;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_INTEN_DATARDY_bit(const void *const hw)
|
||||
{
|
||||
((Trng *)hw)->INTENCLR.reg = TRNG_INTENSET_DATARDY;
|
||||
}
|
||||
|
||||
static inline void hri_trng_set_INTEN_reg(const void *const hw, hri_trng_intenset_reg_t mask)
|
||||
{
|
||||
((Trng *)hw)->INTENSET.reg = mask;
|
||||
}
|
||||
|
||||
static inline hri_trng_intenset_reg_t hri_trng_get_INTEN_reg(const void *const hw, hri_trng_intenset_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Trng *)hw)->INTENSET.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_trng_intenset_reg_t hri_trng_read_INTEN_reg(const void *const hw)
|
||||
{
|
||||
return ((Trng *)hw)->INTENSET.reg;
|
||||
}
|
||||
|
||||
static inline void hri_trng_write_INTEN_reg(const void *const hw, hri_trng_intenset_reg_t data)
|
||||
{
|
||||
((Trng *)hw)->INTENSET.reg = data;
|
||||
((Trng *)hw)->INTENCLR.reg = ~data;
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_INTEN_reg(const void *const hw, hri_trng_intenset_reg_t mask)
|
||||
{
|
||||
((Trng *)hw)->INTENCLR.reg = mask;
|
||||
}
|
||||
|
||||
static inline hri_trng_data_reg_t hri_trng_get_DATA_DATA_bf(const void *const hw, hri_trng_data_reg_t mask)
|
||||
{
|
||||
return (((Trng *)hw)->DATA.reg & TRNG_DATA_DATA(mask)) >> TRNG_DATA_DATA_Pos;
|
||||
}
|
||||
|
||||
static inline hri_trng_data_reg_t hri_trng_read_DATA_DATA_bf(const void *const hw)
|
||||
{
|
||||
return (((Trng *)hw)->DATA.reg & TRNG_DATA_DATA_Msk) >> TRNG_DATA_DATA_Pos;
|
||||
}
|
||||
|
||||
static inline hri_trng_data_reg_t hri_trng_get_DATA_reg(const void *const hw, hri_trng_data_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Trng *)hw)->DATA.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_trng_data_reg_t hri_trng_read_DATA_reg(const void *const hw)
|
||||
{
|
||||
return ((Trng *)hw)->DATA.reg;
|
||||
}
|
||||
|
||||
static inline void hri_trng_set_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg |= TRNG_CTRLA_ENABLE;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_trng_get_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Trng *)hw)->CTRLA.reg;
|
||||
tmp = (tmp & TRNG_CTRLA_ENABLE) >> TRNG_CTRLA_ENABLE_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_trng_write_CTRLA_ENABLE_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Trng *)hw)->CTRLA.reg;
|
||||
tmp &= ~TRNG_CTRLA_ENABLE;
|
||||
tmp |= value << TRNG_CTRLA_ENABLE_Pos;
|
||||
((Trng *)hw)->CTRLA.reg = tmp;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg &= ~TRNG_CTRLA_ENABLE;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_toggle_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg ^= TRNG_CTRLA_ENABLE;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_set_CTRLA_RUNSTDBY_bit(const void *const hw)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg |= TRNG_CTRLA_RUNSTDBY;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_trng_get_CTRLA_RUNSTDBY_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Trng *)hw)->CTRLA.reg;
|
||||
tmp = (tmp & TRNG_CTRLA_RUNSTDBY) >> TRNG_CTRLA_RUNSTDBY_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_trng_write_CTRLA_RUNSTDBY_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Trng *)hw)->CTRLA.reg;
|
||||
tmp &= ~TRNG_CTRLA_RUNSTDBY;
|
||||
tmp |= value << TRNG_CTRLA_RUNSTDBY_Pos;
|
||||
((Trng *)hw)->CTRLA.reg = tmp;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_CTRLA_RUNSTDBY_bit(const void *const hw)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg &= ~TRNG_CTRLA_RUNSTDBY;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_toggle_CTRLA_RUNSTDBY_bit(const void *const hw)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg ^= TRNG_CTRLA_RUNSTDBY;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_set_CTRLA_reg(const void *const hw, hri_trng_ctrla_reg_t mask)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg |= mask;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_trng_ctrla_reg_t hri_trng_get_CTRLA_reg(const void *const hw, hri_trng_ctrla_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Trng *)hw)->CTRLA.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_trng_write_CTRLA_reg(const void *const hw, hri_trng_ctrla_reg_t data)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg = data;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_CTRLA_reg(const void *const hw, hri_trng_ctrla_reg_t mask)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg &= ~mask;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_toggle_CTRLA_reg(const void *const hw, hri_trng_ctrla_reg_t mask)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->CTRLA.reg ^= mask;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_trng_ctrla_reg_t hri_trng_read_CTRLA_reg(const void *const hw)
|
||||
{
|
||||
return ((Trng *)hw)->CTRLA.reg;
|
||||
}
|
||||
|
||||
static inline void hri_trng_set_EVCTRL_DATARDYEO_bit(const void *const hw)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->EVCTRL.reg |= TRNG_EVCTRL_DATARDYEO;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_trng_get_EVCTRL_DATARDYEO_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Trng *)hw)->EVCTRL.reg;
|
||||
tmp = (tmp & TRNG_EVCTRL_DATARDYEO) >> TRNG_EVCTRL_DATARDYEO_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_trng_write_EVCTRL_DATARDYEO_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Trng *)hw)->EVCTRL.reg;
|
||||
tmp &= ~TRNG_EVCTRL_DATARDYEO;
|
||||
tmp |= value << TRNG_EVCTRL_DATARDYEO_Pos;
|
||||
((Trng *)hw)->EVCTRL.reg = tmp;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_EVCTRL_DATARDYEO_bit(const void *const hw)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->EVCTRL.reg &= ~TRNG_EVCTRL_DATARDYEO;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_toggle_EVCTRL_DATARDYEO_bit(const void *const hw)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->EVCTRL.reg ^= TRNG_EVCTRL_DATARDYEO;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_set_EVCTRL_reg(const void *const hw, hri_trng_evctrl_reg_t mask)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->EVCTRL.reg |= mask;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_trng_evctrl_reg_t hri_trng_get_EVCTRL_reg(const void *const hw, hri_trng_evctrl_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Trng *)hw)->EVCTRL.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_trng_write_EVCTRL_reg(const void *const hw, hri_trng_evctrl_reg_t data)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->EVCTRL.reg = data;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_clear_EVCTRL_reg(const void *const hw, hri_trng_evctrl_reg_t mask)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->EVCTRL.reg &= ~mask;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_trng_toggle_EVCTRL_reg(const void *const hw, hri_trng_evctrl_reg_t mask)
|
||||
{
|
||||
TRNG_CRITICAL_SECTION_ENTER();
|
||||
((Trng *)hw)->EVCTRL.reg ^= mask;
|
||||
TRNG_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_trng_evctrl_reg_t hri_trng_read_EVCTRL_reg(const void *const hw)
|
||||
{
|
||||
return ((Trng *)hw)->EVCTRL.reg;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_TRNG_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_TRNG_COMPONENT_ */
|
||||
9335
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_usb_e54.h
Normal file
9335
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_usb_e54.h
Normal file
File diff suppressed because it is too large
Load Diff
617
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_wdt_e54.h
Normal file
617
Examples/SPISLAVEDMA/SPISLAVEDMA(3)/hri/hri_wdt_e54.h
Normal file
@@ -0,0 +1,617 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief SAM WDT
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _SAME54_WDT_COMPONENT_
|
||||
#ifndef _HRI_WDT_E54_H_INCLUDED_
|
||||
#define _HRI_WDT_E54_H_INCLUDED_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <hal_atomic.h>
|
||||
|
||||
#if defined(ENABLE_WDT_CRITICAL_SECTIONS)
|
||||
#define WDT_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
|
||||
#define WDT_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
|
||||
#else
|
||||
#define WDT_CRITICAL_SECTION_ENTER()
|
||||
#define WDT_CRITICAL_SECTION_LEAVE()
|
||||
#endif
|
||||
|
||||
typedef uint32_t hri_wdt_syncbusy_reg_t;
|
||||
typedef uint8_t hri_wdt_clear_reg_t;
|
||||
typedef uint8_t hri_wdt_config_reg_t;
|
||||
typedef uint8_t hri_wdt_ctrla_reg_t;
|
||||
typedef uint8_t hri_wdt_ewctrl_reg_t;
|
||||
typedef uint8_t hri_wdt_intenset_reg_t;
|
||||
typedef uint8_t hri_wdt_intflag_reg_t;
|
||||
|
||||
static inline void hri_wdt_wait_for_sync(const void *const hw, hri_wdt_syncbusy_reg_t reg)
|
||||
{
|
||||
while (((Wdt *)hw)->SYNCBUSY.reg & reg) {
|
||||
};
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_is_syncing(const void *const hw, hri_wdt_syncbusy_reg_t reg)
|
||||
{
|
||||
return ((Wdt *)hw)->SYNCBUSY.reg & reg;
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_INTFLAG_EW_bit(const void *const hw)
|
||||
{
|
||||
return (((Wdt *)hw)->INTFLAG.reg & WDT_INTFLAG_EW) >> WDT_INTFLAG_EW_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_INTFLAG_EW_bit(const void *const hw)
|
||||
{
|
||||
((Wdt *)hw)->INTFLAG.reg = WDT_INTFLAG_EW;
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_interrupt_EW_bit(const void *const hw)
|
||||
{
|
||||
return (((Wdt *)hw)->INTFLAG.reg & WDT_INTFLAG_EW) >> WDT_INTFLAG_EW_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_interrupt_EW_bit(const void *const hw)
|
||||
{
|
||||
((Wdt *)hw)->INTFLAG.reg = WDT_INTFLAG_EW;
|
||||
}
|
||||
|
||||
static inline hri_wdt_intflag_reg_t hri_wdt_get_INTFLAG_reg(const void *const hw, hri_wdt_intflag_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->INTFLAG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_wdt_intflag_reg_t hri_wdt_read_INTFLAG_reg(const void *const hw)
|
||||
{
|
||||
return ((Wdt *)hw)->INTFLAG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_INTFLAG_reg(const void *const hw, hri_wdt_intflag_reg_t mask)
|
||||
{
|
||||
((Wdt *)hw)->INTFLAG.reg = mask;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_INTEN_EW_bit(const void *const hw)
|
||||
{
|
||||
((Wdt *)hw)->INTENSET.reg = WDT_INTENSET_EW;
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_INTEN_EW_bit(const void *const hw)
|
||||
{
|
||||
return (((Wdt *)hw)->INTENSET.reg & WDT_INTENSET_EW) >> WDT_INTENSET_EW_Pos;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_INTEN_EW_bit(const void *const hw, bool value)
|
||||
{
|
||||
if (value == 0x0) {
|
||||
((Wdt *)hw)->INTENCLR.reg = WDT_INTENSET_EW;
|
||||
} else {
|
||||
((Wdt *)hw)->INTENSET.reg = WDT_INTENSET_EW;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_INTEN_EW_bit(const void *const hw)
|
||||
{
|
||||
((Wdt *)hw)->INTENCLR.reg = WDT_INTENSET_EW;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_INTEN_reg(const void *const hw, hri_wdt_intenset_reg_t mask)
|
||||
{
|
||||
((Wdt *)hw)->INTENSET.reg = mask;
|
||||
}
|
||||
|
||||
static inline hri_wdt_intenset_reg_t hri_wdt_get_INTEN_reg(const void *const hw, hri_wdt_intenset_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->INTENSET.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_wdt_intenset_reg_t hri_wdt_read_INTEN_reg(const void *const hw)
|
||||
{
|
||||
return ((Wdt *)hw)->INTENSET.reg;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_INTEN_reg(const void *const hw, hri_wdt_intenset_reg_t data)
|
||||
{
|
||||
((Wdt *)hw)->INTENSET.reg = data;
|
||||
((Wdt *)hw)->INTENCLR.reg = ~data;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_INTEN_reg(const void *const hw, hri_wdt_intenset_reg_t mask)
|
||||
{
|
||||
((Wdt *)hw)->INTENCLR.reg = mask;
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_SYNCBUSY_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
return (((Wdt *)hw)->SYNCBUSY.reg & WDT_SYNCBUSY_ENABLE) >> WDT_SYNCBUSY_ENABLE_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_SYNCBUSY_WEN_bit(const void *const hw)
|
||||
{
|
||||
return (((Wdt *)hw)->SYNCBUSY.reg & WDT_SYNCBUSY_WEN) >> WDT_SYNCBUSY_WEN_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_SYNCBUSY_ALWAYSON_bit(const void *const hw)
|
||||
{
|
||||
return (((Wdt *)hw)->SYNCBUSY.reg & WDT_SYNCBUSY_ALWAYSON) >> WDT_SYNCBUSY_ALWAYSON_Pos;
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_SYNCBUSY_CLEAR_bit(const void *const hw)
|
||||
{
|
||||
return (((Wdt *)hw)->SYNCBUSY.reg & WDT_SYNCBUSY_CLEAR) >> WDT_SYNCBUSY_CLEAR_Pos;
|
||||
}
|
||||
|
||||
static inline hri_wdt_syncbusy_reg_t hri_wdt_get_SYNCBUSY_reg(const void *const hw, hri_wdt_syncbusy_reg_t mask)
|
||||
{
|
||||
uint32_t tmp;
|
||||
tmp = ((Wdt *)hw)->SYNCBUSY.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline hri_wdt_syncbusy_reg_t hri_wdt_read_SYNCBUSY_reg(const void *const hw)
|
||||
{
|
||||
return ((Wdt *)hw)->SYNCBUSY.reg;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg |= WDT_CTRLA_ENABLE;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
tmp = ((Wdt *)hw)->CTRLA.reg;
|
||||
tmp = (tmp & WDT_CTRLA_ENABLE) >> WDT_CTRLA_ENABLE_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_CTRLA_ENABLE_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Wdt *)hw)->CTRLA.reg;
|
||||
tmp &= ~WDT_CTRLA_ENABLE;
|
||||
tmp |= value << WDT_CTRLA_ENABLE_Pos;
|
||||
((Wdt *)hw)->CTRLA.reg = tmp;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg &= ~WDT_CTRLA_ENABLE;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_toggle_CTRLA_ENABLE_bit(const void *const hw)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg ^= WDT_CTRLA_ENABLE;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_CTRLA_WEN_bit(const void *const hw)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg |= WDT_CTRLA_WEN;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_CTRLA_WEN_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
tmp = ((Wdt *)hw)->CTRLA.reg;
|
||||
tmp = (tmp & WDT_CTRLA_WEN) >> WDT_CTRLA_WEN_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_CTRLA_WEN_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Wdt *)hw)->CTRLA.reg;
|
||||
tmp &= ~WDT_CTRLA_WEN;
|
||||
tmp |= value << WDT_CTRLA_WEN_Pos;
|
||||
((Wdt *)hw)->CTRLA.reg = tmp;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_CTRLA_WEN_bit(const void *const hw)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg &= ~WDT_CTRLA_WEN;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_toggle_CTRLA_WEN_bit(const void *const hw)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg ^= WDT_CTRLA_WEN;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_CTRLA_ALWAYSON_bit(const void *const hw)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg |= WDT_CTRLA_ALWAYSON;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline bool hri_wdt_get_CTRLA_ALWAYSON_bit(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
tmp = ((Wdt *)hw)->CTRLA.reg;
|
||||
tmp = (tmp & WDT_CTRLA_ALWAYSON) >> WDT_CTRLA_ALWAYSON_Pos;
|
||||
return (bool)tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_CTRLA_ALWAYSON_bit(const void *const hw, bool value)
|
||||
{
|
||||
uint8_t tmp;
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Wdt *)hw)->CTRLA.reg;
|
||||
tmp &= ~WDT_CTRLA_ALWAYSON;
|
||||
tmp |= value << WDT_CTRLA_ALWAYSON_Pos;
|
||||
((Wdt *)hw)->CTRLA.reg = tmp;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_CTRLA_ALWAYSON_bit(const void *const hw)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg &= ~WDT_CTRLA_ALWAYSON;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_toggle_CTRLA_ALWAYSON_bit(const void *const hw)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg ^= WDT_CTRLA_ALWAYSON;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_CTRLA_reg(const void *const hw, hri_wdt_ctrla_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg |= mask;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_ctrla_reg_t hri_wdt_get_CTRLA_reg(const void *const hw, hri_wdt_ctrla_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
tmp = ((Wdt *)hw)->CTRLA.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_CTRLA_reg(const void *const hw, hri_wdt_ctrla_reg_t data)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg = data;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_CTRLA_reg(const void *const hw, hri_wdt_ctrla_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg &= ~mask;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_toggle_CTRLA_reg(const void *const hw, hri_wdt_ctrla_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CTRLA.reg ^= mask;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_ctrla_reg_t hri_wdt_read_CTRLA_reg(const void *const hw)
|
||||
{
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_ENABLE | WDT_SYNCBUSY_WEN | WDT_SYNCBUSY_ALWAYSON);
|
||||
return ((Wdt *)hw)->CTRLA.reg;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_CONFIG_PER_bf(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg |= WDT_CONFIG_PER(mask);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_config_reg_t hri_wdt_get_CONFIG_PER_bf(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->CONFIG.reg;
|
||||
tmp = (tmp & WDT_CONFIG_PER(mask)) >> WDT_CONFIG_PER_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_CONFIG_PER_bf(const void *const hw, hri_wdt_config_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Wdt *)hw)->CONFIG.reg;
|
||||
tmp &= ~WDT_CONFIG_PER_Msk;
|
||||
tmp |= WDT_CONFIG_PER(data);
|
||||
((Wdt *)hw)->CONFIG.reg = tmp;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_CONFIG_PER_bf(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg &= ~WDT_CONFIG_PER(mask);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_toggle_CONFIG_PER_bf(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg ^= WDT_CONFIG_PER(mask);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_config_reg_t hri_wdt_read_CONFIG_PER_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->CONFIG.reg;
|
||||
tmp = (tmp & WDT_CONFIG_PER_Msk) >> WDT_CONFIG_PER_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_CONFIG_WINDOW_bf(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg |= WDT_CONFIG_WINDOW(mask);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_config_reg_t hri_wdt_get_CONFIG_WINDOW_bf(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->CONFIG.reg;
|
||||
tmp = (tmp & WDT_CONFIG_WINDOW(mask)) >> WDT_CONFIG_WINDOW_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_CONFIG_WINDOW_bf(const void *const hw, hri_wdt_config_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Wdt *)hw)->CONFIG.reg;
|
||||
tmp &= ~WDT_CONFIG_WINDOW_Msk;
|
||||
tmp |= WDT_CONFIG_WINDOW(data);
|
||||
((Wdt *)hw)->CONFIG.reg = tmp;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_CONFIG_WINDOW_bf(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg &= ~WDT_CONFIG_WINDOW(mask);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_toggle_CONFIG_WINDOW_bf(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg ^= WDT_CONFIG_WINDOW(mask);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_config_reg_t hri_wdt_read_CONFIG_WINDOW_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->CONFIG.reg;
|
||||
tmp = (tmp & WDT_CONFIG_WINDOW_Msk) >> WDT_CONFIG_WINDOW_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_CONFIG_reg(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg |= mask;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_config_reg_t hri_wdt_get_CONFIG_reg(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->CONFIG.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_CONFIG_reg(const void *const hw, hri_wdt_config_reg_t data)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg = data;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_CONFIG_reg(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg &= ~mask;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_toggle_CONFIG_reg(const void *const hw, hri_wdt_config_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CONFIG.reg ^= mask;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_config_reg_t hri_wdt_read_CONFIG_reg(const void *const hw)
|
||||
{
|
||||
return ((Wdt *)hw)->CONFIG.reg;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_EWCTRL_EWOFFSET_bf(const void *const hw, hri_wdt_ewctrl_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->EWCTRL.reg |= WDT_EWCTRL_EWOFFSET(mask);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_ewctrl_reg_t hri_wdt_get_EWCTRL_EWOFFSET_bf(const void *const hw, hri_wdt_ewctrl_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->EWCTRL.reg;
|
||||
tmp = (tmp & WDT_EWCTRL_EWOFFSET(mask)) >> WDT_EWCTRL_EWOFFSET_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_EWCTRL_EWOFFSET_bf(const void *const hw, hri_wdt_ewctrl_reg_t data)
|
||||
{
|
||||
uint8_t tmp;
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
tmp = ((Wdt *)hw)->EWCTRL.reg;
|
||||
tmp &= ~WDT_EWCTRL_EWOFFSET_Msk;
|
||||
tmp |= WDT_EWCTRL_EWOFFSET(data);
|
||||
((Wdt *)hw)->EWCTRL.reg = tmp;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_EWCTRL_EWOFFSET_bf(const void *const hw, hri_wdt_ewctrl_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->EWCTRL.reg &= ~WDT_EWCTRL_EWOFFSET(mask);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_toggle_EWCTRL_EWOFFSET_bf(const void *const hw, hri_wdt_ewctrl_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->EWCTRL.reg ^= WDT_EWCTRL_EWOFFSET(mask);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_ewctrl_reg_t hri_wdt_read_EWCTRL_EWOFFSET_bf(const void *const hw)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->EWCTRL.reg;
|
||||
tmp = (tmp & WDT_EWCTRL_EWOFFSET_Msk) >> WDT_EWCTRL_EWOFFSET_Pos;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_set_EWCTRL_reg(const void *const hw, hri_wdt_ewctrl_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->EWCTRL.reg |= mask;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_ewctrl_reg_t hri_wdt_get_EWCTRL_reg(const void *const hw, hri_wdt_ewctrl_reg_t mask)
|
||||
{
|
||||
uint8_t tmp;
|
||||
tmp = ((Wdt *)hw)->EWCTRL.reg;
|
||||
tmp &= mask;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_EWCTRL_reg(const void *const hw, hri_wdt_ewctrl_reg_t data)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->EWCTRL.reg = data;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_clear_EWCTRL_reg(const void *const hw, hri_wdt_ewctrl_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->EWCTRL.reg &= ~mask;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline void hri_wdt_toggle_EWCTRL_reg(const void *const hw, hri_wdt_ewctrl_reg_t mask)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->EWCTRL.reg ^= mask;
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
static inline hri_wdt_ewctrl_reg_t hri_wdt_read_EWCTRL_reg(const void *const hw)
|
||||
{
|
||||
return ((Wdt *)hw)->EWCTRL.reg;
|
||||
}
|
||||
|
||||
static inline void hri_wdt_write_CLEAR_reg(const void *const hw, hri_wdt_clear_reg_t data)
|
||||
{
|
||||
WDT_CRITICAL_SECTION_ENTER();
|
||||
((Wdt *)hw)->CLEAR.reg = data;
|
||||
hri_wdt_wait_for_sync(hw, WDT_SYNCBUSY_CLEAR);
|
||||
WDT_CRITICAL_SECTION_LEAVE();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HRI_WDT_E54_H_INCLUDED */
|
||||
#endif /* _SAME54_WDT_COMPONENT_ */
|
||||
Reference in New Issue
Block a user