px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
px_board.h : Piconomix ATmega328P Scorpion Board

Description

Piconomix ATmega328P Scorpion Board

File(s):

Macros

#define PX_BOARD_PX_SCORPION
 Board name. More...
 
#define F_CPU   7372800ul
 Processor frequency in Hz. More...
 
#define PX_PB_IS_PRESSED()   PX_GPIO_IN_IS_LO(PX_GPIO_PB)
 Detect if push button is being pressed. More...
 
#define PX_LED_ON()   PX_GPIO_OUT_SET_HI(PX_GPIO_LED)
 Enable LED. More...
 
#define PX_LED_OFF()   PX_GPIO_OUT_SET_LO(PX_GPIO_LED)
 Disable LED. More...
 
#define PX_LED_TOGGLE()   PX_GPIO_OUT_TOGGLE(PX_GPIO_LED)
 Toggle LED. 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_NONE = 0 ,
  PX_BOARD_SPI_CS , PX_BOARD_SPI_CS_DF
}
 Identify which GPIO pins are used for CS in board_spi_cs_lo() and 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_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...
 

ADC Channel mux definitions

#define ADC0   1
 
#define ADC1   0
 
#define ADC2   7
 
#define ADC3   6
 

Macro Definition Documentation

◆ PX_BOARD_PX_SCORPION

#define PX_BOARD_PX_SCORPION

Board name.

Definition at line 45 of file px_board.h.

◆ F_CPU

#define F_CPU   7372800ul

Processor frequency in Hz.

Definition at line 49 of file px_board.h.

◆ PX_PB_IS_PRESSED

#define PX_PB_IS_PRESSED ( )    PX_GPIO_IN_IS_LO(PX_GPIO_PB)

Detect if push button is being pressed.

Definition at line 107 of file px_board.h.

◆ PX_LED_ON

#define PX_LED_ON ( )    PX_GPIO_OUT_SET_HI(PX_GPIO_LED)

Enable LED.

Definition at line 110 of file px_board.h.

◆ PX_LED_OFF

#define PX_LED_OFF ( )    PX_GPIO_OUT_SET_LO(PX_GPIO_LED)

Disable LED.

Definition at line 112 of file px_board.h.

◆ PX_LED_TOGGLE

#define PX_LED_TOGGLE ( )    PX_GPIO_OUT_TOGGLE(PX_GPIO_LED)

Toggle LED.

Definition at line 114 of file px_board.h.

Enumeration Type Documentation

◆ px_board_spi_cs_t

Identify which GPIO pins are used for CS in board_spi_cs_lo() and 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 62 of file px_board.h.

Function Documentation

◆ px_board_init()

void px_board_init ( void  )

Initialise the board hardware.

Definition at line 168 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 180 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 192 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 222 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 234 of file px_board.c.