MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mcci_bootloader_device_i2c_device_stm32l0.h
Go to the documentation of this file.
1/*
2
3Module: mcci_bootloader_device_i2c_device_stm32l0.h
4
5Function:
6 The device object for I2C devices for the STM32L0 (and compatible) controllers
7
8Copyright and License:
9 This file copyright (C) 2026 by
10
11 MCCI Corporation
12 3520 Krums Corners Road
13 Ithaca, NY 14850
14
15 See accompanying LICENSE file for copyright and license information.
16
17Author:
18 Terry Moore, MCCI Corporation May 2026
19
20*/
21
22#ifndef _mcci_bootloader_device_i2c_device_stm32l0_h_
23#define _mcci_bootloader_device_i2c_device_stm32l0_h_ /* prevent multiple includes */
24
25#pragma once
26
27#ifndef _mcci_bootloader_device_i2c_device_stm32l0_types_h_
29#endif
30
31#ifndef _mcci_bootloader_device_i2c_device_h_
32# include "mcci_bootloader_device_i2c_device.h"
33#endif
34
36
38 {
40
41 /* currently we have no contents at this layer. */
42 };
43
50
51#define McciBootloaderDeviceI2cDeviceStm32l0_CONTENTS \
52 McciBootloaderDeviceI2cDeviceStm32l0_Contents_t Stm32l0
53
54#define McciBootloaderDeviceI2cDeviceStm32l0_UNION \
55 McciBootloaderDeviceI2cDeviceStm32l0_Contents_t Stm32l0; \
56 McciBootloaderDeviceI2cDeviceStm32l0_t Stm32l0Cast
57
58///
59/// @brief upcast from device to enclosing McciBootloaderDeviceI2cDeviceStm32l0_t
60/// @param pDevice Pointer to device
61/// @return pointer to enclosing object
62///
63/// @note
64/// This is only safe to call when you know that the device is part of
65/// a STM32L0 I2C Bus Controller driver instance.
66///
67static inline
68McciBootloaderDeviceI2cDeviceStm32l0_t *
70 McciBootloaderDevice_t *pDevice
71 )
72 {
73 return (McciBootloaderDeviceI2cDeviceStm32l0_t *)pDevice;
74 }
75
76///
77/// @brief upcast from i2c controller device to enclosing McciBootloaderDeviceI2cDeviceStm32l0_t
78/// @param pDevice Pointer to i2c controller device
79/// @return pointer to enclosing object
80///
81/// @note
82/// This is only safe to call when you know that the device is part of
83/// a STM32L0 I2C Bus Controller driver instance.
84///
85static inline
86McciBootloaderDeviceI2cDeviceStm32l0_t *
88 McciBootloaderDeviceI2cDevice_t *pDevice
89 )
90 {
91 return (McciBootloaderDeviceI2cDeviceStm32l0_t *)pDevice;
92 }
93
94
95
97
98#endif /* _mcci_bootloader_device_i2c_device_stm32l0_h_ */
static McciBootloaderDeviceI2cDeviceStm32l0_t * McciBootloaderDeviceI2cDevice_getI2cDeviceStm32l0(McciBootloaderDeviceI2cDevice_t *pDevice)
upcast from i2c controller device to enclosing McciBootloaderDeviceI2cDeviceStm32l0_t
static McciBootloaderDeviceI2cDeviceStm32l0_t * McciBootloaderDevice_getI2cDeviceStm32l0(McciBootloaderDevice_t *pDevice)
upcast from device to enclosing McciBootloaderDeviceI2cDeviceStm32l0_t
typedefMCCI_BOOTLOADER_BEGIN_DECLS struct McciBootloaderDeviceI2cDeviceStm32l0_Contents_s McciBootloaderDeviceI2cDeviceStm32l0_Contents_t
#define MCCI_BOOTLOADER_BEGIN_DECLS
#define MCCI_BOOTLOADER_END_DECLS
McciBootloaderDeviceI2cDeviceStm32l0_Contents_t Stm32l0