px-lib  0.9.3
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers

Description

File(s):

Macros

#define PX_BOARD_PICONOMIX_HERO_BOARD
 Board name. More...
 
#define PX_BOARD_SYS_CLK_HZ   32000000ul
 System clock frequency in Hz. More...
 
#define PX_BOARD_PER_CLK_HZ   PX_BOARD_SYS_CLK_HZ
 Peripheral clock frequency in Hz. More...
 
#define PX_USR_PB_IS_PRESSED()   px_gpio_pin_is_lo(&px_gpio_lcd_btn_6_no)
 User button. More...
 
#define PX_USR_LED_ON()   px_gpio_pin_set_hi(&px_gpio_usr_led)
 User LED. More...
 
#define PX_LCD_RS_LO()   px_gpio_pin_set_lo(&px_gpio_lcd_rs)
 LCD. More...
 

Enumerations

enum  px_board_spi_cs_t {
  PX_BOARD_SPI_CS_NONE, PX_BOARD_SPI1_CS, PX_BOARD_SPI1_CS_SD, PX_BOARD_SPI2_CS_LCD,
  PX_BOARD_SPI2_CS_SF, PX_BOARD_SPI_CS_NONE = 0, PX_BOARD_SPI_SS, PX_BOARD_SPI_D2,
  PX_BOARD_SPI_D3, PX_BOARD_SPI_D4, PX_BOARD_SPI_D5, PX_BOARD_SPI_D6,
  PX_BOARD_SPI_D7, PX_BOARD_SPI_D8, PX_BOARD_SPI_D9 , PX_BOARD_SPI_CS,
  PX_BOARD_SPI_CS_DF
}
 Identify which GPIO pins are used for CS in px_board_spi_cs_lo() and px_board_spi_cs_hi() More...
 

Functions

void px_board_init (void)
 Initialise the board hardware. More...
 
void px_board_spi_cs_lo (uint8_t cs_id)
 Set specified SPI Chip Select low. More...
 
void px_board_spi_cs_hi (uint8_t cs_id)
 Set specified SPI Chip Select high. More...
 
void px_board_delay_init (void)
 Initialise Timer 6 with 1 us clock ticks for delay use. More...
 
void px_board_delay_deinit (void)
 Disable Timer 6. More...
 
void px_board_delay_us (uint16_t delay_us)
 Blocking delay for specified number of microseconds. More...
 
void px_board_delay_ms (uint16_t delay_ms)
 Blocking delay for specified number of milliseconds. More...
 
void px_board_buzzer_on (uint16_t freq_hz)
 Enable PWM output to piezo buzzer at specified frequency. More...
 
void px_board_buzzer_off (void)
 Disable PWM output to piezo buzzer. More...
 
void px_board_dbg_enable (void)
 Enable DBG module during SLEEP and STOP mode. More...
 
void px_board_dbg_disable (void)
 Disable DBG module. More...
 
void px_board_stop_mode (void)
 Enter low power STOP mode and wait for interrupt to wake up core. More...
 

Mapping of board's ADC pins to ADC channels

#define PX_BOARD_ADC0   PX_ADC_CH8
 
#define PX_BOARD_ADC1   PX_ADC_CH15
 
#define PX_BOARD_ADC2   PX_ADC_CH14
 
#define PX_BOARD_ADC3   PX_ADC_CH7
 
#define PX_BOARD_ADC_VBAT   PX_ADC_CH9
 

Macro Definition Documentation

◆ PX_BOARD_PICONOMIX_HERO_BOARD

#define PX_BOARD_PICONOMIX_HERO_BOARD

Board name.

Definition at line 42 of file px_board.h.

◆ PX_BOARD_SYS_CLK_HZ

#define PX_BOARD_SYS_CLK_HZ   32000000ul

System clock frequency in Hz.

Definition at line 45 of file px_board.h.

◆ PX_BOARD_PER_CLK_HZ

#define PX_BOARD_PER_CLK_HZ   PX_BOARD_SYS_CLK_HZ

Peripheral clock frequency in Hz.

Definition at line 48 of file px_board.h.

◆ PX_USR_PB_IS_PRESSED

#define PX_USR_PB_IS_PRESSED ( )    px_gpio_pin_is_lo(&px_gpio_lcd_btn_6_no)

User button.

Definition at line 150 of file px_board.h.

◆ PX_USR_LED_ON

#define PX_USR_LED_ON ( )    px_gpio_pin_set_hi(&px_gpio_usr_led)

User LED.

Definition at line 153 of file px_board.h.

◆ PX_LCD_RS_LO

#define PX_LCD_RS_LO ( )    px_gpio_pin_set_lo(&px_gpio_lcd_rs)

LCD.

Definition at line 158 of file px_board.h.

Enumeration Type Documentation

◆ px_board_spi_cs_t

Identify which GPIO pins are used for CS in px_board_spi_cs_lo() and px_board_spi_cs_hi()

Enumerator
PX_BOARD_SPI_CS_NONE 

Do not perform a chip select.

PX_BOARD_SPI1_CS 

Peripheral CS.

PX_BOARD_SPI1_CS_SD 

SD Card.

PX_BOARD_SPI2_CS_LCD 

JHD JHD12864-G176BSW 128x64 monochrome LCD.

PX_BOARD_SPI2_CS_SF 

Adesto AT25S Serial FLASH.

PX_BOARD_SPI_CS_NONE 

Slave Select pin.

PX_BOARD_SPI_SS 

Slave Select pin.

PX_BOARD_SPI_D2 

Digital 2.

PX_BOARD_SPI_D3 

Digital 3.

PX_BOARD_SPI_D4 

Digital 4.

PX_BOARD_SPI_D5 

Digital 5.

PX_BOARD_SPI_D6 

Digital 6.

PX_BOARD_SPI_D7 

Digital 7.

PX_BOARD_SPI_D8 

Digital 8.

PX_BOARD_SPI_D9 

Digital 9.

PX_BOARD_SPI_CS 

General CS pin on SPI header.

PX_BOARD_SPI_CS_DF 

Adesto AT45D DataFlash.

Definition at line 52 of file px_board.h.

Function Documentation

◆ px_board_init()

void px_board_init ( void  )

Initialise the board hardware.

Definition at line 186 of file px_board.c.

◆ px_board_spi_cs_lo()

void px_board_spi_cs_lo ( uint8_t  cs_id)

Set specified SPI Chip Select low.

Parameters
cs_idID which GPIO pin must be used for Chip Select

Definition at line 201 of file px_board.c.

◆ px_board_spi_cs_hi()

void px_board_spi_cs_hi ( uint8_t  cs_id)

Set specified SPI Chip Select high.

Parameters
cs_idID which GPIO pin must be used for Chip Select

Definition at line 213 of file px_board.c.

◆ px_board_delay_init()

void px_board_delay_init ( void  )

Initialise Timer 6 with 1 us clock ticks for delay use.

Definition at line 225 of file px_board.c.

◆ px_board_delay_deinit()

void px_board_delay_deinit ( void  )

Disable Timer 6.

Definition at line 237 of file px_board.c.

◆ px_board_delay_us()

void px_board_delay_us ( uint16_t  delay_us)

Blocking delay for specified number of microseconds.

Parameters
delay_usNumber of microseconds to block

Definition at line 243 of file px_board.c.

◆ px_board_delay_ms()

void px_board_delay_ms ( uint16_t  delay_ms)

Blocking delay for specified number of milliseconds.

Parameters
delay_msNumber of milliseconds to block

Definition at line 258 of file px_board.c.

◆ px_board_buzzer_on()

void px_board_buzzer_on ( uint16_t  freq_hz)

Enable PWM output to piezo buzzer at specified frequency.

Parameters
freq_hzPWM frequency in Hz

Definition at line 267 of file px_board.c.

◆ px_board_buzzer_off()

void px_board_buzzer_off ( void  )

Disable PWM output to piezo buzzer.

Definition at line 298 of file px_board.c.

◆ px_board_dbg_enable()

void px_board_dbg_enable ( void  )

Enable DBG module during SLEEP and STOP mode.

Definition at line 308 of file px_board.c.

◆ px_board_dbg_disable()

void px_board_dbg_disable ( void  )

Disable DBG module.

Definition at line 322 of file px_board.c.

◆ px_board_stop_mode()

void px_board_stop_mode ( void  )

Enter low power STOP mode and wait for interrupt to wake up core.

NB! Debug module must be disabled during STOP mode, otherwise SysTick interrupt will wake up core.

Definition at line 336 of file px_board.c.