Compare commits
12 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdf1a956eb | ||
|
|
336aae518e | ||
|
|
6c1150f3f4 | ||
|
|
a2576202ff | ||
|
|
26fd36f853 | ||
|
|
3ad5e1570c | ||
|
|
a2c7d7507b | ||
|
|
ea40696827 | ||
|
|
5867849b17 | ||
|
|
6f7dc67791 | ||
|
|
090c5cd83b | ||
|
|
20b9823aca |
11 changed files with 34 additions and 77 deletions
|
|
@ -1,12 +1,20 @@
|
|||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, pico_base
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, group=pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, group=pico_base
|
||||
set(PICO_SDK_VERSION_MAJOR 1)
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, pico_base
|
||||
set(PICO_SDK_VERSION_MINOR 1)
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, pico_base
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
|
||||
set(PICO_SDK_VERSION_MINOR 2)
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
|
||||
set(PICO_SDK_VERSION_REVISION 0)
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
|
||||
set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
|
||||
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
|
||||
# PICO_CONFIG: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
|
||||
set(PICO_SDK_VERSION_STRING "${PICO_SDK_VERSION_MAJOR}.${PICO_SDK_VERSION_MINOR}.${PICO_SDK_VERSION_REVISION}")
|
||||
|
||||
if (PICO_SDK_VERSION_PRE_RELEASE_ID)
|
||||
set(PICO_SDK_VERSION_STRING "${PICO_SDK_VERSION_STRING}-${PICO_SDK_VERSION_PRE_RELEASE_ID}")
|
||||
endif()
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
// set to 0xaa0 + div where
|
||||
// div = 0 divides by 32
|
||||
// div = 1-31 divides by div
|
||||
// any other value sets div=0 and therefore divides by 32
|
||||
// any other value sets div=31
|
||||
// this register resets to div=16
|
||||
// 0xaa0 -> PASS
|
||||
#define ROSC_DIV_OFFSET _u(0x00000010)
|
||||
|
|
@ -208,7 +208,7 @@
|
|||
#define ROSC_PHASE_RESET _u(0x00000008)
|
||||
// -----------------------------------------------------------------------------
|
||||
// Field : ROSC_PHASE_PASSWD
|
||||
// Description : set to 0xaa0
|
||||
// Description : set to 0xaa
|
||||
// any other value enables the output with shift=0
|
||||
#define ROSC_PHASE_PASSWD_RESET _u(0x00)
|
||||
#define ROSC_PHASE_PASSWD_BITS _u(0x00000ff0)
|
||||
|
|
@ -260,7 +260,7 @@
|
|||
// -----------------------------------------------------------------------------
|
||||
// Field : ROSC_STATUS_BADWRITE
|
||||
// Description : An invalid value has been written to CTRL_ENABLE or
|
||||
// CTRL_FREQ_RANGE or FRFEQA or FREQB or DORMANT
|
||||
// CTRL_FREQ_RANGE or FREQA or FREQB or DORMANT
|
||||
#define ROSC_STATUS_BADWRITE_RESET _u(0x0)
|
||||
#define ROSC_STATUS_BADWRITE_BITS _u(0x01000000)
|
||||
#define ROSC_STATUS_BADWRITE_MSB _u(24)
|
||||
|
|
|
|||
|
|
@ -29321,7 +29321,7 @@
|
|||
<description>set to 0xaa0 + div where\n
|
||||
div = 0 divides by 32\n
|
||||
div = 1-31 divides by div\n
|
||||
any other value sets div=0 and therefore divides by 32\n
|
||||
any other value sets div=31\n
|
||||
this register resets to div=16</description>
|
||||
<enumeratedValues>
|
||||
<enumeratedValue>
|
||||
|
|
@ -29342,7 +29342,7 @@
|
|||
<field>
|
||||
<access>read-write</access>
|
||||
<bitRange>[11:4]</bitRange>
|
||||
<description>set to 0xaa0\n
|
||||
<description>set to 0xaa\n
|
||||
any other value enables the output with shift=0</description>
|
||||
<name>PASSWD</name>
|
||||
</field>
|
||||
|
|
@ -29385,7 +29385,7 @@
|
|||
<field>
|
||||
<access>read-write</access>
|
||||
<bitRange>[24:24]</bitRange>
|
||||
<description>An invalid value has been written to CTRL_ENABLE or CTRL_FREQ_RANGE or FRFEQA or FREQB or DORMANT</description>
|
||||
<description>An invalid value has been written to CTRL_ENABLE or CTRL_FREQ_RANGE or FREQA or FREQB or DORMANT</description>
|
||||
<modifiedWriteValues>oneToClear</modifiedWriteValues>
|
||||
<name>BADWRITE</name>
|
||||
</field>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ endif()
|
|||
set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_DEFAULT_BOOT_STAGE2_FILE}" CACHE STRING "boot_stage2 source file" FORCE)
|
||||
|
||||
if (NOT EXISTS ${PICO_DEFAULT_BOOT_STAGE2_FILE})
|
||||
message(FATAL_ERROR "Specified boot_stage2 source '${PICO_BOOT_STAGE2_FILE}' does not exist.")
|
||||
message(FATAL_ERROR "Specified boot_stage2 source '${PICO_DEFAULT_BOOT_STAGE2_FILE}' does not exist.")
|
||||
endif()
|
||||
|
||||
# needed by function below
|
||||
|
|
|
|||
|
|
@ -123,9 +123,12 @@ typedef void (*irq_handler_t)(void);
|
|||
* \ingroup hardware_irq
|
||||
*
|
||||
* \param num Interrupt number
|
||||
* \param hardware_priority Priority to set. Hardware priorities range from 0 (lowest) to 255 (highest) though only
|
||||
* the top 2 bits are significant on ARM Cortex M0+. To make it easier to specify higher or lower priorities
|
||||
* than the default, all IRQ priorities are initialized to PICO_DEFAULT_IRQ_PRIORITY by the SDK runtime at startup.
|
||||
* \param hardware_priority Priority to set.
|
||||
* Numerically-lower values indicate a higher priority. Hardware priorities
|
||||
* range from 0 (highest priority) to 255 (lowest priority) though only the
|
||||
* top 2 bits are significant on ARM Cortex-M0+. To make it easier to specify
|
||||
* higher or lower priorities than the default, all IRQ priorities are
|
||||
* initialized to PICO_DEFAULT_IRQ_PRIORITY by the SDK runtime at startup.
|
||||
* PICO_DEFAULT_IRQ_PRIORITY defaults to 0x80
|
||||
*/
|
||||
void irq_set_priority(uint num, uint8_t hardware_priority);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ static_assert(PIO_INSTRUCTION_COUNT <= 32, "");
|
|||
static uint32_t _used_instruction_space[2];
|
||||
|
||||
static int _pio_find_offset_for_program(PIO pio, const pio_program_t *program) {
|
||||
assert(program->length < PIO_INSTRUCTION_COUNT);
|
||||
assert(program->length <= PIO_INSTRUCTION_COUNT);
|
||||
uint32_t used_mask = _used_instruction_space[pio_get_index(pio)];
|
||||
uint32_t program_mask = (1u << program->length) - 1;
|
||||
if (program->origin >= 0) {
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@ inline static void restore_interrupts(uint32_t status) {
|
|||
* \return The spinlock instance
|
||||
*/
|
||||
inline static spin_lock_t *spin_lock_instance(uint lock_num) {
|
||||
invalid_params_if(SYNC, lock_num >= NUM_SPIN_LOCKS);
|
||||
return (spin_lock_t *) (SIO_BASE + SIO_SPINLOCK0_OFFSET + lock_num * 4);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,10 +84,10 @@ static inline bool multicore_fifo_rvalid(void) {
|
|||
return !!(sio_hw->fifo_st & SIO_FIFO_ST_VLD_BITS);
|
||||
}
|
||||
|
||||
/*! \brief Check the FIFO to see if the write FIFO is full
|
||||
/*! \brief Check the write FIFO to see if it is ready for more data
|
||||
* \ingroup multicore_fifo
|
||||
*
|
||||
* @return true if the FIFO is full, false otherwise
|
||||
* @return true if the FIFO has room for more data, false otherwise
|
||||
*/
|
||||
static inline bool multicore_fifo_wready(void) {
|
||||
return !!(sio_hw->fifo_st & SIO_FIFO_ST_RDY_BITS);
|
||||
|
|
|
|||
|
|
@ -44,17 +44,3 @@ function(pico_add_uf2_output TARGET)
|
|||
COMMAND ELF2UF2 ${TARGET}${CMAKE_EXECUTABLE_SUFFIX} ${TARGET}.uf2)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if (NOT DEFINED PICO_BUILD_PICOFLASH)
|
||||
if (DEFINED ENV{PICO_BUILD_PICOFLASH})
|
||||
set(PICO_BUILD_PICOFLASH $ENV{PICO_BUILD_PICOFLASH})
|
||||
else()
|
||||
# for now
|
||||
set(PICO_BUILD_PICOFLASH 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (PICO_BUILD_PICOTOOL)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PICO_SDK_PATH}/tools)
|
||||
find_package(Picotool REQUIRED)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
# Finds (or builds) the PICOTOOL executable
|
||||
#
|
||||
# This will define the following variables
|
||||
#
|
||||
# PICOTOOL_FOUND
|
||||
#
|
||||
# and the following imported targets
|
||||
#
|
||||
# PICOTOOL
|
||||
#
|
||||
|
||||
if (NOT PICOTOOL_FOUND)
|
||||
# todo we would like to use pckgconfig to look for it first
|
||||
# see https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
set(PICOTOOL_SOURCE_DIR ${PICO_SDK_PATH}/tools/picotool)
|
||||
set(PICOTOOL_BINARY_DIR ${CMAKE_BINARY_DIR}/picotool)
|
||||
|
||||
set(PICOTOOL_BUILD_TARGET PicotoolBuild)
|
||||
set(PICOTOOL_TARGET Picotool)
|
||||
|
||||
if (NOT TARGET ${PICOTOOL_BUILD_TARGET})
|
||||
message("PICOTOOL will need to be built")
|
||||
ExternalProject_Add(${PICOTOOL_BUILD_TARGET}
|
||||
PREFIX picotool SOURCE_DIR ${PICOTOOL_SOURCE_DIR}
|
||||
BINARY_DIR ${PICOTOOL_BINARY_DIR}
|
||||
BUILD_ALWAYS 1 # force dependency checking
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
endif()
|
||||
|
||||
set(PICOTOOL_EXECUTABLE ${PICOTOOL_BINARY_DIR}/picotool)
|
||||
if(NOT TARGET ${PICOTOOL_TARGET})
|
||||
add_executable(${PICOTOOL_TARGET} IMPORTED)
|
||||
endif()
|
||||
set_property(TARGET ${PICOTOOL_TARGET} PROPERTY IMPORTED_LOCATION
|
||||
${PICOTOOL_EXECUTABLE})
|
||||
|
||||
add_dependencies(${PICOTOOL_TARGET} ${PICOTOOL_BUILD_TARGET})
|
||||
set(PICOTOOL_FOUND 1)
|
||||
endif()
|
||||
|
|
@ -68,6 +68,8 @@ struct c_sdk_output : public output_format {
|
|||
|
||||
header(out, "This file is autogenerated by pioasm; do not edit!");
|
||||
|
||||
fprintf(out, "#pragma once\n");
|
||||
fprintf(out, "\n");
|
||||
fprintf(out, "#if !PICO_NO_HARDWARE\n");
|
||||
fprintf(out, "#include \"hardware/pio.h\"\n");
|
||||
fprintf(out, "#endif\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue