Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions firmware/common/adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __ADC_H__
#define __ADC_H__
#pragma once

#include <stdint.h>

uint16_t adc_read(uint8_t pin);
void adc_off(void);

#endif // __ADC_H__
5 changes: 1 addition & 4 deletions firmware/common/bitband.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __BITBAND_H__
#define __BITBAND_H__
#pragma once

#include <stdint.h>

Expand All @@ -37,5 +36,3 @@ void peripheral_bitband_clear(
uint32_t peripheral_bitband_get(
volatile void* const peripheral_address,
const uint_fast8_t bit_number);

#endif //__BITBAND_H__
5 changes: 1 addition & 4 deletions firmware/common/clkin.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __CLKIN_H__
#define __CLKIN_H__
#pragma once

#include <stdint.h>

void clkin_detect_init(void);
uint32_t clkin_frequency(void);

#endif //__CLKIN_H__
5 changes: 1 addition & 4 deletions firmware/common/cpld_jtag.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __CPLD_JTAG_H__
#define __CPLD_JTAG_H__
#pragma once

#include <stdint.h>

Expand Down Expand Up @@ -59,5 +58,3 @@ int cpld_jtag_program(
unsigned char* const buffer,
refill_buffer_cb refill);
unsigned char cpld_jtag_get_next_byte(void);

#endif //__CPLD_JTAG_H__
5 changes: 1 addition & 4 deletions firmware/common/cpld_xc2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __CPLD_XC2C_H__
#define __CPLD_XC2C_H__
#pragma once

#include <stdbool.h>
#include <stdint.h>
Expand Down Expand Up @@ -69,5 +68,3 @@ bool cpld_xc2c64a_jtag_sram_verify(
extern const cpld_xc2c64a_program_t cpld_hackrf_program_sram;
extern const cpld_xc2c64a_verify_t cpld_hackrf_verify;
extern const cpld_xc2c64a_row_addresses_t cpld_hackrf_row_addresses;

#endif /*__CPLD_XC2C_H__*/
5 changes: 1 addition & 4 deletions firmware/common/crc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __CRC_H__
#define __CRC_H__
#pragma once

#include <stddef.h>
#include <stdint.h>
Expand All @@ -35,5 +34,3 @@ typedef struct {
void crc32_init(crc32_t* const crc);
void crc32_update(crc32_t* const crc, const uint8_t* const data, const size_t byte_count);
uint32_t crc32_digest(const crc32_t* const crc);

#endif //__CRC_H__
5 changes: 1 addition & 4 deletions firmware/common/da7219.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __DA7219_H
#define __DA7219_H
#pragma once

#include <stdbool.h>

#define DA7219_ADDRESS 0x1A

bool da7219_detect(void);

#endif /* __DA7219_H */
7 changes: 4 additions & 3 deletions firmware/common/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __DELAY_H
#define __DELAY_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand All @@ -31,4 +30,6 @@ extern "C" {
void delay(uint32_t duration);
void delay_us_at_mhz(uint32_t us, uint32_t mhz);

#endif /* __DELAY_H */
#ifdef __cplusplus

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

}
#endif
5 changes: 1 addition & 4 deletions firmware/common/fault_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __FAULT_HANDLER__
#define __FAULT_HANDLER__
#pragma once

#include <stdint.h>

Expand Down Expand Up @@ -71,5 +70,3 @@ static armv7m_scb_t* const SCB = (armv7m_scb_t*) SCB_BASE;
#define SCB_HFSR_DEBUGEVT (1 << 31)
#define SCB_HFSR_FORCED (1 << 30)
#define SCB_HFSR_VECTTBL (1 << 1)

#endif //__FAULT_HANDLER__
5 changes: 1 addition & 4 deletions firmware/common/firmware_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef FIRMWARE_INFO_H
#define FIRMWARE_INFO_H
#pragma once

#include <stdint.h>

Expand All @@ -33,5 +32,3 @@ struct firmware_info_t {
} __attribute__((packed, aligned(1)));

extern const struct firmware_info_t firmware_info;

#endif
5 changes: 1 addition & 4 deletions firmware/common/fixed_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __FIXED_POINT_H__
#define __FIXED_POINT_H__
#pragma once

#include <stdint.h>

Expand All @@ -32,5 +31,3 @@ typedef uint64_t fp_40_24_t;

/* one in 40.24 fixed-point */
#define FP_ONE_HZ (1 << 24)

#endif /*__FIXED_POINT_H__*/
5 changes: 1 addition & 4 deletions firmware/common/fpga.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __FPGA_H
#define __FPGA_H
#pragma once

#include <stdbool.h>
#include <stdint.h>
Expand Down Expand Up @@ -94,5 +93,3 @@ bool fpga_image_load(struct fpga_loader_t* loader, unsigned int index);
bool fpga_spi_selftest(void);
bool fpga_sgpio_selftest(void);
bool fpga_if_xcvr_selftest(void);

#endif // __FPGA_H
7 changes: 2 additions & 5 deletions firmware/common/fpga_regs.def
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -*- mode: c -*-
*
* Copyright 2012 Michael Ossmann
* Copyright 2025 Great Scott Gadgets <info@greatscottgadgets.com>
* Copyright 2025-2026 Great Scott Gadgets <info@greatscottgadgets.com>
*
* This file is part of HackRF.
*
Expand All @@ -21,8 +21,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __FPGA_REGS_DEF
#define __FPGA_REGS_DEF
#pragma once

#define FPGA_REG_SET_CLEAN(_d, _r) (_d->regs_dirty &= ~(1UL<<_r))
#define FPGA_REG_SET_DIRTY(_d, _r) (_d->regs_dirty |= (1UL<<_r))
Expand Down Expand Up @@ -71,5 +70,3 @@ __MREG__(FPGA_STANDARD_TX_INTRP, 5, 0, 3)

/* REG 06 (6): TX_PSTEP */
__MREG__(FPGA_STANDARD_TX_PSTEP, 6, 0, 8)

#endif // __FPGA_REGS_DEF
5 changes: 1 addition & 4 deletions firmware/common/gpdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __GPDMA_H__
#define __GPDMA_H__
#pragma once

#include <stddef.h>
#include <stdint.h>
Expand All @@ -40,5 +39,3 @@ void gpdma_lli_enable_interrupt(gpdma_lli_t* const lli);

void gpdma_lli_create_loop(gpdma_lli_t* const lli, const size_t lli_count);
void gpdma_lli_create_oneshot(gpdma_lli_t* const lli, const size_t lli_count);

#endif /*__GPDMA_H__*/
5 changes: 1 addition & 4 deletions firmware/common/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __GPIO_H__
#define __GPIO_H__
#pragma once

#include <stdbool.h>

Expand All @@ -35,5 +34,3 @@ void gpio_output(gpio_t gpio);
void gpio_input(gpio_t gpio);
void gpio_write(gpio_t gpio, const bool value);
bool gpio_read(gpio_t gpio);

#endif /*__GPIO_H__*/
5 changes: 1 addition & 4 deletions firmware/common/gpio_lpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __GPIO_LPC_H__
#define __GPIO_LPC_H__
#pragma once

#include <stdint.h>

Expand Down Expand Up @@ -69,5 +68,3 @@ struct gpio {
.gpio_w = GPIO_LPC_W(_port_num, _pin_num), \
}
// clang-format on

#endif /*__GPIO_LPC_H__*/
5 changes: 1 addition & 4 deletions firmware/common/hackrf_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __HACKRF_CORE_H
#define __HACKRF_CORE_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -146,5 +145,3 @@ void pps_out_set(const uint8_t value);
#ifdef __cplusplus
}
#endif

#endif /* __HACKRF_CORE_H */
5 changes: 1 addition & 4 deletions firmware/common/hackrf_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef HACKRF_UI_H
#define HACKRF_UI_H
#pragma once

#include <stdbool.h>
#include <stdint.h>
Expand Down Expand Up @@ -71,5 +70,3 @@ typedef struct {
*/
const hackrf_ui_t* hackrf_ui(void);
void hackrf_ui_set_enable(bool);

#endif
5 changes: 1 addition & 4 deletions firmware/common/i2c_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __I2C_BUS_H__
#define __I2C_BUS_H__
#pragma once

#include <stddef.h>
#include <stdint.h>
Expand Down Expand Up @@ -51,5 +50,3 @@ void i2c_bus_transfer(
const size_t tx_count,
uint8_t* const rx,
const size_t rx_count);

#endif /*__I2C_BUS_H__*/
5 changes: 1 addition & 4 deletions firmware/common/i2c_lpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __I2C_LPC_H__
#define __I2C_LPC_H__
#pragma once

#include <stdbool.h>
#include <stddef.h>
Expand All @@ -43,5 +42,3 @@ void i2c_lpc_transfer(
uint8_t* const data_rx,
const size_t count_rx);
bool i2c_probe(i2c_bus_t* const bus, const uint_fast8_t device_address);

#endif /*__I2C_LPC_H__*/
5 changes: 1 addition & 4 deletions firmware/common/ice40_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __ICE40_SPI_H
#define __ICE40_SPI_H
#pragma once

#include <stdbool.h>
#include <stdint.h>
Expand All @@ -47,5 +46,3 @@ bool ice40_spi_syscfg_program(
uint8_t* buf,
size_t (*read_block_cb)(void* ctx),
void* read_ctx);

#endif // __ICE40_SPI_H
5 changes: 1 addition & 4 deletions firmware/common/locking.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __LOCKING_H__
#define __LOCKING_H__
#pragma once

#include <stdint.h>

Expand Down Expand Up @@ -51,5 +50,3 @@ static inline uint32_t store_exclusive(uint32_t val, volatile uint32_t* addr)
return 0;
}
#endif

#endif /* __LOCKING_H__ */
5 changes: 1 addition & 4 deletions firmware/common/lz4_blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __LZ4_BLK_H
#define __LZ4_BLK_H
#pragma once

#include <stdint.h>
#include <stdlib.h>

int lz4_blk_decompress(const uint8_t* src, uint8_t* dst, size_t length);

#endif
5 changes: 1 addition & 4 deletions firmware/common/lz4_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef __LZ4_BUF_H
#define __LZ4_BUF_H
#pragma once

#include <stdint.h>

Expand All @@ -31,5 +30,3 @@

extern uint8_t lz4_in_buf[LZ4_BUFFER_SIZE];
extern uint8_t lz4_out_buf[LZ4_BUFFER_SIZE];

#endif /*__LZ4_BUF_H */
Loading
Loading