54 #define BUTTONS_MB851A 1
58 #define BUTTONS_MB851B 1
62 #define BUTTONS_MB851C 1
66 #define BUTTONS_MB954A 1
70 #define BUTTONS_MB954B 1
74 #define BUTTONS_MB950A 5
78 #define BUTTONS_MB951A 1
143 #define BOARD_HAS_MEMS (1 << 0)
147 #define BOARD_HAS_TEMP_SENSOR (1 << 1)
151 #define BOARD_HAS_PA (1 << 2)
155 #define BOARD_HAS_EEPROM (1 << 3)
159 #define BOARD_HAS_FTDI (1 << 4)
163 #define BOARD_HAS_STM32F (1 << 5)
170 const uint32_t flags;
188 #define GPIO_PxCLR_BASE (GPIO_PACLR_ADDR)
189 #define GPIO_PxSET_BASE (GPIO_PASET_ADDR)
190 #define GPIO_PxOUT_BASE (GPIO_PAOUT_ADDR)
191 #define GPIO_PxIN_BASE (GPIO_PAIN_ADDR)
193 #define GPIO_Px_OFFSET (GPIO_PBCFGL_ADDR-GPIO_PACFGL_ADDR)
197 #define LED_D1 PORTx_PIN(boardDescription->io->leds[0].gpioPort, boardDescription->io->leds[0].gpioPin) //PORTB_PIN(6)
198 #define LED_D3 PORTx_PIN(boardDescription->io->leds[1].gpioPort, boardDescription->io->leds[1].gpioPin) // PORTB_PIN(5)
199 #define DUMMY_LED 0xff
203 #define BUTTON_Sn(n) (PORTx_PIN(boardDescription->io->buttons[n].gpioPort, boardDescription->io->buttons[n].gpioPin))
204 #define BUTTON_Sn_WAKE_SOURCE(n) (1 << ((boardDescription->io->buttons[n].gpioPin) + (8 * (boardDescription->io->buttons[n].gpioPort >> 3))))
205 #define BUTTON_INPUT_GPIO(port) *((volatile uint32_t *) (GPIO_PxIN_BASE + GPIO_Px_OFFSET * port))
206 #define DUMMY_BUTTON 0xff
208 #define BUTTON_S1 (boardDescription->buttons>0 ? BUTTON_Sn(0): DUMMY_BUTTON)
209 #define BUTTON_S2 (boardDescription->buttons>1 ? BUTTON_Sn(1): DUMMY_BUTTON)
210 #define BUTTON_S3 (boardDescription->buttons>2 ? BUTTON_Sn(2): DUMMY_BUTTON)
211 #define BUTTON_S4 (boardDescription->buttons>3 ? BUTTON_Sn(3): DUMMY_BUTTON)
212 #define BUTTON_S5 (boardDescription->buttons>4 ? BUTTON_Sn(4): DUMMY_BUTTON)
214 #define BUTTON_S1_WAKE_SOURCE (boardDescription->buttons>0 ? BUTTON_Sn_WAKE_SOURCE(0): 0)
215 #define BUTTON_S2_WAKE_SOURCE (boardDescription->buttons>1 ? BUTTON_Sn_WAKE_SOURCE(1): 0)
216 #define BUTTON_S3_WAKE_SOURCE (boardDescription->buttons>2 ? BUTTON_Sn_WAKE_SOURCE(2): 0)
217 #define BUTTON_S4_WAKE_SOURCE (boardDescription->buttons>3 ? BUTTON_Sn_WAKE_SOURCE(3): 0)
218 #define BUTTON_S5_WAKE_SOURCE (boardDescription->buttons>4 ? BUTTON_Sn_WAKE_SOURCE(4): 0)
221 #define UART_TX PORTB_PIN(1)
222 #define UART_RX PORTB_PIN(2)
223 #define UART_RX_WAKE_SOURCE 0x00000400
226 #define TEMPERATURE_SENSOR_GPIO PORTx_PIN(boardDescription->temperatureSensor->gpioPort, boardDescription->temperatureSensor->gpioPin) // PORTB_PIN(7)
uint8_t buttons
Number of buttons.
const InfraRedLedResourceType * infraredLed
Board infrared led description.
struct BoardIOStruct BoardIOType
Data structure for board user I/O.
uint8_t leds
Number of leds.
uint8_t gpioPin
GPIO pin associated with the button.
uint8_t gpioPin
GPIO pin associated with the LED.
uint8_t scPort
Serial communication port associated with the MEMS.
Data structure for board user I/O.
char * name
Name of the temperature sensor device.
const LedResourceType * leds
Pointer to LED resources.
char * name
Name of the LED as printed in the board.
Data structure for button description.
uint8_t gpioPort
GPIO port associated with the LED.
uint8_t gpioPort
GPIO port associated with the sensor.
void halBoardPowerDown(void)
Perform board specific action to power down the system, usually before going to deep sleep...
Data structure for temperature sensor description.
char * name
Name of the MEMS device.
BoardResourcesType const * halBoardGetDescription(void)
Return pointer to board description structure.
boolean adcFix
Flag to indicate whether the ADC range extension bug fix is implemented.
struct ButtonResourceStruct ButtonResourceType
Data structure for button description.
uint8_t gpioPort
GPIO port associated with the button.
char * name
Name of the button as printed in the board.
Data structure for MEMS description.
const MemsResourceType * mems
Board infrared MEMS description.
struct TempSensorResourceStruct TempSensorResourceType
Data structure for temperature sensor description.
void halBoardInit(void)
Initialize the board description data structure after autodetect of the boards based on the CIB Board...
struct LedResourceStruct LedResourceType
Data structure for led description.
void halBoardPowerUp(void)
Perform board specific action to power up the system.
uint8_t gpioPin
GPIO pin associated with the sensor.
struct BoardResourcesStruct BoardResourcesType
Data structure describing board features.
const ButtonResourceType * buttons
Pointer to button resources.
const TempSensorResourceType * temperatureSensor
Board infrared temeprature sensor description.
Data structure describing board features.
Data structure for led description.
const BoardIOType * io
Board I/O description.
struct MemsResourceStruct MemsResourceType
Data structure for MEMS description.