/*-------------------------------------------------------------------------
STM8AL3LE8A.h - Device Declarations
STM8L/STM8AL, high/medium+ density with ROM bootloader
Copyright (C) 2020, Georg Icking-Konert
Automotive 8-bit ultra-low-power MCU with 64 Kbytes Flash, LIN, RTC, LCD, data EEPROM, timers, USARTs, I2C, SPIs, ADC, DAC, COMPs, AES
datasheet: https://www.st.com/resource/en/datasheet/stm8al3le8a.pdf
reference: RM0031 https://www.st.com/content/ccc/resource/technical/document/reference_manual/2e/3b/8c/8f/60/af/4b/2c/CD00218714.pdf/files/CD00218714.pdf/jcr:content/translations/en.CD00218714.pdf
MIT License
Copyright (c) 2020 Georg Icking-Konert
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
MODULE DEFINITION FOR MULTIPLE INCLUSION
-------------------------------------------------------------------------*/
#ifndef STM8AL3LE8A_H
#define STM8AL3LE8A_H
// DEVICE NAME
#define DEVICE_STM8AL3LE8A
// DEVICE FAMILY
#define FAMILY_STM8L
// required for C++
#ifdef __cplusplus
extern "C" {
#endif
/*-------------------------------------------------------------------------
INCLUDE FILES
-------------------------------------------------------------------------*/
#include <stdint.h>
/*-------------------------------------------------------------------------
COMPILER SPECIFIC SETTINGS
-------------------------------------------------------------------------*/
// Cosmic compiler
#if defined(__CSMC__)
// macros to unify ISR declaration and implementation
#define ISR_HANDLER(func,irq) @far @interrupt void func(void) ///< handler for interrupt service routine
#define ISR_HANDLER_TRAP(func) void @far @interrupt func(void) ///< handler for trap service routine
// definition of inline functions
#define INLINE @inline ///< keyword for inline functions
// common assembler instructions
#define NOP() _asm("nop") ///< perform a nop() operation (=minimum delay)
#define DISABLE_INTERRUPTS() _asm("sim") ///< disable interrupt handling
#define ENABLE_INTERRUPTS() _asm("rim") ///< enable interrupt handling
#define TRIGGER_TRAP _asm("trap") ///< trigger a trap (=soft interrupt) e.g. for EMC robustness (see AN1015)
#define WAIT_FOR_INTERRUPT() _asm("wfi") ///< stop code execution and wait for interrupt
#define ENTER_HALT() _asm("halt") ///< put controller to HALT mode
#define SW_RESET() _asm("dc.b $75") ///< reset via illegal opcode (works for all devices)
// data type in bit fields
#define BITFIELD_UINT unsigned int ///< data type in bit structs (follow C90 standard)
// IAR Compiler
#elif defined(__ICCSTM8__)
// include intrinsic functions
#include <intrinsics.h>
// macros to unify ISR declaration and implementation
#define STRINGVECTOR(x) #x
#define VECTOR_ID(x) STRINGVECTOR( vector = (x) )
#define ISR_HANDLER( a, b ) \
_Pragma( VECTOR_ID( (b)+2 ) ) \
__interrupt void (a)( void )
#define ISR_HANDLER_TRAP(a) \
_Pragma( VECTOR_ID( 1 ) ) \
__interrupt void (a) (void)
// definition of inline functions
#define INLINE static inline ///< keyword for inline functions
// common assembler instructions
#define NOP() __no_operation() ///< perform a nop() operation (=minimum delay)
#define DISABLE_INTERRUPTS() __disable_interrupt() ///< disable interrupt handling
#define ENABLE_INTERRUPTS() __enable_interrupt() ///< enable interrupt handling
#define TRIGGER_TRAP __trap() ///< trigger a trap (=soft interrupt) e.g. for EMC robustness (see AN1015)
#define WAIT_FOR_INTERRUPT() __wait_for_interrupt() ///< stop code execution and wait for interrupt
#define ENTER_HALT() __halt() ///< put controller to HALT mode
#define SW_RESET() __asm("dc8 0x75") ///< reset via illegal opcode (works for all devices)
// data type in bit fields
#define BITFIELD_UINT unsigned char ///< data type in bit structs (deviating from C90 standard)
// SDCC compiler
#elif defined(__SDCC)
// store SDCC version in preprocessor friendly way
#define SDCC_VERSION (__SDCC_VERSION_MAJOR * 10000 \
+ __SDCC_VERSION_MINOR * 100 \
+ __SDCC_VERSION_PATCH)
// unify ISR declaration and implementation
#define ISR_HANDLER(func,irq) void func(void) __interrupt(irq) ///< handler for interrupt service routine
#if SDCC_VERSION >= 30403 // traps require >=v3.4.3
#define ISR_HANDLER_TRAP(func) void func() __trap ///< handler for trap service routine
#else
#error traps require SDCC >=3.4.3. Please update!
#endif
// definition of inline functions
#define INLINE static inline ///< keyword for inline functions
// common assembler instructions
#define NOP() __asm__("nop") ///< perform a nop() operation (=minimum delay)
#define DISABLE_INTERRUPTS() __asm__("sim") ///< disable interrupt handling
#define ENABLE_INTERRUPTS() __asm__("rim") ///< enable interrupt handling
#define TRIGGER_TRAP __asm__("trap") ///< trigger a trap (=soft interrupt) e.g. for EMC robustness (see AN1015)
#define WAIT_FOR_INTERRUPT() __asm__("wfi") ///< stop code execution and wait for interrupt
#define ENTER_HALT() __asm__("halt") ///< put controller to HALT mode
#define SW_RESET() __asm__(".db 0x75") ///< reset via illegal opcode (works for all devices)
// data type in bit fields
#define BITFIELD_UINT unsigned int ///< data type in bit structs (follow C90 standard)
// unsupported compiler -> stop
#else
#error: compiler not supported
#endif
/*-------------------------------------------------------------------------
FOR CONVENIENT PIN ACCESS
-------------------------------------------------------------------------*/
#define PIN0 0x01
#define PIN1 0x02
#define PIN2 0x04
#define PIN3 0x08
#define PIN4 0x10
#define PIN5 0x20
#define PIN6 0x40
#define PIN7 0x80
/*-------------------------------------------------------------------------
DEVICE MEMORY (size in bytes)
------------------------------------------
没有合适的资源?快使用搜索试试~ 我知道了~
STM8微控制器的设备头文件和示例_C语言_代码_相关文件_下载
共1305个文件
h:260个
xml:182个
svd:178个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 7 浏览量
2022-07-08
01:50:40
上传
评论
收藏 8.51MB ZIP 举报
温馨提示
适用于所有STM8 微控制器系列的开源设备头 ,即 STM8A、STM8S、STM8L、STM8AF 和 STM8AL。 设备标头 与SDCC、 Cosmic和IAR兼容。 可以与 STM 各自的 STM8 标准外设库(SPL) 混合使用(参见下面的示例)。请注意,必须对 SPL 进行修补才能与SDCC一起使用,请参见此处。 XML 设备描述 标头是根据 XML 格式的设备描述生成的,这些描述位于 XML 文件夹 中。这些描述可以用于例如图形调试器界面。 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
STM8微控制器的设备头文件和示例_C语言_代码_相关文件_下载
(1305个子文件)
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
test.Debug.cspy.bat 2KB
yaMBSistm8.c 28KB
yaMBSistm8.c 28KB
Tasks.c 15KB
cli.c 11KB
main.c 8KB
debug_uart.c 8KB
ds18b20.c 7KB
uart2.c 7KB
uart1.c 7KB
i2c.c 7KB
timer3.c 5KB
client-example.c 5KB
client-example.c 5KB
main.c 5KB
master-example.c 5KB
master-example.c 5KB
spi-out-max7219.c 5KB
lcd-BTHQ21605V.c 5KB
main.c 4KB
main.c 4KB
main.c 4KB
main.c 4KB
main.c 4KB
timer4.c 4KB
timer4.c 4KB
timer4.c 4KB
uart.c 4KB
uart.c 4KB
timer4.c 4KB
timer4.c 4KB
timer4.c 4KB
timer4.c 4KB
main.c 4KB
crc16_ccitt.c 3KB
main.c 3KB
timer4.c 3KB
crc32_posix.c 3KB
timer4.c 3KB
crc16_ansi.c 3KB
crc32.c 3KB
main.c 3KB
main.c 3KB
main.c 3KB
main.c 3KB
clock.c 3KB
main.c 3KB
main.c 3KB
main.c 3KB
crc8_1wire.c 3KB
crc8_j1850.c 3KB
uart.c 3KB
uart.c 3KB
main.c 3KB
main.c 3KB
crc_ref.c 3KB
main.c 3KB
main.c 3KB
main.c 3KB
eeprom.c 2KB
main.c 2KB
main.c 2KB
awu.c 2KB
uart2.c 2KB
uart2.c 2KB
uart2.c 2KB
main.c 2KB
flash.c 2KB
共 1305 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功