MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
hart_uart.h
1 
6 /*******************************************************************************
7 * Copyright (C) Maxim Integrated Products, Inc., All rights Reserved.
8 *
9 * This software is protected by copyright laws of the United States and
10 * of foreign countries. This material may also be protected by patent laws
11 * and technology transfer regulations of the United States and of foreign
12 * countries. This software is furnished under a license agreement and/or a
13 * nondisclosure agreement and may only be used or reproduced in accordance
14 * with the terms of those agreements. Dissemination of this information to
15 * any party or parties not specified in the license agreement and/or
16 * nondisclosure agreement is expressly prohibited.
17 *
18 * The above copyright notice and this permission notice shall be included
19 * in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
25 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 * OTHER DEALINGS IN THE SOFTWARE.
28 *
29 * Except as contained in this notice, the name of Maxim Integrated
30 * Products, Inc. shall not be used except as stated in the Maxim Integrated
31 * Products, Inc. Branding Policy.
32 *
33 * The mere transfer of this software does not imply any licenses
34 * of trade secrets, proprietary technology, copyrights, patents,
35 * trademarks, maskwork rights, or any other form of intellectual
36 * property whatsoever. Maxim Integrated Products, Inc. retains all
37 * ownership rights.
38 *******************************************************************************
39 */
40 
41 #ifndef _HART_UART_H_
42 #define _HART_UART_H_
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /***** Includes *******/
49 #include "stdint.h"
50 #include "afe.h"
51 #include "afe_adc_zero_regs.h"
52 #include "afe_adc_one_regs.h"
53 #include "afe_dac_regs.h"
54 #include "afe_hart_regs.h"
55 #include "mxc_sys.h"
56 #include "mxc_assert.h"
57 
58 /***** Definitions *****/
59 #define NORMAL_HART_TRANSCEIVE_MODE 0
60 #define HART_TEST_MODE_TX_1200 1
61 #define HART_TEST_MODE_TX_2200 2
62 
63 /***** Function Prototypes *****/
73 int hart_uart_setup(uint32_t test_mode);
74 
80 int hart_uart_enable(void);
81 
87 int hart_uart_disable(void);
88 
92 void hart_uart_test_transmit_1200(void);
93 
97 void hart_uart_test_transmit_2200(void);
98 
107 int hart_uart_send(uint8_t *data, uint32_t length);
108 
117 int hart_uart_get_received_packet(uint8_t* buffer, uint32_t* packet_length);
118 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif /* _HART_UART_H_ */