Compiler abstraction layer and code utilities for 32-bit AVR.
This module provides various abstraction layers and utilities to make code compatible between different compilers.
Modules | |
Preprocessor - Stringize | |
Preprocessor - Token Paste | |
Status Codes | |
Preprocessor - Macro Repeat | |
Macros | |
#define | barrier() asm volatile("" ::: "memory") |
Memory barrier. More... | |
#define | COMPILER_ALIGNED(a) __attribute__((__aligned__(a))) |
Set aligned boundary. More... | |
#define | COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) |
Set default alignment for subsequent struct and union definitions. More... | |
#define | COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment)) |
Set maximum alignment for subsequent struct and union definitions to alignment. More... | |
#define | COMPILER_PRAGMA(arg) _Pragma(#arg) |
Emit the compiler pragma arg. More... | |
#define | COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) |
Set word-aligned boundary. More... | |
#define | Get_system_register(reg) sysreg_read(reg) |
#define | Set_system_register(reg, val) sysreg_write(reg, val) |
#define | sysreg_write(reg, val) __builtin_mtsr(reg, val) |
Set value of system register. More... | |
#define | UNUSED(v) (void)(v) |
Marking v as a unused parameter or value. More... | |
#define | unused(v) do { (void)(v); } while(0) |
Marking v as a unused parameter or value. More... | |
System Register Access | |
#define | sysreg_read(reg) __builtin_mfsr(reg) |
Get value of system register. More... | |
Tag functions as deprecated | |
Tagging a function as deprecated will produce a warning when and only when the function is called. Usage is to add the DEPRECATED symbol before the function definition. E.g.: DEPRECATED uint8_t some_deprecated_function (void) { ... }
| |
#define | __DEPRECATED__ __attribute__((__deprecated__)) |
#define __DEPRECATED__ __attribute__((__deprecated__)) |
#define barrier | ( | ) | asm volatile("" ::: "memory") |
Memory barrier.
Referenced by cpu_irq_restore(), fifo_pull_uint16(), fifo_pull_uint16_nocheck(), fifo_pull_uint32(), fifo_pull_uint32_nocheck(), fifo_pull_uint8(), fifo_pull_uint8_nocheck(), fifo_push_uint16(), fifo_push_uint16_nocheck(), fifo_push_uint32(), fifo_push_uint32_nocheck(), fifo_push_uint8(), and fifo_push_uint8_nocheck().
Set aligned boundary.
Referenced by stream_mem_to_mem().
#define COMPILER_PACK_RESET | ( | ) | COMPILER_PRAGMA(pack()) |
Set default alignment for subsequent struct and union definitions.
#define COMPILER_PACK_SET | ( | alignment | ) | COMPILER_PRAGMA(pack(alignment)) |
Set maximum alignment for subsequent struct and union definitions to alignment.
Emit the compiler pragma arg.
arg | The pragma directive as it would appear after #pragma (i.e. not stringified). |
#define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) |
Set word-aligned boundary.
#define Get_system_register | ( | reg | ) | sysreg_read(reg) |
#define Set_system_register | ( | reg, | |
val | |||
) | sysreg_write(reg, val) |
#define sysreg_read | ( | reg | ) | __builtin_mfsr(reg) |
Get value of system register.
reg | Address of the system register of which to get the value. |
Referenced by cpu_irq_save(), twi_master_init(), and twi_slave_init().
Set value of system register.
reg | Address of the system register of which to set the value. |
val | Value to set the system register reg to. |
#define UNUSED | ( | v | ) | (void)(v) |
Marking v as a unused parameter or value.
Referenced by at25dfx_spi_deselect_device(), at25dfx_spi_select_device(), main(), main_keyboard_led(), main_vendor_bulk_in_received(), main_vendor_bulk_out_received(), main_vendor_int_in_received(), main_vendor_int_out_received(), main_vendor_iso_in_received(), main_vendor_iso_out_received(), mem_name(), mem_removal(), mem_unload(), memory_2_ram(), ram_2_memory(), run_osc_test(), run_pll_dfll_test(), run_sync_clock_test(), run_usb_cdc_test(), run_usb_mouse_test(), sd_mmc_is_write_protected(), sd_mmc_removal(), sd_mmc_spi_get_bus_width(), sd_mmc_spi_get_response_128(), sleepmgr_lock_mode(), sleepmgr_unlock_mode(), stream_state(), stream_stop(), udi_cdc_data_sent(), udi_cdc_line_coding_received(), udi_cdc_serial_state_msg_sent(), udi_hid_generic_report_in_sent(), udi_hid_generic_report_out_received(), udi_hid_kbd_report_sent(), udi_hid_mouse_report_sent(), udi_hid_multi_touch_report_in_sent(), udi_msc_cbw_received(), udi_msc_csw_sent(), udi_msc_data_sent(), udi_msc_trans_ack(), uhc_dev_get_string(), uhc_enumeration_step10(), uhc_enumeration_step12(), uhc_enumeration_step13(), uhc_enumeration_step14(), uhc_enumeration_step15(), uhc_enumeration_step6(), uhc_setup_request_callback(), uhi_cdc_rx_received(), uhi_cdc_sof(), uhi_cdc_tx_send(), uhi_hid_mouse_report_reception(), uhi_msc_cbw_rst_stall(), uhi_msc_cbw_sent(), uhi_msc_csw_received(), uhi_msc_data_csw_rst_stall(), uhi_msc_data_transfered(), uhi_msc_enable_step2(), uhi_msc_enable_step5(), usart_spi_deselect_device(), usart_spi_select_device(), and usart_spi_setup_device().