PicoWAN SDK Documentation
Data Structures | Macros | Enumerations | Functions
system.h File Reference

System related stuff. More...

#include <stdint.h>
#include <arch.h>
#include "gpio.h"

Go to the source code of this file.

Data Structures

struct  io_pin_t
 

Macros

#define PIN_END   255
 

Enumerations

enum  rf_path_t {
  PATH_RX, PATH_TX_RFO, PATH_TX_PA,
  PATH_NONE
}
 

Functions

void system_set_dcdc_high_power (uint8_t en)
 Switches the DC-DC converter to high-power mode. More...
 
void system_enable_sx_power (uint8_t en)
 Powers up/down the radio IC. More...
 
void system_enable_sx_clock (uint8_t en)
 Enables/disables the radio IC's clock. More...
 
void system_try_select_rf_path (rf_path_t path)
 Selects the requested RF path. More...
 
void system_set_sx_nss (uint8_t state)
 Sets to HIGH or LOW the radio nSS (inverted slave select) pin (for SPI communication). More...
 
void system_set_sx_rst (uint8_t state)
 Sets to HIGH, LOW, or floating the radio reset pin (for SPI communication). More...
 
void system_disable_irqs (void)
 Disables all IRQs.
 
void system_enable_irqs (void)
 Enables all IRQs.
 
void system_register_lowpower_pins (io_pin_t *pins)
 Registers additional pins whose configuration and state must be kept when the board/device is in low-power sleep mode. More...
 
void system_sleep (void)
 Enters sleep mode. More...
 
void system_sleep_low_power (void)
 Enters low-power sleep mode. More...
 
void system_reboot (void)
 Reboots the system.
 
void system_init (void)
 Initializes the system (IOs, clocks, ...). More...
 

Detailed Description

System related stuff.

Copyright (c) 2018, Archos S.A. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND AND EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARCHOS S.A. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

void system_enable_sx_clock ( uint8_t  en)

Enables/disables the radio IC's clock.

Parameters
en1 enable the clock, 0 to disable it.
void system_enable_sx_power ( uint8_t  en)

Powers up/down the radio IC.

Parameters
en1 to power up the radio IC, 0 to power it down.
void system_init ( void  )

Initializes the system (IOs, clocks, ...).

Note
This function is used by the scheduler and should not be called anywhere else.
void system_register_lowpower_pins ( io_pin_t pins)

Registers additional pins whose configuration and state must be kept when the board/device is in low-power sleep mode.

Note
Any pin whose function cannot dynamically change should be declared in boards.h instead.
Parameters
pinsThe pins to register.
void system_set_dcdc_high_power ( uint8_t  en)

Switches the DC-DC converter to high-power mode.

If the DC-DC converter of the board supports different power modes, this function allows to switch from low-power to high-power mode.

Parameters
en1 to enable the high power mode, 0 to disable it.
void system_set_sx_nss ( uint8_t  state)

Sets to HIGH or LOW the radio nSS (inverted slave select) pin (for SPI communication).

Parameters
state1 for HIGH the pin (deselects the radio IC), 0 for LOW (selects the radio IC).
void system_set_sx_rst ( uint8_t  state)

Sets to HIGH, LOW, or floating the radio reset pin (for SPI communication).

Parameters
state1 for HIGH the pin, 0 for LOW (selects the radio IC), or 2 for floating.
void system_sleep ( void  )

Enters sleep mode.

Note
This function is used by the scheduler and should not be called anywhere else.
void system_sleep_low_power ( void  )

Enters low-power sleep mode.

Note
This function is used by the scheduler and should not be called anywhere else.
void system_try_select_rf_path ( rf_path_t  path)

Selects the requested RF path.

Note
What can actually be done depends on the RF switches available on the board.
Parameters
pathThe path to select. This can be PATH_RX, PATH_TX_RFO, PATH_TX_PA, or PATH_NONE.