1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/lupyuen-LoRaMac-node-nuttx

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
hri_ccl_l21.h 24 КБ
Копировать Редактировать Исходные данные Просмотреть построчно История
Miguel Luis Отправлено 7 лет назад 8f4693d
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
/**
* \file
*
* \brief SAM CCL
*
* Copyright (C) 2016 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*/
#ifdef _SAML21_CCL_COMPONENT_
#ifndef _HRI_CCL_L21_H_INCLUDED_
#define _HRI_CCL_L21_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_L21_H_INCLUDED */
#endif /* _SAML21_CCL_COMPONENT_ */

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/lupyuen-LoRaMac-node-nuttx.git
git@gitlife.ru:oschina-mirror/lupyuen-LoRaMac-node-nuttx.git
oschina-mirror
lupyuen-LoRaMac-node-nuttx
lupyuen-LoRaMac-node-nuttx
v4.5.0