ARMEBS4  revision-26.06.2015
Files | Functions
Board support package

Support for common devices (buttons, leds, ...) More...

Collaboration diagram for Board support package:

Files

file  bsp_armebs4.h
 BSP for ARMEBS4.
 
file  bsp_armebs4_eth.h
 BSP for ARMEBS4 Ethernet.
 
file  bsp_envirobot_sc.h
 BSP for Envirobot Sensor Control.
 
file  bsp_stm32f4_discovery.h
 BSP for stm32f4 discovery.
 
file  bsp_stm32f4_discovery.h
 BSP for stm32f4 discovery.
 
file  bsp_stm32f4_geval.h
 BSP for stm3240 g-eval board.
 

Functions

status_e bsp_init (void)
 Initialize the whole board. More...
 
void bsp_led_set (uint32_t nr, uint32_t value)
 Set a led (ON or OFF) More...
 
uint32_t bsp_button_get (uint32_t nr)
 Get a button. More...
 
uint32_t bsp_button_get_all (void)
 Get all buttons. More...
 
const struct gpio_tbsp_button_gpios (void)
 get buttons gpios More...
 
status_e bsp_set_button_irq_handler (void(*handler)(uint32_t is, uint32_t was))
 Set a irq handler for all button changes. More...
 
void bsp_led_toggle (uint32_t nr)
 toggle a led More...
 
void bsp_fatal (status_e status)
 fatal error More...
 
void bsp_reset_reason_init (void)
 Reset reason initialization. More...
 
uint32_t bsp_reset_reason_get (void)
 Reset reason get. More...
 
void bsp_reset_reason_clear (void)
 Reset reason clear. More...
 

Detailed Description

Support for common devices (buttons, leds, ...)

Function Documentation

status_e bsp_init ( void  )

Initialize the whole board.

Returns
NO_ERROR for no problem

Definition at line 525 of file bsp_armebs4.c.

References ARRAY_SIZE, bsp_eth_powerdown(), BSP_PWM_LED_STEPS, gpio_setup(), gpio_setup_list(), NO_ERROR, and ram_test_basic().

Referenced by Reset_Handler().

Here is the call graph for this function:

Here is the caller graph for this function:

void bsp_led_set ( uint32_t  nr,
uint32_t  value 
)

Set a led (ON or OFF)

Parameters
nrthe led number
value0 for OFF, anything else : ON

Definition at line 244 of file bsp_armebs4.c.

References BSP_PWM_LED_STEPS.

uint32_t bsp_button_get ( uint32_t  nr)

Get a button.

Parameters
nrthe button number
Returns
value 0 for "not pressed", anything else : "pressed"

Definition at line 340 of file bsp_armebs4.c.

References BSP_BUTTON_NR, and gpio_get().

Referenced by bsp_button_get_all().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t bsp_button_get_all ( void  )

Get all buttons.

Returns
the value of each buttons stored in every bits of the return value

Definition at line 9 of file bsp.c.

References bsp_button_get(), and BSP_BUTTON_NR.

Referenced by bsp_set_button_irq_handler().

Here is the call graph for this function:

Here is the caller graph for this function:

const struct gpio_t* bsp_button_gpios ( void  )

get buttons gpios

Returns
the pointer on the first element of an array of gpios

Definition at line 350 of file bsp_armebs4.c.

Referenced by bsp_set_button_irq_handler().

Here is the caller graph for this function:

status_e bsp_set_button_irq_handler ( void(*)(uint32_t is, uint32_t was)  handler)

Set a irq handler for all button changes.

Parameters
handlerThe handler for button changed with those parameters is : the current value, was, the value of the last call
Returns
NO_ERROR for no problem

Definition at line 34 of file bsp.c.

References bsp_button_get_all(), bsp_button_gpios(), BSP_BUTTON_NR, ERROR_BAD_PARAM, GPIO_IRQ_MODE_EDGE_BOTH, gpio_irq_setup(), and NO_ERROR.

Here is the call graph for this function:

void bsp_led_toggle ( uint32_t  nr)

toggle a led

Parameters
nrthe led number

Definition at line 249 of file bsp_armebs4.c.

References BSP_PWM_LED_STEPS, TIM_TypeDef::CCR1, and gpio_t::nr.

void bsp_fatal ( status_e  status)

fatal error

Parameters
statusThe status of the fatal error

This function will halt the CPU if a debugger is connected.

Definition at line 123 of file bsp.c.

References breakpoint, and debugger_is_connected.

Referenced by _sbrk(), HardFaultHelper(), and Reset_Handler().

Here is the caller graph for this function:

void bsp_reset_reason_init ( void  )

Reset reason initialization.

Save the reset reason, called from startup code

Definition at line 175 of file bsp.c.

Referenced by Reset_Handler().

Here is the caller graph for this function:

uint32_t bsp_reset_reason_get ( void  )

Reset reason get.

Returns
the value of RCC->CSR at boot time

This value has been saved by bsp_reset_reason_init from startup code

Definition at line 180 of file bsp.c.

Referenced by Reset_Handler().

Here is the caller graph for this function:

void bsp_reset_reason_clear ( void  )

Reset reason clear.

Clear the reset reason value from RCC->CSR

Definition at line 185 of file bsp.c.

Referenced by Reset_Handler().

Here is the caller graph for this function: