Compatibility definitions for compilers (IAR, GCC)
This file contains AVR type definitions that enable Atmel's 802.15.4 stack implementation to build using multiple compilers. This file contains compiler conditional subsystems for AVR functions such as: interrupts, sleep mode, USARTs, etc.
#include <string.h>
#include <avr/io.h>
#include <avr/boot.h>
#include <avr/eeprom.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/sleep.h>
#include <avr/power.h>
#include <avr/wdt.h>
#include <util/crc16.h>
Macros | |
#define | _BV(x) (1 << (x)) |
Bit value – compute the bitmask for a bit position. More... | |
#define | ADDR_COPY_DST_SRC_16(dst, src) memcpy((&(dst)), (&(src)), sizeof(uint16_t)) |
#define | ADDR_COPY_DST_SRC_64(dst, src) memcpy((&(dst)), (&(src)), sizeof(uint64_t)) |
#define | ALIGN8BIT /* AVR-GCC uses an 8-bit alignment anyway */ |
#define | CAN_INITIALIZE_FLEXIBLE_ARRAY_MEMBERS 1 |
#define | CCPU_ENDIAN_TO_LE16(x) (x) |
#define | CCPU_ENDIAN_TO_LE32(x) (x) |
#define | CCPU_ENDIAN_TO_LE64(x) (x) |
#define | CLE16_TO_CPU_ENDIAN(x) (x) |
#define | CLE32_TO_CPU_ENDIAN(x) (x) |
#define | CLE64_TO_CPU_ENDIAN(x) (x) |
#define | CMD_ID_OCTET (0) |
#define | convert_16_bit_to_byte_address(value, data) ((*(uint16_t *)(data)) = (uint16_t)(value)) |
#define | convert_16_bit_to_byte_array(value, data) ((*(uint16_t *)(data)) = (uint16_t)(value)) |
#define | convert_32_bit_to_byte_array(value, data) ((*(uint32_t *)(data)) = (uint32_t)(value)) |
#define | convert_64_bit_to_byte_array(value, data) memcpy((data), (&(value)), sizeof(uint64_t)) |
#define | convert_byte_array_to_16_bit(data) (*(uint16_t *)(data)) |
#define | convert_byte_array_to_32_bit(data) (*(uint32_t *)(data)) |
#define | convert_byte_array_to_64_bit(data) (*(uint64_t *)(data)) |
#define | convert_spec_16_bit_to_byte_array(value, data) ((*(uint16_t *)(data)) = (uint16_t)(value)) |
#define | CPU_ENDIAN_TO_LE16(x) (x) |
#define | CPU_ENDIAN_TO_LE32(x) (x) |
#define | CPU_ENDIAN_TO_LE64(x) (x) |
#define | EEGET(var, addr) (var) = eeprom_read_byte((uint8_t *)(addr)) |
#define | EEPROM_BUSY_WAIT() eeprom_busy_wait() |
#define | EEPUT(addr, val) eeprom_write_byte((uint8_t *)(addr), (uint8_t)(val)) |
#define | ENABLE_RWW_SECTION() boot_rww_enable() |
#define | ENABLE_XRAM(void) |
#define | FLASH_DECLARE(x) const x __attribute__((__progmem__)) |
#define | FLASH_ERASE(addr) boot_page_erase(addr) |
#define | FLASH_EXTERN(x) extern x __attribute__((__progmem__)) |
#define | FLASH_PAGE_FILL(addr, data) boot_page_fill(addr, data) |
#define | FLASH_PAGE_WRITE(addr) boot_page_write(addr) |
#define | FLASH_STRING(x) PSTR(x) |
#define | FLASH_STRING_T PGM_P |
#define | FORCE_INLINE(type, name,...) |
#define | FUNC_PTR void * |
#define | HAS_PGM_VSNPRINTF 1 |
#define | LE16_TO_CPU_ENDIAN(x) (x) |
#define | LE32_TO_CPU_ENDIAN(x) (x) |
#define | LE64_TO_CPU_ENDIAN(x) (x) |
#define | MEMCPY_ENDIAN memcpy |
#define | nop() do { __asm__ __volatile__ ("nop"); } while (0) |
#define | PACKED __attribute__((packed)) |
#define | PGM_READ_BLOCK(dst, src, len) memcpy_P((dst), (src), (len)) |
#define | PGM_READ_BYTE(x) pgm_read_byte(x) |
#define | PGM_READ_BYTE_FAR(x) pgm_read_byte_far(x) |
#define | PGM_READ_WORD(x) pgm_read_word(x) |
#define | PGM_STRCPY(dst, src) strcpy_P((dst), (src)) |
#define | PGM_STRLEN(x) strlen_P(x) |
#define | PGM_VSNPRINTF(dst, n, fmt, ap) vsnprintf_P((dst), (n), (fmt), (ap)) |
#define | PRINTF(fmt,...) { static const char c[] PROGMEM = fmt; printf_P(c, __VA_ARGS__); } |
#define | PRINTF_FLASH_STRING "%S" |
#define | PUTS(s) { static const char c[] PROGMEM = s; printf_P(c); } |
#define | RAMFUNCTION |
#define | read_avr_fuse(n) |
#define | restore_irq_status() (SREG = sreg) |
This macro must be used together with save_irq_status() and it will restore the content of the IRQ status. More... | |
#define | RETURN_ENABLE_XRAM |
#define | save_irq_status() (sreg = SREG) |
This macro saves the IRQ status and is typically used before cli(). More... | |
#define | SET_SLEEP_MODE(x) set_sleep_mode(x) |
#define | SHORTENUM __attribute__ ((packed)) |
#define | SLEEP_MODE() sleep_mode() |
#define | SPM_BUSY_WAIT() boot_spm_busy_wait() |
#define | WDT_DISABLE() wdt_disable() |
#define | WDT_RESET() wdt_reset() |
#define _BV | ( | x | ) | (1 << (x)) |
Bit value – compute the bitmask for a bit position.
#define ADDR_COPY_DST_SRC_16 | ( | dst, | |
src | |||
) | memcpy((&(dst)), (&(src)), sizeof(uint16_t)) |
Referenced by handle_gts_data_req(), mac_process_data_frame(), mcps_data_request(), and mlme_get().
#define ADDR_COPY_DST_SRC_64 | ( | dst, | |
src | |||
) | memcpy((&(dst)), (&(src)), sizeof(uint64_t)) |
Referenced by mac_process_data_frame(), mcps_data_ind(), mlme_get(), and wpan_mcps_data_req().
#define ALIGN8BIT /* AVR-GCC uses an 8-bit alignment anyway */ |
#define CAN_INITIALIZE_FLEXIBLE_ARRAY_MEMBERS 1 |
#define CCPU_ENDIAN_TO_LE16 | ( | x | ) | (x) |
#define CCPU_ENDIAN_TO_LE32 | ( | x | ) | (x) |
#define CCPU_ENDIAN_TO_LE64 | ( | x | ) | (x) |
#define CLE16_TO_CPU_ENDIAN | ( | x | ) | (x) |
Referenced by parse_mpdu().
#define CLE32_TO_CPU_ENDIAN | ( | x | ) | (x) |
#define CLE64_TO_CPU_ENDIAN | ( | x | ) | (x) |
#define CMD_ID_OCTET (0) |
Referenced by dispatch_event().
Referenced by build_data_frame().
Referenced by build_data_frame(), and transmit_frame().
Referenced by mac_extract_mhr_addr_info(), and parse_mpdu().
Referenced by mac_extract_mhr_addr_info().
#define convert_spec_16_bit_to_byte_array | ( | value, | |
data | |||
) | ((*(uint16_t *)(data)) = (uint16_t)(value)) |
Referenced by build_data_frame(), and mlme_gts_request().
#define CPU_ENDIAN_TO_LE16 | ( | x | ) | (x) |
Referenced by assign_new_short_addr(), and wpan_mcps_data_req().
#define CPU_ENDIAN_TO_LE32 | ( | x | ) | (x) |
#define CPU_ENDIAN_TO_LE64 | ( | x | ) | (x) |
#define EEGET | ( | var, | |
addr | |||
) | (var) = eeprom_read_byte((uint8_t *)(addr)) |
#define EEPROM_BUSY_WAIT | ( | ) | eeprom_busy_wait() |
Referenced by flash_erase_page(), and flash_program_page().
#define EEPUT | ( | addr, | |
val | |||
) | eeprom_write_byte((uint8_t *)(addr), (uint8_t)(val)) |
#define ENABLE_RWW_SECTION | ( | ) | boot_rww_enable() |
Referenced by flash_erase_page(), and flash_program_page().
#define ENABLE_XRAM | ( | void | ) |
#define FLASH_DECLARE | ( | x | ) | const x __attribute__((__progmem__)) |
#define FLASH_ERASE | ( | addr | ) | boot_page_erase(addr) |
Referenced by flash_erase_page(), and flash_program_page().
#define FLASH_EXTERN | ( | x | ) | extern x __attribute__((__progmem__)) |
Referenced by flash_fill_page_buffer().
#define FLASH_PAGE_WRITE | ( | addr | ) | boot_page_write(addr) |
Referenced by flash_program_page().
#define FLASH_STRING | ( | x | ) | PSTR(x) |
#define FLASH_STRING_T PGM_P |
#define FORCE_INLINE | ( | type, | |
name, | |||
... | |||
) |
#define FUNC_PTR void * |
Referenced by acc_read_cb(), app_led_event(), app_nlme_rx_enable_confirm(), app_task(), bc_data_cb(), bcn_payload_update_cb(), csma_backoff_calculation(), gts_data_cb(), handle_incoming_msg(), handle_input(), indirect_data_cb(), led_blinker_timer_handler_cb(), led_handling(), mac_process_tal_tx_status(), mac_t_gts_cb(), main(), marker_rsp_timer_handler_cb(), marker_tx_timer_handler_cb(), network_search_indication_cb(), nlme_reset_confirm(), nlme_set_confirm(), nlme_start_confirm(), pbp_org_pair_confirm(), pbp_pair_confirm(), pbp_rec_pair_confirm(), peer_req_send_task(), per_mode_initiator_init(), per_mode_initiator_rx_cb(), per_mode_initiator_task(), per_mode_receptor_rx_cb(), per_mode_receptor_task(), pktstream_test(), print_ch_change_submenu(), print_node_status(), print_pairing_table(), print_sub_mode_ch_ag_setup(), print_unpair_submenu(), process_data_ind_not_transient(), range_test_timer_handler_cb(), range_test_tx_on_init(), range_test_tx_timer_handler_cb(), send_range_test_marker_rsp(), send_remote_cmd(), serial_data_handler(), set_trx_state(), start_beacon_loss_timer(), start_cmd_disc_cb(), start_range_test(), stop_pkt_streaming(), tal_init(), tal_reset(), tal_trx_wakeup(), usr_mcps_data_ind(), usr_mlme_gts_ind(), vendor_data_ind(), vendor_data_request(), wait_for_conf_init(), zid_connect_confirm(), zid_get_report_indication(), and zid_set_attribute_confirm().
#define HAS_PGM_VSNPRINTF 1 |
#define LE16_TO_CPU_ENDIAN | ( | x | ) | (x) |
Referenced by usr_mcps_data_ind().
#define LE32_TO_CPU_ENDIAN | ( | x | ) | (x) |
#define LE64_TO_CPU_ENDIAN | ( | x | ) | (x) |
#define MEMCPY_ENDIAN memcpy |
Referenced by handle_incoming_msg(), mlme_get(), pal_get_current_time(), usr_perf_get_confirm(), and usr_perf_set_confirm().
#define nop | ( | ) | do { __asm__ __volatile__ ("nop"); } while (0) |
#define PACKED __attribute__((packed)) |
#define PGM_READ_BLOCK | ( | dst, | |
src, | |||
len | |||
) | memcpy_P((dst), (src), (len)) |
Referenced by zrc_cmd_disc_indication().
#define PGM_READ_BYTE | ( | x | ) | pgm_read_byte(x) |
Referenced by convert_phyTransmitPower_to_reg_value(), get_param_length(), limit_tx_pwr(), and mac_get_pib_attribute_size().
#define PGM_READ_BYTE_FAR | ( | x | ) | pgm_read_byte_far(x) |
Referenced by flash_fill_page_buffer(), and flash_read().
#define PGM_READ_WORD | ( | x | ) | pgm_read_word(x) |
Referenced by dispatch_event(), and vendor_data_ind().
#define PGM_STRCPY | ( | dst, | |
src | |||
) | strcpy_P((dst), (src)) |
#define PGM_STRLEN | ( | x | ) | strlen_P(x) |
#define PGM_VSNPRINTF | ( | dst, | |
n, | |||
fmt, | |||
ap | |||
) | vsnprintf_P((dst), (n), (fmt), (ap)) |
#define PRINTF | ( | fmt, | |
... | |||
) | { static const char c[] PROGMEM = fmt; printf_P(c, __VA_ARGS__); } |
#define PRINTF_FLASH_STRING "%S" |
#define PUTS | ( | s | ) | { static const char c[] PROGMEM = s; printf_P(c); } |
#define RAMFUNCTION |
#define read_avr_fuse | ( | n | ) |
#define restore_irq_status | ( | ) | (SREG = sreg) |
This macro must be used together with save_irq_status() and it will restore the content of the IRQ status.
#define RETURN_ENABLE_XRAM |
#define save_irq_status | ( | ) | (sreg = SREG) |
This macro saves the IRQ status and is typically used before cli().
#define SET_SLEEP_MODE | ( | x | ) | set_sleep_mode(x) |
Referenced by app_task().
#define SHORTENUM __attribute__ ((packed)) |
#define SLEEP_MODE | ( | ) | sleep_mode() |
Referenced by app_task().
#define SPM_BUSY_WAIT | ( | ) | boot_spm_busy_wait() |
Referenced by flash_erase_page(), and flash_program_page().
#define WDT_DISABLE | ( | ) | wdt_disable() |
Referenced by app_task().
#define WDT_RESET | ( | ) | wdt_reset() |
Referenced by app_task().